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

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



   LibraryChanged is just fine if it does nothing.  The only time I have
   seen that it is called is if you change the library path in
   preferences.  I suppose it would then update the library window if it
   were open or open it if its not already open.  You could just make
   LibraryChanged do nothing and never notice the difference.  If your
   library window is open while you update the library path preference,
   you would just have to reopen it to get the updated library window.  I
   have tried getting gtk visibility, there is a gtk widget method called
   visible but I have not had success with the syntax.
   --- On Tue, 3/10/09, Peter Clifton <pcjc2@xxxxxxxxx> wrote:

     From: Peter Clifton <pcjc2@xxxxxxxxx>
     Subject: Re: gEDA-user: pcb- no library dialog window on startup
     To: "gEDA user mailing list" <geda-user@xxxxxxxxxxxxxx>
     Date: Tuesday, March 10, 2009, 11:27 AM

   On Mon, 2009-03-09 at 18:55 -0700, Josh Jordan wrote:
   >
   > +gboolean
   > +ghid_library_window_get_visibility (void)
   > +{
   > +  if (library_window == NULL)
   > +    {
   > +      return FALSE;
   > +    }
   > +  else
   > +    {
   > +      return TRUE;
   > +    }
   > +}
   The patch pedant in me says:
   +gboolean
   +ghid_library_window_get_visibility (void)
   +{
   +  return (library_window != NULL);
   +}
   Or to use the appropriate GTK function to get true visibility (not
   tested, but something like):
   +gboolean
   +ghid_library_window_get_visibility (void)
   +{
   +  if (library_window != NULL && GTK_WIDGET_VISIBLE (library_window))
   +    return TRUE;
   +  return FALSE;
   +}
   I presume the former code works because PCB doesn't currently keep an
   unshown GtkWindow widget hanging around in the library_window
   variable.
   However.. I'm not sure why LibraryChanged() needs to re-show the
   library
   window in the first-place (for any situation). Since we pass raised =
   FALSE, and if I assume that the window is already visible, the only
   executed code is:
     gtk_editable_select_region (GTK_EDITABLE
                     (GHID_LIBRARY_WINDOW (library_window)->
                      entry_filter), 0, -1);
     /* Set the focus to the filter entry only if it is in the current
        displayed tab */
     notebook = GTK_NOTEBOOK (GHID_LIBRARY_WINDOW
   (library_window)->viewtabs);
     current_tab = gtk_notebook_get_nth_page (notebook,
                          gtk_notebook_get_current_page
                          (notebook));
     entry_filter =
       GTK_WIDGET (GHID_LIBRARY_WINDOW (library_window)->entry_filter);
     if (gtk_widget_is_ancestor (entry_filter, current_tab))
       {
         gtk_widget_grab_focus (entry_filter);
       }
   Does anything break if you just remove the ghid_library_window_show
   (&ghid_port, FALSE); call from the "LibraryChanged" function?
   I'd guess you'd need to put a printf in the LibraryChanged function
   and
   ensure that it gets triggered at least once or twice in testing, to
   verify that nothing unexpected happens, such as the library window
   going
   out of sync.
   --
   Peter Clifton
   Electrical Engineering Division,
   Engineering Department,
   University of Cambridge,
   9, JJ Thomson Avenue,
   Cambridge
   CB3 0FA
   Tel: +44 (0)7729 980173 - (No signal in the lab!)
   _______________________________________________
   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

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