Re: [gtk-list] Re:? [gtk-list] Gtk--: Connecting to a static method?



> >Hi,
> >
> >can I use connect_to_method to connect to a static
> >class function? I'd like to do the following:
> >
> >class X {
> >        static int              foo();
> >        };
> >
> >connect_to_method (GtkMain::timeout(50), X, &X::foo);
> >
> >which unfortunateley doesn't work as I can't figure out
> >how to handle the 2nd argument. Is there any way I
> >can use a static function for this?
> >
> >Thanks a lot
> >--> Robert
> >
> I thought you can build a member function to call the static
> function. Just like this:
> 
> class X {
>         static int              foo();
>         int foo_shell()  {  foo();  }
>         };
> 
> connect_to_method (GtkMain::timeout(50), X, &X::foo);

Typically this would work. Unfortunateley this would require 
me to instantiate an object of type X, which is what I want to 
avoid ... as a previous poster noted, connect_to_function ()
is probably the right thing to use ...

Greetings
--> Robert



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