Re: gtk_widget_destroy on popup freezes application



On Wed, 1 Aug 2001, Mattias Persson wrote:

> I have a problem with my killing (of popups that is :-) 
> ).
> >From my top-level window i create a popup window by 
> clicking a button:
> 
> gtk_signal_connect(GTK_OBJECT(pop_button), "released",
>                    GTK_SIGNAL_FUNC(clicked_button),
>                    NULL);
> 
> void clicked_button(GtkButton* butt, gpointer data){
>    GtkWidget* popup;
>    popup = create_popup();
>    gtk_widget_show(popup);
> }
> 
> This popup has a close button which is supposed to 
> close the popup:
> 
> gtk_signal_connect(GTK_OBJECT(close_button), "released",
>                    GTK_SIGNAL_FUNC(kill_popup), myself);

connect to "clicked" here, GtkButton's "pressed", "released",
"enter" and "leave" signals aren't really there for people
to connect to.

> where myself is the popup itself.
> 
> int kill_popup(GtkButton* butt, gpointer data){
>    gtk_widget_destroy(GTK_WIDGET(data));
>    return TRUE;
> }

the signature for signal handlers connected to "released" (though
you shouldn't use it) and "clicked" is:

static void kill_popup (GtkButton* butt, gpointer data);

> 
> Thx
> /Mattias
> 

---
ciaoTJ





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