Hi,
Am Montag, den 14.12.2009, 04:12 +0100 schrieb Milosz Derezynski:
> bool
> on_my_toplevel_delete_handler( GdkEventAny* G_GNUC_UNUSED )
Just as a side note, the unused attribute is not necessary if you omit
the parameter name, as you did.
> int main( int argc, char* argv[])
> {
> Gtk::Main kit (argc, argc);
> Gtk::Window my_toplevel ;
> // some other code to setup the app in between
>
> my_toplevel.signal_delete_event().connect( sigc::ptr_fun(
> &on_my_toplevel_delete_handler ), true /* important! */ );
> my_toplevel.show();
> kit.run();
Note that you can still use Gtk::Main::run(my_toplevel) for simplicity.
It connects signal_hide() to Gtk::Main::quit(), not delete_event. The
window will not be hidden in response to delete_event if you return true
from the handler to stop the signal emission.
Cheers,
--Daniel
_______________________________________________
gtkmm-list mailing list
[email protected]
http://mail.gnome.org/mailman/listinfo/gtkmm-list