Re: Getting the Window menu item for a window
Re: Getting the Window menu item for a window
- Subject: Re: Getting the Window menu item for a window
- From: Bill Cheeseman <email@hidden>
- Date: Sun, 14 Nov 2004 08:24:31 -0500
on 2004-11-13 12:37 PM, Mark Alldritt at email@hidden wrote:
> Can anyone show me how to get the NSMenuItem instance for the Window menu
> item corresponding to a particular window? I want to add a state indicating
> icon to the menu item for some of my windows.
>
> NSApplication's windowsMenu gives me the windows menu, but the items in this
> menu don't appear to be tagged in any useful way and the representedObject
> is nil.
If I recall correctly, you can set the representedObject when you create the
window, in your window controller's -awakeFromNib method. See
-[NSApplication windowsMenu], -[NSApplication
addWindowsItem:title:filename:], -[NSApplication
changeWindowsItem:title:filename] and -[NSMenuItem setRepresentedObject:].
--
Bill Cheeseman - email@hidden
PLEASE NOTE NEW E-MAIL ADDRESS!
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden