Getting a pointer to a dialog's 'Cancel' button

GtkWidget *dialog = gtk_dialog_new_with_buttons ("My diaolg", app_main_window,
                                      GTK_STOCK_CANCEL, GTK_RESPONSE_REJECT, NULL);

I want to display the above dialog non-modally (after adding its various children) and I want the 'Cancel' 
button to close it.  This means I can't run the dialog using gtk_dialog_run() because that effectively makes 
it modal.  The strategy I decided was to attach a signal handler to the 'Cancel' button and use it to destroy 
its parent dialog.

Firstly, is that an advisable strategy?  Secondly, how do I obtain a pointer to the dialog's 'Cancel' button 
so that I can connect a signal handler to it?  I looked for functions like gtk_dialog_get_child() or 
gtk_window_get_child_with_id() or something similar but I couldn't find anything.


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