gtk_signal_connect
- From: "Andrés" Giraldo <andres_giraldo yahoo com>
 
- To: Gtk List <gtk-list gnome org>
 
- Subject: gtk_signal_connect
 
- Date: Sat, 30 Jun 2001 07:06:30 -0700 (PDT)
 
Hi!
I created a class that connect 2 signals from 2
widgtes to the same function:
class myclass
  {
    char *string;
    myclass
      {
        string = "Hello World";
      }
    void some_function ()
      {
        GtkWidget *button = gtk_new_button_with_label
("Tes")
        GtkWidget *drawing_area = gtk_drawing_area_new
();
        ...
        gtk_widget_show (button);
        gtk_widget_show (drawing_area);
        gtk_signal_connect (GTK_OBJECT (button),
"clicked", GTK_SIGNAL_FUNC (on_button_clicked), this)
        gtk_signal_connect (GTK_OBJECT (drawing_area),
"expose_event", GTK_SIGNAL_FUNC
(on_drawing_area_expose_event), this)
      }
    static void on_button_clicked (GtkButton *button,
gpointer arg)
      {
        ((myclass *) arg)->test ();
      }
    static void on_drawing_area_expose_event
(GtkDrawingArea *drawing_area, gpointer arg)
      {
        ((myclass *) arg)->test ();
      }
    void test ()
      {
        cout << string << "\n";
      }
  }
So... why it works with the "clicked" button's signal,
but it doesn't work with the "expose_event"
drawing_area's signal?
__________________________________________________
Do You Yahoo!?
Get personalized email addresses from Yahoo! Mail
http://personal.mail.yahoo.com/
[
Date Prev][
Date Next]   [
Thread Prev][
Thread Next]   
[
Thread Index]
[
Date Index]
[
Author Index]