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

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


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

On Aug 7, 2008, at 2:53 PM, Rua Haszard Morris wrote:
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).

In Leopard, NSPopUpButton supports any bezel style that NSButton supports (excluding uninteresting cases like Disclosure or Help). NSPopUpButton also supports setControlSize:. Are these not working for you?
Right you are! I think I was forgetting to call setControlSize: on the cell rather than on the popup itself. I have not tested on 10.4 yet (am building against 10.4 SDK).

The other thing I needed to do to make it look appropriate was set the font to a smaller size:
[popup setFont:[NSFont systemFontOfSize:[NSFont smallSystemFontSize] - 1]];


It seems I still have a drawing issue, when the window first appears, there's a whiteish rectangle drawn above the button. I think this is due to the parent view not being notified about the menu invalidating the area - the rectangle is similar to the width of the menu and protrudes vertically by the same amount.

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


References: 
 >how to have a pop up menu from an ordinary button? (From: Rua Haszard Morris <email@hidden>)
 >Re: how to have a pop up menu from an ordinary button? (From: Peter Ammon <email@hidden>)

  • Prev by Date: Problem with friend function and gcc 4.2 with objective-c++
  • Next by Date: Re: How to debug a corrupted stack
  • Previous by thread: Re: how to have a pop up menu from an ordinary button?
  • Next by thread: Re: how to have a pop up menu from an ordinary button?
  • Index(es):
    • Date
    • Thread