Re: Timer start registration breaks the gtk_main()

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

 



On Sat, 26 Mar 2011 11:38:27 -0700 (GMT-07:00)
ikorot@xxxxxxxxxxxxx wrote:
> If I comment out the call to g_timer_add_seconds() it does not crash.
> 
> Here is what I do:
> 
> int main()
> {
>       CFrame *frame = new CFrame();
>       result = frame->OpenPort();
>       if( !result )
>           return 1;
>       else
>       {
>            g_timer_add_seconds( 1, (GSourceFunc) frame->ReadData(),
> NULL ); gtk_widget_show( window );
>            frame->ReadData();
>            gtk_main();
>       }
> }
> 
> in frame.h:
> 
> class CFrame
> {
>      void ReadData();
> }
> 
> Do you see any problems with that?

Yes, ReadData() is a non-static class member function.  Illegal casts
to avoid compilation failure has, as you can tell, not saved you here.

Since you don't provide the implementation of any of the other calls
you are making, it is possible (maybe likely) that there are a number of
other errors in your code.

Chris


_______________________________________________
gtk-list mailing list
gtk-list@xxxxxxxxx
http://mail.gnome.org/mailman/listinfo/gtk-list


[Index of Archives]     [Touch Screen Library]     [GIMP Users]     [Gnome]     [KDE]     [Yosemite News]     [Steve's Art]

  Powered by Linux