Hi,

for QuartzCore I'll be implementing small command-line tools that in fact
open an AppKit window with NSOpenGLView as the content view.

This sort of thing is not officially supported in Cocoa (a bundle is
required, or hacks with CPSEnableForegroundOperation() are required).
However, it works just fine with GNUstep.

Except for one small error that I just noticed and don't remember seeing
before.

"Bad application class '(null)' specified"

Looks like in gui's Source/Functions.m, NSApplicationMain() is explicitly
demanding that the bundle and its info dictionary exist, and that
NSPrincipalClass is specified, instead of either defaulting to
NSApplication, or simply checking whether the class is already initialized.

Since NSApp is a global variable, this should work fine:

Index: Source/Functions.m
===================================================================
--- Source/Functions.m    (revision 35156)
+++ Source/Functions.m    (working copy)
@@ -70,7 +70,7 @@
   className = [infoDict objectForKey: @"NSPrincipalClass"];
   appClass = NSClassFromString(className);

-  if (appClass == 0)
+  if (appClass == 0 && NSApp == nil)
     {
       NSLog(@"Bad application class '%@' specified", className);
       appClass = [NSApplication class];

Thoughts?
-- 
Ivan Vučica - [email protected]
_______________________________________________
Discuss-gnustep mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/discuss-gnustep

Reply via email to