Re: Timer start registration breaks the gtk_main()

2011-03-27 Thread ikorot
Thank you for the help, guys. Everything works as expected. Now to check the data validity -Original Message- >From: Ingo Krabbe >Sent: Mar 27, 2011 3:33 AM >To: gtk-list@gnome.org >Subject: Re: Timer start registration breaks the gtk_main() > >On Sat, Mar 26,

Re: Timer start registration breaks the gtk_main()

2011-03-27 Thread Chris Vine
On Sat, 26 Mar 2011 20:27:04 -0700 (GMT-07:00) iko...@earthlink.net wrote: > >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 > Rea

Re: Timer start registration breaks the gtk_main()

2011-03-27 Thread Ingo Krabbe
replied too fast... - Forwarded message from Ingo Krabbe - > > static frame_ReadData(CFrame *f) { return f->ReadData(); } Actually and fully you will need static gboolean frame_ReadData(CFrame* f) { return f->ReadData(); } Note that frame_ReadData is a C function, so that static mean

Re: Timer start registration breaks the gtk_main()

2011-03-27 Thread ikorot
Ingo, -Original Message- >From: Ingo Krabbe >Sent: Mar 27, 2011 12:33 AM >To: gtk-list@gnome.org >Subject: Re: Timer start registration breaks the gtk_main() > >On Sat, Mar 26, 2011 at 11:48:38PM -0700, iko...@earthlink.net wrote: >> Lex, >> >> &g

Re: Timer start registration breaks the gtk_main()

2011-03-27 Thread Ingo Krabbe
On Sat, Mar 26, 2011 at 11:48:38PM -0700, iko...@earthlink.net wrote: > Lex, > > > -Original Message- > >From: Lex Trotman > >Sent: Mar 26, 2011 10:47 PM > >To: iko...@earthlink.net > >Cc: gtk-list > >Subject: Re: Timer start registratio

Re: Timer start registration breaks the gtk_main()

2011-03-27 Thread Robert Pearce
Hi iko...@earthlink.net, On Sat, 26 Mar 2011 20:45:53 -0700 (GMT-07:00) you wrote: > > > >Yes. You are casting the _RESULT_ of a _CALL_ to ReadData into a > >GSourceFunc, but ReadData returns void. This produces utterly random results. > > Yes, I believe I made a mistake here. I was not in fron

Re: Timer start registration breaks the gtk_main()

2011-03-26 Thread ikorot
Lex, -Original Message- >From: Lex Trotman >Sent: Mar 26, 2011 10:47 PM >To: iko...@earthlink.net >Cc: gtk-list >Subject: Re: Timer start registration breaks the gtk_main() > >>>It is not automagically passed a pointer to an instance of the object >>>

Re: Timer start registration breaks the gtk_main()

2011-03-26 Thread Lex Trotman
>>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

Re: Timer start registration breaks the gtk_main()

2011-03-26 Thread ikorot
Lex, -Original Message- >From: Lex Trotman >Sent: Mar 26, 2011 8:41 PM >To: iko...@earthlink.net >Cc: gtk-list >Subject: Re: Timer start registration breaks the gtk_main() > >>>ReadData() is not a good old C function, but a C++ method, carrying >&g

Re: Timer start registration breaks the gtk_main()

