[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Google
  Web www.spinics.net

Re: Timer start registration breaks the gtk_main()



Chris,



-----Original Message-----
>From: Chris Vine <chris@xxxxxxxxxxxxxxxxxxxxx>
>Sent: Mar 26, 2011 2:05 PM
>To: ikorot@xxxxxxxxxxxxx
>Cc: gtk-list@xxxxxxxxx
>Subject: Re: Timer start registration breaks the gtk_main()
>
>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.

So in order to fix it, I need to use 'static' in front of 'void ReadData()'?

Thank you.

>
>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


[GIMP Users]     [Yosemite News]    [Yosemite Photos]    [Gimp's Home]     [Steve's Art]

Add to Google Powered by Linux