Hi, The windows theme is probably turned on, which gets rid of floating NeXT-style menus and displays them inside windows. You could either create an NSWindow in applicationWillFinishLaunching and call orderFront: on it, or setting the theme to the default NeXT style which will allow floating menus to show up (open the mingw shell and type: defaults write NSGlobalDomain GSTheme "")
Eric On 2011-12-01, at 1:40 PM, Clint Anderson wrote: > Hey guys, another noob question/problem here. > > I'm working through the tutorial at > http://www.gnustep.it/nicola/Tutorials/FirstGUIApplication/index.html > trying to get a simple GUI application example working. When I get > ready to test it, everything seems to compile correctly, with no > errors. But when I run the app, the window never appears. If I check > my task manager I can see it running in the background. I have tried > using both the openapp command as well as just double clicking the > .exe file from Windows Explorer with the same results. Here is the > code that I am using (from the linked example). What am I doing > wrong? > > > #include <Foundation/Foundation.h> > #include <AppKit/AppKit.h> > > @interface MyDelegate : NSObject > - (void) printHello: (id)sender; > - (void) applicationWillFinishLaunching: (NSNotification *)not; > @end > > @implementation MyDelegate : NSObject > - (void) printHello: (id)sender > { > printf ("Hello!\n"); > } > > - (void) applicationWillFinishLaunching: (NSNotification *)not > { > NSMenu *menu; > > menu = AUTORELEASE ([NSMenu new]); > > [menu addItemWithTitle: @"Print Hello" > action: @selector (printHello:) > keyEquivalent: @""]; > > [menu addItemWithTitle: @"Quit" > action: @selector (terminate:) > keyEquivalent: @"q"]; > > [NSApp setMainMenu: menu]; > } > @end > > int main (int argc, const char **argv) > { > [NSApplication sharedApplication]; > [NSApp setDelegate: [MyDelegate new]]; > > return NSApplicationMain (argc, argv); > } > > > > And the makefile > > include $(GNUSTEP_MAKEFILES)/common.make > > APP_NAME = MyFirstApp > MyFirstApp_OBJC_FILES = MyApp.m > > # Uncomment the following if you have an icon > #MyFirstApp_APPLICATION_ICON = MyApp.png > #MyFirstApp_RESOURCE_FILES = MyApp.png > > include $(GNUSTEP_MAKEFILES)/application.make > > _______________________________________________ > Discuss-gnustep mailing list > [email protected] > https://lists.gnu.org/mailman/listinfo/discuss-gnustep _______________________________________________ Discuss-gnustep mailing list [email protected] https://lists.gnu.org/mailman/listinfo/discuss-gnustep
