• 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
how to have a pop up menu from an ordinary button?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

how to have a pop up menu from an ordinary button?


  • Subject: how to have a pop up menu from an ordinary button?
  • From: Rua Haszard Morris <email@hidden>
  • Date: Fri, 8 Aug 2008 09:53:48 +1200

I am trying to implement a mini-size, square bevel button that pops up a menu, i.e. a popup button with a square appearance and mini size, but have not found a way to achieve this.

NSPopupButton does not support square button appearance, and doesn't support setControlSize: (though it can of course be an arbitrary size).

I have seen some suggestions for how to achieve this, for example making a NSPopupButton over the top of a square NSButton and setting the NSPopupButton transparent. This works but there are draw issues; sometimes a rounded white area appears around the NSButton (note that I have set the size & location of the popup button to match the button, so the clicks are handled appropriately). I also had a look at NSMenu popUpContextMenu:, but this did not seem appropriate, as it seems solely for right-click/context menus.

How can I do this? I want to avoid having to write the mouse tracking code if at all possible, so the popup behaves exactly like a system one. I'm not clear on how to do this either..

thanks
Rua HM.
_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: how to have a pop up menu from an ordinary button?
      • From: "Michael Ash" <email@hidden>
    • Re: how to have a pop up menu from an ordinary button?
      • From: Peter Ammon <email@hidden>
  • Prev by Date: Key Binding action methods not declared in public headers
  • Next by Date: Re: locale of embedded frameworks
  • Previous by thread: Re: Key Binding action methods not declared in public headers
  • Next by thread: Re: how to have a pop up menu from an ordinary button?
  • Index(es):
    • Date
    • Thread