Re: gladexml and multiple windows

From: Date: Wed, 13 Nov 2002 21:54:16 +0000
Subject: Re: gladexml and multiple windows
References: 1  Groups: php.gtk.general 
Request: Send a blank email to php-gtk-general+get-2620@lists.php.net to get a copy of this message
G'day Alexander, You ask how to write a handler for your file selection dialog cancel button so that it destroys the file selection dialog window. Here is how I do it ... # destroy a window given any widget pointer function kill_window($widget) { $window = $widget->get_toplevel(); $window->destroy(); } On the other hand, you may need the window again, so it is more efficient to hide it and show it again later. But then you'd need to keep a global pointer to the window, or some other way of storing it. $window->hide(); $window->show(); The cancel button handler ... function on_file_selection_dialog_cancel_clicked($widget) { kill_window($widget); } I'm surprised you used two .glade files rather than one, but it should not cause any difference. Finally, trying to parse this question ... On Wed, Nov 13, 2002 at 05:15:35PM +0200, Alexander Kuznetsov wrote: > How can access FileSelectionDialog inner widget (cancel button for > example) properties (such as show/hide or destroy) > from my script after I launch Gtk::main()? You can't do it in the stream of execution below Gtk::main(), of course, since it doesn't return there. You can only do this in handlers for other widgets. You will either need to record the pointer to the file selection dialog window in a global variable, or find some other way for it to be available to a main window handler. -- James Cameron mailto:quozl@us.netrek.org http://quozl.netrek.org/

« previous php.gtk.general (#2620) next »