src/macosx/native/sun/awt/CMenuBar.m

Print this page

        

*** 195,205 **** [fMenuList addObject: theMenu]; } if (self == sActiveMenuBar) { NSArray *args = [[NSArray alloc] initWithObjects:theMenu, [NSNumber numberWithInt:-1], nil]; ! [ThreadUtilities performOnMainThread:@selector(nativeAddMenuAtIndex_OnAppKitThread:) onObject:self withObject:args waitUntilDone:YES awtMode:YES]; [args release]; } } // This method is a special case for use by the screen menu bar. --- 195,205 ---- [fMenuList addObject: theMenu]; } if (self == sActiveMenuBar) { NSArray *args = [[NSArray alloc] initWithObjects:theMenu, [NSNumber numberWithInt:-1], nil]; ! [ThreadUtilities performOnMainThread:@selector(nativeAddMenuAtIndex_OnAppKitThread:) on:self withObject:args waitUntilDone:YES]; [args release]; } } // This method is a special case for use by the screen menu bar.
*** 214,224 **** } } if (self == sActiveMenuBar) { NSArray *args = [[NSArray alloc] initWithObjects:theMenu, [NSNumber numberWithInt:index], nil]; ! [ThreadUtilities performOnMainThread:@selector(nativeAddMenuAtIndex_OnAppKitThread:) onObject:self withObject:args waitUntilDone:YES awtMode:YES]; [args release]; } } - (NSInteger) javaIndexToNSMenuIndex_OnAppKitThread:(jint)javaIndex { --- 214,224 ---- } } if (self == sActiveMenuBar) { NSArray *args = [[NSArray alloc] initWithObjects:theMenu, [NSNumber numberWithInt:index], nil]; ! [ThreadUtilities performOnMainThread:@selector(nativeAddMenuAtIndex_OnAppKitThread:) on:self withObject:args waitUntilDone:YES]; [args release]; } } - (NSInteger) javaIndexToNSMenuIndex_OnAppKitThread:(jint)javaIndex {
*** 284,294 **** } } - (void) javaDeleteMenu: (jint)index { if (self == sActiveMenuBar) { ! [ThreadUtilities performOnMainThread:@selector(nativeDeleteMenu_OnAppKitThread:) onObject:self withObject:[NSNumber numberWithInt:index] waitUntilDone:YES awtMode:YES]; } @synchronized(self) { CMenu *menuToRemove = [fMenuList objectAtIndex:index]; --- 284,294 ---- } } - (void) javaDeleteMenu: (jint)index { if (self == sActiveMenuBar) { ! [ThreadUtilities performOnMainThread:@selector(nativeDeleteMenu_OnAppKitThread:) on:self withObject:[NSNumber numberWithInt:index] waitUntilDone:YES]; } @synchronized(self) { CMenu *menuToRemove = [fMenuList objectAtIndex:index];
*** 386,396 **** jobject cPeerObjGlobal = (*env)->NewGlobalRef(env, peer); // We use an array here only to be able to get a return value NSMutableArray *args = [[NSMutableArray alloc] initWithObjects:[NSValue valueWithBytes:&cPeerObjGlobal objCType:@encode(jobject)], nil]; ! [ThreadUtilities performOnMainThread:@selector(_create_OnAppKitThread:) onObject:[CMenuBar alloc] withObject:args waitUntilDone:YES awtMode:YES]; aCMenuBar = (CMenuBar *)[args objectAtIndex: 0]; if (aCMenuBar == nil) { return 0L; --- 386,396 ---- jobject cPeerObjGlobal = (*env)->NewGlobalRef(env, peer); // We use an array here only to be able to get a return value NSMutableArray *args = [[NSMutableArray alloc] initWithObjects:[NSValue valueWithBytes:&cPeerObjGlobal objCType:@encode(jobject)], nil]; ! [ThreadUtilities performOnMainThread:@selector(_create_OnAppKitThread:) on:[CMenuBar alloc] withObject:args waitUntilDone:YES]; aCMenuBar = (CMenuBar *)[args objectAtIndex: 0]; if (aCMenuBar == nil) { return 0L;