Widget realization with respect to current theme




I noticed that if I create a GtkButton, call gtk_widget_show for the button, then call 
gtk_widget_size_request, it returns a guesstimate.  With my current theme selection, this turns out to be a 
few pixels too small.

If I then add it to a container, add the container to a GtkWindow, and show all of them, the GtkButton ends 
up being notified of what size it really needs to request for the current theme.

Two questions:

1. Is there a way to force the widget to query the theme before showing the window?  "You don't need to" is a 
legitimate answer, but I'd like to know the real answer if there is one.

2. When the window is shown, does the Gtk (perhaps the GtkButton itself) query the display server for the 
theme information, or does the display server actively send a "theme changed" event?  I suspect the latter 
since if the user changes themes on the fly, the display server must be able to somehow notify the existing 
windows that this has occurred.  In either case, how does this work?  The "Understanding Metacity Themes" 
GNOME library documentation doesn't cover this aspect of themes at all - what to expect from the program's 
point of view.

Thanks,
Brian


      



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