Detecting window from button



Hi,

I could use some help from an experienced Gtk programmer.  I would
like to find out to which dialog (window) a button belongs.

Whenever a button is pressed the signal handler receives the pointer
to the GtkWidget of the button.  I'm sure there is a way to find out
to which container this button belongs and so on until one has found
the main window.

The main reason I'm asking is the following scenario:

Application X contains an entry field and two buttons.  Whenever the
OK button is pressed the content of the entry is tested.  If the
content isn't correct an error dialog pops up.

The new dialog has a Close button.  However the signal handler doesn't
know which window to close.  Storing one global variable for this very
windows isn't a solution but a bad workaround.

In connection to the above scenario I wonder how it would be possible
to disable the OK button in the main dialog until the data is
processed (and the window is closed anyway) or the error box is
closed.

Regards,

	Joey

-- 
All language designers are arrogant.  Goes with the territory...
	-- Larry Wall



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