Best practice on menues?

Mac OSX specific forum
User avatar
tarmsaft
User
User
Posts: 37
Joined: Sat Jun 30, 2007 12:03 pm
Location: San Francisco

Best practice on menues?

Post by tarmsaft »

Since it is not possible to run multiple instances of programs on the mac (as far as I know) I have to open several windows instead.
I would like to have the same menu on all open windows, and I want a standard "Window" menu with a list of all open windows. Only the active window should have keyboard shortcuts enabled. That is, it should resemble all other mac applications.

How do you propose I do it with as little fuss as possible?
  • Should for instance each window have it's own menu?
  • How do you update the menu in a efficient manner? Rebuilding every menu when the windowtitle changes on a menu, another window gets active (needed to indicate which window is active), or when you add/remove windows
  • The keyboard shortcuts. Deactivate all and create new listeners every time a window becomes active?
MacBook Pro (model 7,1) - 2.4GHz Intel Core 2 Duo 4GB - OS X 10.7 Lion.
PB 4.60 RC1
WilliamL
Addict
Addict
Posts: 1252
Joined: Mon Aug 04, 2008 10:56 pm
Location: Seattle, USA

Re: Best practice on menues?

Post by WilliamL »

You can only have one set of menus on the Mac and it is associated with one open window but all windows seem to be able to access this menu set. MenuShortcuts don't seem to be active when you're not in the window that created them so just make the menu shortcuts and see how it goes. Just be sure not to close the window that created the menus.. or recreate them in another open window before closing the original window. Otherwise, there isn't any updating of menus necessary, if I understand your question.
MacBook Pro-M1 (2021), Sequoia 15.4, PB 6.20
User avatar
tarmsaft
User
User
Posts: 37
Joined: Sat Jun 30, 2007 12:03 pm
Location: San Francisco

Re: Best practice on menues?

Post by tarmsaft »

WilliamL wrote:You can only have one set of menus on the Mac and it is associated with one open window but all windows seem to be able to access this menu set. MenuShortcuts don't seem to be active when you're not in the window that created them so just make the menu shortcuts and see how it goes. Just be sure not to close the window that created the menus.. or recreate them in another open window before closing the original window. Otherwise, there isn't any updating of menus necessary, if I understand your question.
I'll give it a try. I'm not sure about the short cuts though. They don't seem to be "transferred" to the active window. But i'll give it another go.

However it does not count for a window drop down menu that is updated whenever windows open, close or becomes active.

Example
1. Open two windows of TextEdit
2. The second from the right drop down menu is entitled "Window" (That is the Apple sign to the left, following with "File", "Edit", "Format", "Window" and finally "Help")
3. Click "Window", you should now see both of you windows open. One having a checkbox indicating the active one.

How does one do that without constantly updating the windowmenu?
MacBook Pro (model 7,1) - 2.4GHz Intel Core 2 Duo 4GB - OS X 10.7 Lion.
PB 4.60 RC1
WilliamL
Addict
Addict
Posts: 1252
Joined: Mon Aug 04, 2008 10:56 pm
Location: Seattle, USA

Re: Best practice on menues?

Post by WilliamL »

I don't know how others do it but I use a "MenuUpdate" procedure any time a window is closed or file is modified etc. I am calling that routine all the time through out my program.
MacBook Pro-M1 (2021), Sequoia 15.4, PB 6.20
Post Reply