Signals



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.

2) I guess I could create a bogus event and call the signal-handling
   routine directly, but that's ugly and I'm pretty sure there's a
   better and more elegant way.

   How?

Any help would be very appreciated, TIA,

Fil

+-----------------------------------------------------------------------+
| Dr. Fil Bonjour                   | Fil Bonjour                       |
| UNICAMP, IMECC, DMA - Room 328    | Rua Alberto de Salvo 53           |
| 13081-970 Campinas SP Brazil      | 13084-670 Campinas SP Brazil      |
| Phone: (++55.19) 3788.60.44       | Phone: (+55.19) 3289.77.84        |
| Fax:   (++55.19) 3289.14.66       |                                   |
| Email: bonjour ime unicamp br     | Email: fbonjour uol com br        |
| http://www.ime.unicamp.br/~bonjour|                                   |
+-----------------------------------------------------------------------+





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