discuss-gnustep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

trying to understand the run loop


From: Lloyd Dupont
Subject: trying to understand the run loop
Date: Wed, 8 Mar 2006 12:15:55 +1000

My application is not a GNUstep application at all.
Yet it uses Foundationand some of AppKit classes.
Now I'm trying to setup a framework so that everything works as well as possible.

Problem is, I don't have an explicit run loop, event pump in my developement environment, it's all event based. Yet I registerer ed an event handle on the application Idle event and manage to simulate a run loop with that.

I try to mimic the code below in my code and, I would welcome any comment, addition:


// pseudo code of my application, am I missing something?

NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init];
NSUndoManager *undoManger = GetUndoManager();
[NSApplication shared];
[pool release];

while(event = GetEvent())
{
   pool = [[NSAutoreleasePool alloc] init];

   DoEvent(event);

GSNotifyASAP(); // no I won't use [runLoop runModeBeforeDate] it mess up my application
   GSNotifyIdle();

   while([undoManager groupingLevel] > 0)
       [undoManager endUndoGrouping];

   [pool release];
}




reply via email to

[Prev in Thread] Current Thread [Next in Thread]