mirror of
https://github.com/darlinghq/darling-cocotron.git
synced 2025-02-19 19:11:00 +00:00
More reliable mechanism for finding the main menu in a nib, fixed warning in NSNetServices
This commit is contained in:
parent
f7d3919bba
commit
520a52004e
@ -17,6 +17,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
|
||||
#import <AppKit/NSNibConnector.h>
|
||||
#import <AppKit/NSFontManager.h>
|
||||
#import <AppKit/NSNib.h>
|
||||
#import <AppKit/NSMenu.h>
|
||||
|
||||
@interface NSKeyedUnarchiver(private)
|
||||
-(void)replaceObject:object withObject:replacement;
|
||||
@ -26,6 +27,10 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
|
||||
-(NSDictionary *)externalNameTable;
|
||||
@end
|
||||
|
||||
@interface NSMenu(private)
|
||||
-(NSString *)_name;
|
||||
@end
|
||||
|
||||
@implementation NSIBObjectData
|
||||
|
||||
-initWithCoder:(NSCoder *)coder {
|
||||
@ -112,10 +117,11 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
|
||||
int i,count=[_namesValues count];
|
||||
|
||||
for(i=0;i<count;i++){
|
||||
NSString *check=[_namesValues objectAtIndex:i];
|
||||
id check=[_namesKeys objectAtIndex:i];
|
||||
|
||||
if([check isEqual:@"MainMenu"])
|
||||
return [_namesKeys objectAtIndex:i];
|
||||
if([check isKindOfClass:[NSMenu class]])
|
||||
if([[check _name] isEqual:@"_NSMainMenu"])
|
||||
return check;
|
||||
}
|
||||
return nil;
|
||||
}
|
||||
|
@ -22,6 +22,7 @@
|
||||
#import <Foundation/NSEnumerator.h>
|
||||
#import <Foundation/NSSelectInputSource.h>
|
||||
#import <Foundation/NSSocket.h>
|
||||
#import <Foundation/NSHost.h>
|
||||
|
||||
#ifdef WIN32
|
||||
#import <winsock2.h> // for ntohs
|
||||
|
Loading…
x
Reference in New Issue
Block a user