• 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 menus: sender is NSApp
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Dock menus: sender is NSApp


  • Subject: Re: Dock menus: sender is NSApp
  • From: Steven Frank <email@hidden>
  • Date: Fri, 26 Oct 2001 16:43:42 -0700

Subject: Dock menus: sender is NSApp
From: "Erik J. Barzeski" <email@hidden>

Of course, big freaking problem: there's absolutely no way to figure out
which menu item was selected, huh? Ooops. I'd call that a bug... Or at the
very least a really big oversight...

Any way, if you've got a work-around, I'd love to hear it, because the ones
I've heard so far are pretty, uhh, "interesting."

Erik,

I ran into exactly the same problem.

In my situation, I had a dynamic dock tile menu that consisted of a varying number of URLs.

What I ended up doing was creating an NSObject subclass called "LinkItem" that stores the URL, and implements a -launchURL: method.

For each of the dynamic menu items in the dock tile menu then, I set the target to be the corresponding LinkItem, and to use the -launchURL: selector.

This is about as clean of a solution as I could think of. The big annoyance is it still requires you to keep track of all the LinkItems, so you can release them at some later point when the menu changes.

I'd love to hear if there is a better solution,

Steven


  • Prev by Date: Re: Out-of-date Dev Docs?
  • Next by Date: You're Invited to Mac OS X ICON DESIGN Workshops
  • Previous by thread: Dock menus: sender is NSApp
  • Next by thread: Re: Dock menus: sender is NSApp
  • Index(es):
    • Date
    • Thread