Re: Menu About to show notification
Re: Menu About to show notification
- Subject: Re: Menu About to show notification
- From: Carlos Weber <email@hidden>
- Date: Wed, 30 Jan 2002 00:55:52 -1000
On Monday, January 28, 2002, at 05:36 , davidjclark wrote:
>
Hello,
>
>
Is there any way in cocoa to be informed when a menu is going to be
>
shown.
>
>
Something like:
>
- ( void ) willShowMenu:(NSMenu *)theMenu offMenuItem:(NSMenuItem
>
*)theMenuItem
>
>
I would like to have the opportunity to dynamically generate the menus
>
contents.
A PB project demonstrating one way to do this (dynamically generating
menu contents) is posted at my iDisk:
http://homepage.mac.com/carlosweber/
The file you want to download is called NuBundleUp.dmg; it contains a
Project Builder project with source code for an application and six
associated plugins, demonstrating how an app can use NSBundle's
facilities to implement plugins, and also how a menu can be created on
the fly. This app generates its menu of plugins by scanning both the
built-in plugin directory (within the application package) and a
user-chosen location which can be anywhere in the filesystem. You can
experiment with the dynamic menu updating by moving the user-defined
plugin directory around, and/or adding and removing plugins, while the
app is running.
David -- hope it helps.
All -- comments are welcome!