Changeset 20722

Show
Ignore:
Timestamp:
08/14/07 08:49:23 (1 year ago)
Author:
patrick
Message:

I forgot a critical piece of information in the explanation of how to create
a custom NSApplication delegate.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • juggler/trunk/modules/vrjuggler/doc/programmer.guide/programmer.guide.xml

    r20713 r20722  
    1142711427   } 
    1142811428 
     11429   -(void) applicationDidFinishLaunching:(NSNotification*) aNotification 
     11430   { 
     11431      // We're ready to allow windows to open! 
     11432      NSConditionLock* lock = gadget::InputAreaCocoa::getWindowLock(); 
     11433      [lock unlock]; 
     11434   } 
     11435 
    1142911436   -(BOOL) application:(NSApplication*) theApplication 
    1143011437              openFile:(NSString*) file 
     
    1153611543               it down when the time is right. Because of that, we want the 
    1153711544               kernel to control the termination process.</para> 
     11545            </section> 
     11546 
     11547            <section> 
     11548               <title><methodname>-applicationDidFinishLaunching:</methodname></title> 
     11549 
     11550               <para>When the application finishes launching, NSApplication 
     11551               sends this message to its delegate. In the case of VR Juggler, 
     11552               this is when we know that it is safe to allow threads for 
     11553               Gadgeteer input windows and VR Juggler graphics pipes to open 
     11554               windows. Until now, any such threads have been blocking on the 
     11555               global window lock, acquired when 
     11556               <classname>vrj::CocoaWrapper</classname> was instantiated. When 
     11557               the delegate receives this message, it is time to release that 
     11558               lock. Other operations can be performed in this method 
     11559               implementation, but this step is absolutely critical.</para> 
    1153811560            </section> 
    1153911561 
     
    1165911681            creating the <classname>NSApplication</classname> singleton object 
    1166011682            by sending the <classname>NSApplication</classname> class the 
    11661             <methodname>+sharedApplication</methodname> message.</para> 
     11683            <methodname>+sharedApplication</methodname> message. The global 
     11684            lock must be released once we know that the application has 
     11685            finished launching. If a delegate is used with the 
     11686            <classname>NSApplication</classname> singleton, the lock should be 
     11687            released when the delegate receives the 
     11688            <methodname>-applicationDidFinishLaunching:</methodname> 
     11689            message.</para> 
    1166211690 
    1166311691            <para>Beyond that, the programmer is free to do as s/he wishes in