• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Getting the Window menu item for a window
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

References: 
 >Getting the Window menu item for a window (From: Mark Alldritt <email@hidden>)

  • Prev by Date: Re: crossplatform C++, #ifdef
  • Next by Date: Re: Customizing an NSSearchField
  • Previous by thread: Getting the Window menu item for a window
  • Next by thread: Software To Interpret a pattern within an Image
  • Index(es):
    • Date
    • Thread