Document specific menus in a multi document application
Document specific menus in a multi document application
- Subject: Document specific menus in a multi document application
- From: Phillip Hutchings <email@hidden>
- Date: Sun, 13 Oct 2002 22:23:18 +1300
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
OK, I am trying to create menus in my application that tie into actions
on a specific document, such as hide/show toolbar, new entry and such
items. Is it possible to connect them in IB? Or do I have to create
them in PB?
Currently I create a NSMenu in IB in the nib for the document, and then
attach it to the main menu through [[NSApplication sharedApplication]
mainMenu], but this doesn't switch the menus depending on which
document is in front, it just adds a new one with each document, eg 2
documents, 2 view menus.
I guess I'm doing something wrong, so how should I do it? Can I create
the menus in MainMenu.nib then change the selectors (if I can be
notified when frontmost docs switch)? Or should I use a dummy class
that finds the current frontmost document and sends on the action?
Lastly, what method does the active/deactive menu items so I can
enable/disable menu items depending on which type of window is in the
front?
I guess I'm suffering from newbieitus.
- -------------------------------
Phillip Hutchings
http://www.sitharus.com/
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.7 (Darwin)
iEYEARECAAYFAj2pO4oACgkQ1PJqI21cmKBHJACfbu2K99UY3asge1RZUwY7Ooc0
K9UAnjqU/qNHWLNHsPFyjWWQ1avDH9SF
=9X1T
-----END PGP SIGNATURE-----
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.