[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: gEDA-user: pcb- no library dialog window on startup



   I made LibraryChanged call a new function
   ghid_library_window_get_visibility and only call
   ghid_library_window_show if it is already visible.  I used diff -u on
   /src/hid/gtk to get this patch.
   -Josh Jordan
   --- On Mon, 3/9/09, Peter TB Brett <peter@xxxxxxxxxxxxx> wrote:

     From: Peter TB Brett <peter@xxxxxxxxxxxxx>
     Subject: Re: gEDA-user: pcb- no library dialog window on startup
     To: "gEDA user mailing list" <geda-user@xxxxxxxxxxxxxx>
     Date: Monday, March 9, 2009, 10:04 PM
     -----Inline Attachment Follows-----

   On Monday 09 March 2009 21:51:10 Josh Jordan wrote:
   > The problem is when pcb builds the libraries on startup, the
   LibraryChanged
   > function is called.  This function only calls the
   show-library-window (sp?)
   > function when it should first check to see if library_window is
   visible...
   > I had made a new function called something like gboolean
   > library_window_visible(void) and added the prototype to gui.h, but I
   was
   > never able to get library_window->visible() to work.  I also tried
   > library_window.visible() and that didnt work either.  That is why I
   fell
   > back on the dirty, incorrect, but functional way.
   I still think you should persevere and get the "nice" way to work. :P
                                     Peter
   --
   Peter Brett
   Electronic Systems Engineer
   Integral Informatics Ltd

     -----Inline Attachment Follows-----

   _______________________________________________
   geda-user mailing list
   [1]geda-user@xxxxxxxxxxxxxx
   [2]http://www.seul.org/cgi-bin/mailman/listinfo/geda-user

References

   1. file://localhost/mc/compose?to=geda-user@xxxxxxxxxxxxxx
   2. http://www.seul.org/cgi-bin/mailman/listinfo/geda-user
Only in ../../../pcb-modified/src/hid/gtk: .deps
Only in ../../../pcb-modified/src/hid/gtk: .dirstamp
diff -u gtk/gtkhid-main.c ../../../pcb-modified/src/hid/gtk/gtkhid-main.c
--- gtk/gtkhid-main.c	2008-11-24 14:45:41.000000000 -0500
+++ ../../../pcb-modified/src/hid/gtk/gtkhid-main.c	2009-03-09 21:23:58.000000000 -0400
@@ -1749,7 +1749,10 @@
 static int
 LibraryChanged (int argc, char **argv, int x, int y)
 {
-  ghid_library_window_show (&ghid_port, FALSE);
+  if (ghid_library_window_get_visibility() == TRUE)
+    {
+      ghid_library_window_show (&ghid_port, FALSE);
+    }
   return 0;
 }
 
diff -u gtk/gui.h ../../../pcb-modified/src/hid/gtk/gui.h
--- gtk/gui.h	2008-11-24 14:45:41.000000000 -0500
+++ ../../../pcb-modified/src/hid/gtk/gui.h	2009-03-09 21:20:06.000000000 -0400
@@ -498,6 +498,7 @@
 void ghid_keyref_window_show (gboolean raise);
 
 /* gui-library-window.c */
+gboolean ghid_library_window_get_visibility (void);
 void ghid_library_window_show (GHidPort * out, gboolean raise);
 
 
diff -u gtk/gui-library-window.c ../../../pcb-modified/src/hid/gtk/gui-library-window.c
--- gtk/gui-library-window.c	2008-11-24 14:45:41.000000000 -0500
+++ ../../../pcb-modified/src/hid/gtk/gui-library-window.c	2009-03-09 21:19:29.000000000 -0400
@@ -138,6 +138,18 @@
     }
 }
 
+gboolean 
+ghid_library_window_get_visibility (void)
+{
+  if (library_window == NULL)
+    {
+      return FALSE;
+    }
+  else
+    {
+      return TRUE;
+    }
+}
 
 /*! \brief Opens a library dialog.
  *  \par Function Description

_______________________________________________
geda-user mailing list
geda-user@xxxxxxxxxxxxxx
http://www.seul.org/cgi-bin/mailman/listinfo/geda-user