On Tue, 29 Feb 2000, Raphael Sebbe wrote:
> I successfully converted several nib files into gmodel files. But I
> cannot use them !
Are you using MacOSX ?
In that case, there is a known problem with NSMenuPanel etc.
I have devised a patch to the problem, but I do not have a MacOS-X so I
can't test if it works.
If you have a macosx, it would be wonderful if you could test the patch.
You should get the latest nib2gmodel from CVS. Then, apply the patch
in attach to the file GMAppKit.m. Then, compile and try if it works.
And report what happens. That would be great. :-)
The problem is that we would like to make a new release of nib2gmodel, but
since nobody tests if the MacOS-X patch works, we are stalled. nib2gmodel
should run fine on openstep (I mean, the produced gmodels should be
usable) but you quite probably need the latest CVS version.
> All this is for main model file. I saw your SavePanel used a model
> file, but in this case it is not the main one.
Well, actually in practice to avoid any problem with gmodels, for safety
the SavePanel.gmodel is not loaded and the save panel you see is running
directly from source code.
Don't feel compelled to volunteer to test the patch on macosx - but if you
can, it would help. If you try testing, feel free to ask any explanation
or help you may have/need.
--- GMAppKit.m Tue Feb 8 17:37:38 2000
+++ GMAppKit.m.macosx.patched Wed Feb 9 20:24:59 2000
@@ -47,7 +47,9 @@
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"];
@@ -765,7 +767,6 @@
[self setSubmenu:[unarchiver decodeObjectWithName:@"submenu"]];
[self setRepresentedObject:[unarchiver
decodeObjectWithName:@"representedObject"]];
-
#ifdef GNU_GUI_LIBRARY
/*
* Set submenu from target if not set
@@ -778,11 +779,11 @@
}
#endif
+
#if 0
NSLog (@"menu item %@: target = %@, isEnabled = %d",
[self title], [self target], [self isEnabled]);
#endif
-
return self;
}