2011-03-26 Thread ikorot
Robert, -Original Message- >From: Robert Pearce >Sent: Mar 26, 2011 3:14 PM >To: iko...@earthlink.net >Cc: gtk-list@gnome.org >Subject: Re: Timer start registration breaks the gtk_main() > >Hi iko...@earthlink.net, > >On Sat, 26 Mar 2011 11:38:27 -0700 (

Re: Timer start registration breaks the gtk_main()

2011-03-26 Thread Lex Trotman
>>ReadData() is not a good old C function, but a C++ method, carrying >>around a pointer to the CFrame instance. You should make ReadData() static >>or use more advanced tecniques, such as libsigc++ [1]. > > So all I need is to do: > > class CFrame > { >     static void ReadData(); > } > > ? > > Th

Re: Timer start registration breaks the gtk_main()

2011-03-26 Thread ikorot
Chris, -Original Message- >From: Chris Vine >Sent: Mar 26, 2011 2:05 PM >To: iko...@earthlink.net >Cc: gtk-list@gnome.org >Subject: Re: Timer start registration breaks the gtk_main() > >On Sat, 26 Mar 2011 11:38:27 -0700 (GMT-07:00) >iko...@earthlink.net wrote:

Re: Timer start registration breaks the gtk_main()

2011-03-26 Thread ikorot
Nicola, -Original Message- >From: Nicola Fontana >Sent: Mar 26, 2011 1:10 PM >To: iko...@earthlink.net >Cc: Robert Pearce , gtk-list@gnome.org >Subject: Re: Timer start registration breaks the gtk_main() > >Il giorno Sat, 26 Mar 2011 11:38:27 -0700 (GMT-07:00) >

Re: Timer start registration breaks the gtk_main()

2011-03-26 Thread ikorot
Tadej, -Original Message- >From: Tadej Borovšak >Sent: Mar 26, 2011 12:54 PM >To: gtk-list@gnome.org >Subject: Re: Timer start registration breaks the gtk_main() > >Hello. > >> int main() >> { >> CFrame *frame = new CFrame(); >>

Re: Timer start registration breaks the gtk_main()

2011-03-26 Thread Robert Pearce
Hi iko...@earthlink.net, On Sat, 26 Mar 2011 11:38:27 -0700 (GMT-07:00) you wrote: > Hi, Robert, > > Here is what I do: > > int main() > { > CFrame *frame = new CFrame(); > result = frame->OpenPort(); > if( !result ) > return 1; > else > { >g_t

Re: Timer start registration breaks the gtk_main()

2011-03-26 Thread Chris Vine
On Sat, 26 Mar 2011 21:10:30 +0100 Nicola Fontana wrote: > ReadData() is not a good old C function, but a C++ method, carrying > around a pointer to the CFrame instance. You should make ReadData() > static [ ...] That is a less grievous error than the original code (it will work on gcc), but a po

Re: Timer start registration breaks the gtk_main()

2011-03-26 Thread Chris Vine
On Sat, 26 Mar 2011 11:38:27 -0700 (GMT-07:00) iko...@earthlink.net 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 ) >

Re: Timer start registration breaks the gtk_main()

2011-03-26 Thread Nicola Fontana
Il giorno Sat, 26 Mar 2011 11:38:27 -0700 (GMT-07:00) iko...@earthlink.net ha scritto: > Hi, Robert, > > > -Original Message- > >From: Robert Pearce > >Sent: Mar 26, 2011 2:19 AM > >To: gtk-list@gnome.org > >Cc: iko...@earthlink.net > >Subjec

Re: Timer start registration breaks the gtk_main()

2011-03-26 Thread Tadej Borovšak
Hello. > 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 ); >fr

Re: Timer start registration breaks the gtk_main()

2011-03-26 Thread ikorot
Hi, Robert, -Original Message- >From: Robert Pearce >Sent: Mar 26, 2011 2:19 AM >To: gtk-list@gnome.org >Cc: iko...@earthlink.net >Subject: Re: Timer start registration breaks the gtk_main() > >Hi iko...@earthlink.net, > >On Sat, 26 Mar 2011 01:54:31 -0700 (

Re: Timer start registration breaks the gtk_main()

2011-03-26 Thread Robert Pearce
Hi iko...@earthlink.net, On Sat, 26 Mar 2011 01:54:31 -0700 (GMT-07:00) you wrote: > Hi, ALL, > Is it possible for the timer to cause gtk_main() to crash? > It's possible for anything to become the point where your program crashes if you are sufficiently badly abusing it. Why do you pick on "the t