mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-04-23 20:01:11 +00:00
Patched so that gmodels can be created from macosx nibs; changed image
code to be more friendly with menus in gmodels from macosx nibs git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@6150 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
381e499e2c
commit
3a98dd3d8a
1 changed files with 26 additions and 4 deletions
|
@ -47,7 +47,9 @@ void __dummy_GMAppKit_functionForLinking() {}
|
|||
for (i = 0; i < count; i++) {
|
||||
NSWindow* window = [windows1 objectAtIndex:i];
|
||||
|
||||
if (![window isKindOfClass:[NSMenu class]])
|
||||
if (([window isKindOfClass:[NSMenu class]] == NO)
|
||||
&& ([NSStringFromClass ([window class])
|
||||
isEqualToString: @"NSMenuPanel"] == NO))
|
||||
[windows2 addObject:window];
|
||||
}
|
||||
[archiver encodeObject:windows2 withName:@"windows"];
|
||||
|
@ -702,10 +704,30 @@ void __dummy_GMAppKit_functionForLinking() {}
|
|||
|
||||
+ (id)createObjectForModelUnarchiver:(GMUnarchiver*)unarchiver
|
||||
{
|
||||
id image = [NSImage imageNamed:[unarchiver decodeStringWithName:@"name"]];
|
||||
id image = nil;
|
||||
NSString *imageName;
|
||||
|
||||
imageName = [unarchiver decodeStringWithName:@"name"];
|
||||
|
||||
/* If the image is a standard system image with the MacOSX name,
|
||||
convert the name to the GNUstep name */
|
||||
#ifdef GNU_GUI_LIBRARY
|
||||
if ([imageName isEqualToString: @"NSMenuCheckmark"])
|
||||
imageName = @"common_2DCheckMark";
|
||||
else if ([imageName isEqualToString: @"NSMenuArrow"])
|
||||
imageName = @"common_3DArrowRight";
|
||||
/* else if ([imageName isEqualToString: @"NSMenuMixedState"])
|
||||
imageName = @"common_??";*/
|
||||
else if ([imageName isEqualToString: @"NSAppleMenuImage"])
|
||||
imageName = @"GNUstepMenuImage";
|
||||
#endif
|
||||
|
||||
if (imageName)
|
||||
image = [NSImage imageNamed: imageName];
|
||||
|
||||
if (image == nil)
|
||||
image = [NSImage imageNamed:@"GNUstepMenuImage"];
|
||||
|
||||
if (!image)
|
||||
image = [NSImage imageNamed:@"NSRadioButton"];
|
||||
return image;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue