• 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
New to Cocoa - Action Buttons
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

New to Cocoa - Action Buttons


  • Subject: New to Cocoa - Action Buttons
  • From: Alan Francis <email@hidden>
  • Date: Thu, 7 Oct 2004 20:25:54 +0100

Hi,

I posted this to the xcode list (it seemed the right place) and got nothing in the way of response (not even a hello) so I wondered if the cocoa list might be able to help...

----
Hi,

I'm a reasonably experienced (10+yrs) C/C++/Java programmer but I just got my first Mac and have started playing with Cocoa and XCode.

Something (random) I'm having a bit of trouble with is trying to implement the context-sensitive "action" button, a la finder/mail etc.

I kind of expected it to be available in IB palettes since it seems to be a pretty standard UI feature now, but it isn't there... On closer inspection it's obviously hand-rolled in all the apps I've seen that have it (some using ordinary toggle NSButtons, other using NSPopupButton), the only thing that's standard is the 'cog' graphic.

So...assuming I'm hand-rolling my own...

* I have a toggle button created and two graphics 'borrowed' from
another app for the button in it's normal and depressed states.
* I have a context menu created in IB
* I can hook the menu up to the button (using the menu outlet) so
it triggers when I right-click (ctrl-click).

However, I can't work out how to pop a menu up, in a specific place (ie underneath the button, left-aligned), when I left-click (click?) the button ?

Can anyone point me at some sample code ?

Thanks in advance,

Alan.

--
Alan C Francis
http://www.twelve71.com/
http://www.thoughtworks.com/

--
Alan C Francis
http://www.twelve71.com/
http://www.thoughtworks.com/

_______________________________________________
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
  • Prev by Date: what is the best (easiest) way to get the selection in an NSOutlineView?
  • Next by Date: Re: small notes on enabling of menus in a modal window
  • Previous by thread: Re: what is the best (easiest) way to get the selection in an NSOutlineView?
  • Next by thread: NSCalendarDate returns wrong dayOfWeek
  • Index(es):
    • Date
    • Thread