Follow us on...
Follow us on Twitter Follow us on Facebook
Register
Results 1 to 4 of 4
  1. #1
    mksoft_ is offline Registered User
    Join Date
    Nov 2006
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Access to main app menu

    I want to add lines and modify the 'main app menu', the one bold with the name of the app

    (see screenshot )

    Is it a way? i've spend hours without finding anything...

    I work with XCode 2.4, Objective-C and Cocoa, i don't use at all interface builder nor nib files

    Thanks a lot !
    Attached Images Attached Images

  2. #2
    szymczyk is offline Registered User
    Join Date
    Sep 2005
    Posts
    50
    Thanks
    0
    Thanked 1 Time in 1 Post
    I don't understand why you wouldn't use Interface Builder and nib files if you're writing Cocoa applications. Interface Builder is one of the reasons why writing Cocoa applications is easier than writing applications with other frameworks. You can easily add an item to the application menu in Interface Builder. Drag a menu item to the application menu.

    If you're still determined to add a menu item in code, look at the NSMenuItem and NSMenu documentation. The initWithTitle method in the NSMenuItem class creates a menu item, and the addItem method in the NSMenu class adds the newly created item to a menu.
    Mark Szymczyk
    Author, Xcode Tools Sensei
    http://www.meandmark.com

  3. #3
    mksoft_ is offline Registered User
    Join Date
    Nov 2006
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts
    i create a software which run on both mac and windows, that's the reason

    i know how to add a menu and items into menus, i want to add items into the application menu (the one in bold font with the name of the software, as you can see on the screenshot)
    i can't find any information about how to access this menu...

  4. #4
    mksoft_ is offline Registered User
    Join Date
    Nov 2006
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Resolved: it seems on tiger the [NSApp setAppleMenu:] method disappeared, but it's possible to 'put it back' with :

    @interface NSApplication(AppleMenu)
    -(void)setAppleMenuNSMenu*)menu;
    @end

    Don't know why we have to do this, there is no documentation about it anywhere on apple website...
    Anybody know the reason of this?

 

 

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •