Re: [gtk-list] gtk--: connected methods with args




On Sat, 29 Aug 1998, Olof Oberg wrote:
> Is it possible to connect to a method that needs arguments, like: 
> 
> #define FOO 0
> #define BAR 1
> Gtk_Button *foo = new Gtk_Button("Foo");
> Gtk_Button *bar = new Gtk_Button("Bar");
> connect_to_method(foo->pressed, this, &button_pressed(FOO));
> connect_to_method(bar->pressed, this, &button_pressed(BAR));
                                                      ^^^^^^ this 
doesn't compile, I imagine.

Do this: 
connect_to_method(bar->pressed, this, &button_pressed, 0);

That should work.

Havoc



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