Re: passing parameters



Tristan Van Berkom wrote:

samuel.berthelot wrote:

<...>

Actually my code doesn't work. But I need to pass the id variable as a parameter. Any idea ?

Have you tried to use gtk_widget_add_events(glarea, GDK_POINTER_MOTION_MASK) ?
<...>

If the user_data argument for this signal has been removed
(or never existed); which I doubt is the case (almost all
event signals if not all of them; provide a user_data arg

You are wrong. All "*-event" signals of GtkWidget have such argument.
http://developer.gnome.org/doc/API/2.0/gtk/GtkWidget.html#GtkWidget-motion-notify-event

);
You can consider using:
   `g_object_set_data(G_OBJECT(glarea), "id", (gpointer)id)'
and
   `id = g_object_get_data(G_OBJECT(glarea), "id")'

This is slower and consumes memory, in almost all cases you just need to pass an additional parameter.

   Olexiy




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