• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: [NSapp mainMenu] returns nil - Solution :-)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [NSapp mainMenu] returns nil - Solution :-)


  • Subject: Re: [NSapp mainMenu] returns nil - Solution :-)
  • From: Christian Stieber <email@hidden>
  • Date: Tue, 04 Apr 2006 13:20:09 +0200

At 10:46 04.04.2006 +0200, Christian Stieber wrote:

Although, something I still want to try some time is to use
Interface-Builder to just make a dummy menu to kickstart things,
load that, and see it if helps.

Well, that seemed to be the key. I made a Dummy nib with Interface builder, deleting everything (except the main menu, of course) that it would let me, and just doing

                  [NSApplication sharedApplication];
                  [NSBundle loadNibNamed:@"Dummy" owner:NSApp];
                  FixMenus([NSApp mainMenu]);
                  if (WTG_Framework_Preferences_Init())
                    ...

to initialize the Cocoa-GUI. No NSApplicationLoad() --- if I
call that, I get a double-system menu containing the one from
IB and the system-provided one, but the system-provided one
doesn't work, and the dock-Quit won't work either. If I don't
call NSApplicationLoad() then everything is fine. Don't need
NSApplicationMain() either.

[NSApp mainMenu] now returns a non-nil menu as well, and I can
edit it using the normal NSMenu/NSMenuItem classes to localize
it, and probably (should the need arise) add new entries. So,
all looks fine now :-)

I even seem to get the Edit menu now, and I hope the shortcuts
work as well. At least that explains why I never found out how
to turn on the system-provided Edit menu --- there is none :-)

Christian

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: [NSapp mainMenu] returns nil - Solution :-)
      • From: j o a r <email@hidden>
References: 
 >Re: [NSapp mainMenu] returns nil (From: Christian Stieber <email@hidden>)
 >Re: [NSapp mainMenu] returns nil (From: Christian Stieber <email@hidden>)

  • Prev by Date: Re: Path names in executable
  • Next by Date: Re: Path names in executable
  • Previous by thread: Re: [NSapp mainMenu] returns nil
  • Next by thread: Re: [NSapp mainMenu] returns nil - Solution :-)
  • Index(es):
    • Date
    • Thread