• 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: dock menu
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: dock menu


  • Subject: Re: dock menu
  • From: Stéphane Sudre <email@hidden>
  • Date: Sun, 3 Aug 2003 22:55:36 +0200

On dimanche, ao{t 3, 2003, at 10:34 PM, j o a r wrote:

On Sunday, Aug 3, 2003, at 21:45 Europe/Stockholm, Tomas Zahradnicky wrote:

How on earth do you add Items to the dock menu programatically??

SetApplicationDockTileMenu function from HIToolbox is your friend. Look at <file:///System/Library/Frameworks/Carbon.framework/Versions/A/ Frameworks/HIToolbox.framework/Versions/A/Headers/MacApplication.h>.

Huh? Why not simply read the documentation for NSApplication (and NSMenu and NSMenuItem if you're not familiar with them) and the method "applicationDockMenu:"? This is Cocoa Dev after all...

Implement that method in your application delegate, and when called, create and return the menu on the fly. If you need to modify it later you can retain a reference to it and modify it at will.

Let's just add that if you need to know who the sender is on Mac OS X 10.1, you have to add some workaround code and that if you want to change the state of a NSMenuItem in this Dock Menu you have to add some code again for both Mac OS X 10.1 and 10.2.
_______________________________________________
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.
References: 
 >Re: dock menu (From: j o a r <email@hidden>)

  • Prev by Date: Re: Screen Resolution
  • Next by Date: Keyed Archiver
  • Previous by thread: Re: dock menu
  • Next by thread: Re: NSTableView
  • Index(es):
    • Date
    • Thread