Re: NSStepper strangeness
Re: NSStepper strangeness
- Subject: Re: NSStepper strangeness
- From: Dietmar Planitzer <email@hidden>
- Date: Sun, 17 Mar 2002 19:53:04 +0100
>
From: Thomas Lachand-Robert <email@hidden>
>
>
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...
First of all, its not Apple which is responsible for this problem, its
actually me who came up with this implementation back in the Rhapsody days.
Well, the core problem here is that you want to use GLUT with another GUI
framework. This mode of operation is not supported by GLUT no matter what
platform. While you may be able to mix and match stuff from GLUT and the
platform's own GUI framework, there is no guarantee that this works.
There is simply no way to correctly implement an API like GLUT such that it
can guarantee the same semantics as on X Windows and at the same time offer
the possiblity to mix it with another GUI framework like Cocoa, Carbon or
Java for that matter.
Anyway, I wonder why you are using GLUT at all in a Cocoa app. Couldn't you
use an NSOpenGLView instead ?
>
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)?
The idle function is called at the end of the main loop from the -sendEvent:
method in GLUTApplication. The problem here is that -sendEvent: is only
called if an event is available as otherwise the NSApp runloop simply blocks
and thus the idle function would never get called. So to ensure that we
constantly get events, the glutIdleFunc() enables the generation of periodic
events. It may be possible to use an NSTimer instead, although it would be
necessary to clarify what this means for performance and more importantly
what impact it would have on existing GLUT apps. Again, the fundamental
problem here is that events, timers and the idle function must be executed
in a very specific order as otherwise many apps break...
Regards,
Dietmar Planitzer
_______________________________________________
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.