--- Stéphane Genaud <[EMAIL PROTECTED]> wrote:
> Hello all,
>
> i have build a small gnome application interface
> with glade, and i am
> using libglade to run the interface. My problem is
> with pop-up windows :
> I sketch what says my code :
>
> - in main window, when popup button is clicked
> gtk_widget_show( popup );
>
> - the popup callbacks attached to ok and cancel
> buttons are :
>
> on_popup_ok/cancel_clicked( ...) {
> gtk_widget_hide( pref_dialog );
> }
>
> This works as long as the user uses the ok/cancel
> buttons to close the
> window. But if the user closes it with the window
> manager, then the
> widget
> can't be shown again since it has been destroyed.
> So i have tried to specify the following Signals for
> my popup widget :
>
> destroy_event ---> gtk_widget_hide
> delete_event ---> gtk_widget_hide
>
The handler on the destroy event needs to "eat" the
signal that caused it by returning TRUE. If you don't
do that then the delete event signal will be
propagated and somewhere further along in the handler
chain the default delete event handler will generate a
destroy event, which will then destroy the window. So
you need to roll a little callback that wraps
gtk_widget_hide and returns TRUE and hook it up to
delete event.
>
> And this does not work : my widget seems to be still
> unreferenced on a
> kill
> by the WM and i get the same gtk message :
> Gtk-CRITICAL **: file gtkwidget.c: line 1425
> (gtk_widget_show):
> assertion `GTK_IS_WIDGET (widget)' failed.
>
> My question is : am i wrong in doing that that way ?
>
>
> Thanks.
>
> --
>
/***************************************************************/
> /* Stéphane Genaud
> */
> /* IECS, Université Robert Schuman
> */
> /* 61 av. de la Forêt Noire, 67085 Strasbourg
> */
> /* Bureau 107 tel : 0390414298
> */
>
/***************************************************************/
>
>
+---------------------------------------------------------------------+
> To unsubscribe from this list, send a message to
> [EMAIL PROTECTED]
> with the line "unsubscribe glade-devel" in the body
> of the message.
__________________________________________________
Do You Yahoo!?
Get Yahoo! Mail – Free email you can access from anywhere!
http://mail.yahoo.com/
+---------------------------------------------------------------------+
To unsubscribe from this list, send a message to [EMAIL PROTECTED]
with the line "unsubscribe glade-devel" in the body of the message.