Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 99525
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T00:24:15+00:00 2026-05-11T00:24:15+00:00

I have a cocoa app with two types windows each of which requires a

  • 0

I have a cocoa app with two types windows each of which requires a different main menu to be displayed.

In my MainMenu.xib I have the default MainMenu. In Window1.xib I have Window1 and in Window2.xib I have Window2 and it’s MainMenu.

When I have the first Window open I have the default Menu, when I open Window2 I get it’s menu.

However, when I switch back to Window1 I still see Window2’s menu. How do I make the menu that is displayed follow the key window?

  • 1 1 Answer
  • 1 View
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-11T00:24:16+00:00Added an answer on May 11, 2026 at 12:24 am

    NSApplication has a method, - (void)setMainMenu:(NSMenu *)aMenu. You can pass it a reference to the correct menu in the appropriate window controller, by implementing - (void)windowDidBecomeKey:(NSNotification *)notification.

    Keep in mind it may be easier to change just the submenus instead of swapping out the entire main menu, since you won’t have to maintain two different copies of the application, help, and other menus that won’t change between the two windows.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a Cocoa app with a ManMenu.xib, in which the main menu is
I´m newbie. I have three xib files in my cocoa app: MainMenu.xib the main
I have two string properties setup in my cocoa application's app delegate which are
I'm working on a cocoa app for syncing data between two folders. It have
I've a cocoa app based on NSDocument, I've two types of document. Every document
Environment: xcode 3.2.1, document-based core-data application. I have a document-based cocoa app which uses
I have a Cocoa App that depends on the main window being a certain
I write an Agent Cocoa app where I have TextField in status icon's menu,
I have a Cocoa app I'm working on and I get a different result
I have two applications: 1) A multithreaded cocoa gui app. 2) A unix command

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.