Prevent NSPopupButton from showing its menu

  • I've got a subclass of NSPopupButton that I need to only show its
    menu when a modifier key is held down. I can see a few ways to detect
    the click (override mouseup(), use
    NSPopUpButtonWillPopUpNotification, etc.), but I'm not sure how to
    prevent the menu from showing when the modifier key isn't down. I
    suppose I could have the menu be empty and add the appropriate items
    only if the key is down, but I'm not at all sure that's the smart
    approach.

    Any advice on both issues (best way to detect click, best way to
    prevent menu) would be great.

    Thanks!

    -eric
previous month october 2006 next month
MTWTFSS
            1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31          
Go to today