On Thursday, October 3, 2002, at 01:22 PM, Dan Sugalski wrote:

> Anything that inherits from NSResponder can have a contextual menu 
> attached. You have to programmatically build up an NSMenu with attached 
> NSMenuItems and then attach it to the NSResponder child object. (Use 
> the setMenu method for that)

In true Perl style, there's more than one way to do it. :-)

You can also create the contextual menu in Interface Builder. Then, 
ctrl-drag a connection from the parent widget to the menu, and 
double-click "menu" in the "Outlets" pane of the Info panel.

> For the app menu from the doc, you need to have an applicationDockMenu 
> delegate method in your application delegate object.

This, too, can be done in IB. In "MainMenu.nib", create a new menu. 
Then, ctrl-drag a connection from the "File's Owner" icon to the menu, 
and double-click "dockMenu" in the Outlets pane.

sherm--

Reply via email to