Re: NSStepper strangeness
Re: NSStepper strangeness
- Subject: Re: NSStepper strangeness
- From: Thomas Lachand-Robert <email@hidden>
- Date: Sun, 17 Mar 2002 13:27:13 +0100
Le dimanche 17 mars 2002, ` 11:49 , Dietmar Planitzer a icrit :
From: Thomas Lachand-Robert <email@hidden>
If I set my NSStepper to "autorepeat", I get the following error in the
console when trying to use it:
*** Assertion failure in +[NSEvent
startPeriodicEventsAfterDelay:withPeriod:], NSEvent.m:1106
Periodic events are already being generated
What does it mean? The only possible "periodic event" in my case are
calls
to GLUT idle function, which seems unrelated.
Actually, its very likely related to the GLUT idle function. Idle
functions
in GLUT are driven by periodic events. The use of periodic events is
necessary in order to guarantee that your idle function gets called often
enough as otherwise it would only be called as the result of a user event
(mouse click, mouse move, etc.).
Sadly there's no easy way around this. The idle function must be called
after the work and platform events have been processed and after the timer
function has been executed, thus it isn't possible for GLUT to use an
NSTimer instead for the idle function. Changing the order of event
processing is not an option because too many GLUT apps rely on this exact
order inherited from the X Windows implementation...
I'm really stumped by this HUGE bug in Apple's implementation of GLUT.
This makes GLUT almost unusable in a Cocoa application, because I
discovered that NSStepper are not the only ones affected: any scroller in
any window causes a similar error. For instance, in my app, I use
NSDocument's loadDataRepresentation as usual. But this doesn't work AT ALL
because the open panel has scrollers! So I can't even open a document...
I tried with your own implementation of GLUT, with no luck.
Any workaround (even dirty hack) would be greatly appreciated. Is it
possible to have my idle function called another way (by the main loop of
the app, whatever)?
Thomas Lachand-Robert
********************** email@hidden
<< Et le chemin est long du projet ` la chose. >> Molihre, Tartuffe.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.