Re: Main application loop question : what is inside [NSApp run] ?
Re: Main application loop question : what is inside [NSApp run] ?
- Subject: Re: Main application loop question : what is inside [NSApp run] ?
- From: Robert Fischer <email@hidden>
- Date: Wed, 5 Mar 2003 09:17:27 +0100
On Tuesday, March 4, 2003, at 06:28 PM, Tristan Lorach wrote:
Any idea of what's inside [NSApp run] ?
Sorry, dunno this. But maybe it helps you that I am also writing a
OpenGL based application which needs animations etc. but full control
of the GUI nevertheless. The appended code does it for me, but I am ot
sure if this could not be enhanced. At least you get the idea where to
look for:
//-------------------------------------------------------------------
// timer
//-------------------------------------------------------------------
+ (void)start
{
if(timer != nil) return;
timer = [[NSTimer scheduledTimerWithTimeInterval:0.01
target:self
selector:@selector(fire)
userInfo:nil
repeats:YES] retain
];
// The next two lines make sure that animation will continue to
occur
// while modal panels are displayed and while event tracking is
taking
// place (for example, while a slider is being dragged).
// (from /Developer/Examples/AppKit/CircleView)
[[NSRunLoop currentRunLoop] addTimer:timer
forMode:NSModalPanelRunLoopMode];
[[NSRunLoop currentRunLoop] addTimer:timer
forMode:NSEventTrackingRunLoopMode];
}
Cheers,
Robert
--
--- - .-. -- --
--- / \ ---- tin:b Software
.-. / \ --- .-. __o .-. (i)
/ \ / \ / \ _`\<,_ / \ Robert Fischer
/ \ / \ / \ (*)/ (*) / `---------------
/ `---' `-' `-----------'
_______________________________________________
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.