 |
GTK+ Forums Discussion forum for GTK+ and Programming. Ask questions, troubleshoot problems, view and post example code, or express your opinions.
|
|
|
| Author |
Message |
|
|
Micah Carrick Never Seen the Sunlight
Joined: 21 Sep 2005 Posts: 480 Location: Portland, OR USA
|
Posted: Mon May 12, 2008 10:11 pm Post subject: |
|
|
| No need to apologize... that's what this forum was created for. There's a lot to learn. But don't worry, it gets easier as you go. |
|
| Back to top |
|
 |
days_of_ruin Familiar Face
Joined: 19 May 2008 Posts: 7
|
Posted: Tue Jul 29, 2008 11:21 pm Post subject: |
|
|
| Micah Carrick wrote: | For anyone interested, here is how you can think of it (simplified).
When the user clicks the 'x' in the title bar, the "delete-event" signal is triggered for the widget GtkWindow. The default handler is called which will then destroy the object triggering the "destroy" signal on that GtkObject.
However, if you specify a callback function to the "delete-event" signal, you can tell GTK based on your return value whether or not to call the default handler as well, known as propagating the signal. If you return TRUE from your callback function, then your callback function will be the only/last function for that signal. However, if you return FALSE then the default handlers for that "delete-event" signal will run.
There are some other signals for which this can apply. Pay attention to the prototype in the documentation. If it has a gboolean value as the return in the callback function prototype then it's probably a signal that you may need to stop propagation.
This is commonly used with a quit dialog in applications--such as in this example:
http://www.gtkforums.com/about672.html |
YEEEESS!!!! My problem is finally solved!thank you! |
|
| Back to top |
|
 |
|
Powered by phpBB © 2001, 2005 phpBB Group CodeBB 1.0 Beta 2
|