GTK+ Forums Forum Index GTK+ Forums
Discussion forum for GTK+ and Programming. Ask questions, troubleshoot problems, view and post example code, or express your opinions.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Destroy handler
Goto page Previous  1, 2
 
Post new topic   Reply to topic    GTK+ Forums Forum Index -> GTK+ Programming
Author Message
Micah Carrick
Never Seen the Sunlight


Joined: 21 Sep 2005
Posts: 481
Location: Portland, OR USA

PostPosted: Mon May 12, 2008 10:11 pm    Post subject: Reply with quote

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

PostPosted: Tue Jul 29, 2008 11:21 pm    Post subject: Reply with quote

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
Display posts from previous:   
Post new topic   Reply to topic    GTK+ Forums Forum Index -> GTK+ Programming All times are GMT
Goto page Previous  1, 2
Page 2 of 2

 


Powered by phpBB © 2001, 2005 phpBB Group
CodeBB 1.0 Beta 2
Protected by Anti-Spam ACP