Thank you for the help, guys. Everything works as expected. Now to check the data validity....
-----Original Message----- >From: Ingo Krabbe <[email protected]> >Sent: Mar 27, 2011 3:33 AM >To: [email protected] >Subject: Re: Timer start registration breaks the gtk_main() > >On Sat, Mar 26, 2011 at 11:48:38PM -0700, [email protected] wrote: >> Lex, >> >> >> -----Original Message----- >> >From: Lex Trotman <[email protected]> >> >Sent: Mar 26, 2011 10:47 PM >> >To: [email protected] >> >Cc: gtk-list <[email protected]> >> >Subject: Re: Timer start registration breaks the gtk_main() >> > >> >>>It is not automagically passed a pointer to an instance of the object >> >>>(no "this") so it will only work if the function does not access any >> >>>instance members. >> >> >> >> Which means that every member of the class that will be used by this >> >> function >> >> should be static. But this is not good. >> > >> >Not if you want more than one instance :-) >> >> Which is not the case here. ;-) > >To make that finally clear, thats why the signal functions pass a data >pointer. So to use C++ you can always either pass the object into the >static function: > > class CFrame { > static gboolean ReadData(CFrame* me); > }; > /* ... */ > g_timeout_add_seconds(1,(GSourceFunc)CFrame::ReadData,frame); > >or I would prefer to leave the C++ alone and write a small wrapper > > frame_ReadData(CFrame* f) { return f->ReadData(); } > /* ... */ > g_timeout_add_seconds(1,(GSourceFunc)frame_ReadData,frame); > >_______________________________________________ >gtk-list mailing list >[email protected] >http://mail.gnome.org/mailman/listinfo/gtk-list _______________________________________________ gtk-list mailing list [email protected] http://mail.gnome.org/mailman/listinfo/gtk-list
