Skip navigation.
 
mlRe: Pull-down menu weirdness
FROM : Keith Blount
DATE : Mon Jul 17 21:18:29 2006

Hi, nope, not being dense - I was surprised I had to
jump through these hoops just to achieve something so
simple myself. The main (but but not sole) reason
subclassing is required, however, is that
NSPopUpButton does not support the graying on/off
state of an NSButton. When you click the "action"
button in Mail.app, the button turns grey when the
menu appears. There is no way to support this in a
standard NSPopUpButton that I can see (you can see
that the buttons used in the MenuMadness example
appear quite dead and do not gray).

There is an old post about similar issues here:
http://www.cocoabuilder.com/archive/message/2005/2/1/127252

Notably, looking in the .nib file of Mail.app, the
action button appears to be a plain, non-subclassed
NSPopUpButton; however, I have no idea how they
achieved the behaviour they did without subclassing.

Hope that makes things a little clearer...

--- Matt Neuburg <<email_removed>> wrote:

> On or about 7/17/06 10:46 AM, thus spake "Keith
> Blount"
> <<email_removed>>:
>
> > My problem was merely that I
> > required a pull-down list (because an action
> button
> > should be used for a menu of actions, whereas a
> pop-up
> > list is for selecting an item), but, because I am
> > using an image instead of a title, I didn't want
> the
> > pull-down list to eat up the first item in its
> given
> > menu for its title (which wouldn't get shown, and
> > which is the default behaviour for a pull-down
> list as
> > opposed to a pop-up list). Hope that explains my
> > initial question more clearly...
>
> Sorry if I'm being dense, but I'm just not
> understanding why this requires
> jumping through all these hoops. In the MenuMadness
> example, there are
> various kinds of menu emerging from images, and no
> subclassing is needed.
> Once the menu is set up, that's that. (And yes, of
> course a dummy item is
> used as the first item.) Perhaps if you compared
> what you're trying to do to
> what MenuMadness already shows how to do...? m.
>
> --
> matt neuburg, phd = <email_removed>,
> http://www.tidbits.com/matt/
> pantes anthropoi tou eidenai oregontai phusei
> AppleScript: the Definitive Guide - Second Edition!
> http://www.amazon.com/gp/product/0596102119
> Take Control of Word 2004, Tiger, and more -
>

http://www.takecontrolbooks.com/tiger-customizing.html
> Subscribe to TidBITS! It's free and smart.
> http://www.tidbits.com/
>
>
>
>



__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around
http://mail.yahoo.com

Related mailsAuthorDate
mlPull-down menu weirdness Keith Blount Jul 15, 11:24
mlRe: Pull-down menu weirdness Matt Neuburg Jul 16, 18:22
mlRe: Pull-down menu weirdness Keith Blount Jul 17, 19:46
mlRe: Pull-down menu weirdness Matt Neuburg Jul 17, 20:24
mlRe: Pull-down menu weirdness Keith Blount Jul 17, 21:18
mlRe: Pull-down menu weirdness Matt Neuburg Jul 17, 21:32