Re: Why this comportment ?



lomba wrote:

Hello,

i've a big problem with gtk... I create a window, with many elements and a
simple button which has to destroy the window when I click on it.
I use a gtk_signal_connect with the fonction _widget_destroy and the name of
the window in parameter. Unfortunately, this is my button which disappear
and not my window. A solution ?

Yout problem: when callback (gtk_widget_destroy) is called it gets a pointer to button as a parameter. The simpliest solution for gtk+-1.2 is: gtk_signal_connect_object(GTK_OBJECT(button), "clicked", (GtkSignalFunc)gtk_widget_destroy, window).
As for gtk+-2.0 consider non-deprecated g_signal* functions.

Olexiy




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