Show
Ignore:
Timestamp:
02/02/10 21:21:10 (4 years ago)
Author:
saturday06
Message:

a

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • lang/objective-cplusplus/i3/trunk/tmp/onmainthread.cpp

    r36594 r36595  
    100100    } 
    101101} 
     102// [NSException raise:@"Application_will_terminate" format:@"Someone requested to terminate application"]; 
    102103 
    103104- (void)start { 
     
    131132        } 
    132133 
     134        NSString* name = [[[NSThread currentThread] threadDictionary] 
     135                          objectForKey:@"my_name"]; 
     136        NSLog(@"thread created [%s]", [name UTF8String]); 
     137 
    133138        NSWindow* window = [NSWindow alloc]; 
    134139        [window initWithContentRect: NSMakeRect(100, 100, 200, 200) 
     
    140145        [window makeKeyAndOrderFront: nil]; 
    141146 
    142         [[NSRunLoop currentRunLoop] runUntilDate:[NSDate dateWithTimeIntervalSinceNow:10]]; 
    143          
    144         //[NSApp terminate:nil]; 
     147        //[[NSRunLoop currentRunLoop] runUntilDate:[NSDate dateWithTimeIntervalSinceNow:10]];         
     148        [NSApp run]; 
    145149    } 
    146150    NS_HANDLER 
     
    152156    } 
    153157    NS_ENDHANDLER 
    154  
    155     [NSException raise:@"Application_will_terminate" format:@"Someone requested to terminate application"]; 
    156158 
    157159    [pool release]; 
     
    272274         
    273275        mainTask = [[[MainTask alloc] init] retain]; 
    274         [mainTask performSelectorOnMainThread:@selector(start) withObject:nil waitUntilDone:NO]; 
     276        //[mainTask performSelectorOnMainThread:@selector(start) withObject:nil waitUntilDone:NO]; 
     277        [mainTask start]; 
    275278 
    276279        //[[NSRunLoop currentRunLoop] runUntilDate:[NSDate dateWithTimeIntervalSinceNow:10]]; 
    277         [[NSRunLoop currentRunLoop] run]; 
     280        //[[NSRunLoop currentRunLoop] run]; 
    278281        //[NSApp run]; 
    279282    }