Re: Question about the "realize" signal



On Dec 4, 2007 3:06 AM, Dan H <dunno stoptrick com> wrote:
Hello,

I like to build my GUIs with Glade, but as Glade is quite limited in what it can do I usually write 
routines that "finalize" the GUI after the Glade stuff has been set up. For example, in a current project I 
have a table which is full of radiobuttons, but Glade always creates those with a label, and to remove that 
label I have to call gtk_container_remove() on each button in that table. Or in another dialog I like to 
use custom widgets, so I build the window in Glade using dummy widgets and then call a routine that finds 
and removes the dummies and replaces them with what I want.

Usually I place the "fixup" code in routines that connect to the "realize" signal for the containing widget 
(in the first example, for instance, the "realize" signal for the table that contains all the 
radiobuttons). This always works, but what got me thinking was: Is it safe? Can't the table be realized 
first without buttons, so my routine that iterates over all contained buttons finds nothing? Am I relying 
on some particular oder here in which Glade builds the GUI elements?

In short: What's the best way of doing what I need to do?


Don't know how to handle the first issue, but the second one may be
handled by using the "Custom Widget" option in glade (under "GTK+
Additional". There are four generic properties (string 1&2, integer
1&2) that you can use. When glade parses the xml file, it will try to
execute the specified
creation function (search Devhelp for "GladeXMLCustomWidgetHandler"),
which is responsible for actually constructing the widget. This
function will receive the widget name and the four parameters.

-Jim



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