Re: Signals



Filipe Bonjour wrote:

Hi,

I'm just starting programming with GTK, and I'm having problems with
events. Specifically, I'm writing a program (using GTK/Gnome built by
Glade) to visualize data in 2D/3D using a GtkGlArea widget (a subclass
of GtkDrawingArea).

In short, I have several drawing options, and I want to send the
GtkGlArea widget an expose event when the user changes any of these
options. I have tried things like:

  gtk_signal_emit_by_name(glarea, "expose_event");
  gtk_signal_emit_by_name(glarea, "expose-event");

(which cause a SIGSEGV) and

  gtk_signal_emit(glarea, 32);
  gtk_signal_emit(glarea, GDK_EXPOSE);
  gtk_signal_emit(glarea, gtk_signal_lookup("expose_event",
                                            GTK_TYPE_GL_AREA));
  gtk_signal_emit(glarea, gtk_signal_lookup("expose-event",
                                            GTK_TYPE_GL_AREA));

which are at best ignored. So I have a few questions...

1) Where are the signal numbers and names defined? I couldn't find them
   anywhere. For gtk_signal_emit I find it hard to believe that we are
   expected to give an actual number, I thought there would be some
   defined symbols, such as "#define GTK_SIGNAL_EXPOSE 32" or something.


gtk_signal_emit_by_name (GTK_OBJECT (widget), "expose_event", widget);

which mean that you have to provide all parameter of the function which
is call when the signal is emited.

In my case the prototype is :
gint f (GtkWidget *widget, GdkEventExpose *event, gpointer userdata)

Hope this help


--
Florent DEVIN, 33 (0)3 20 43 47 30, Fax (33) (0)3 20 43 65 66 (Fax LIFL)
LIFL, Laboratoire d'Informatique Fondamentale de LILLE
USTL, Bureau 326, Batiment M3, 59655 Villeneuve d'Ascq Cedex





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