Using data parameter for callback functions
- From: Malek Naffati <Redhat tuX gmx net>
- To: gtk-app-devel-list gnome org
- Subject: Using data parameter for callback functions
- Date: Sun, 25 Jan 2004 19:00:55 +0100
I've yet successfully been trying to pass a window handle to a callback function through the data parameter
g_signal_connect (G_OBJECT (cancel_button), "button_press_event",
G_CALLBACK (cancel_button_pressed), GTK_OBJECT(window));
calling
static gboolean cancel_button_pressed(GtkWidget *widget, gpointer data)
{
gtk_widget_hide(data);
return TRUE;
}
This results in a segfault...
The Address of data in cancel_button_pressed does not reference
the parameter passed to it in g_signal_connect. Why is this?
Am I getting something wrong here.
The GIMP about dialog uses a global variable to store the window handle
which I pretty much "dislike".
Also I've used gtk_widget_hide. I believe to remember that Windows API(tm?!) does it the same way, not really
unallocating space
used for widgets. Does gtk+ use garbage collection?
- Malek
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]