Hide a menu (NSMenu)

  • Hello:

    In my main application's menu (MyApp > About MyApp, Preferences,
    etc...) I have a Registration menu item.  Is there a simple way to
    hide the Registration menu item once the program has been
    successfully registered?  I've looked through NSMenuItem and
    NSControl reference documents, but I'm not finding a simple way to do
    so.  Or perhaps this is something that is not normally intended?  Or
    would I be better off just inserting the menu item when the NIB is
    loading?

    Regards,

    Chad
  • It's not intended. Menu items that are not relevant in a particular
    situation should be disabled through -validateMenuItem:. If you must,
    you can remove the menu item.

    Christiaan

    On 28 Oct 2007, at 10:03 PM, Chad Armstrong wrote:

    > Hello:
    >
    > In my main application's menu (MyApp > About MyApp, Preferences,
    > etc...) I have a Registration menu item.  Is there a simple way to
    > hide the Registration menu item once the program has been
    > successfully registered?  I've looked through NSMenuItem and
    > NSControl reference documents, but I'm not finding a simple way to
    > do so.  Or perhaps this is something that is not normally
    > intended?  Or would I be better off just inserting the menu item
    > when the NIB is loading?
    >
    > Regards,
    >
    > Chad
  • On 28 Oct 2007, at 14:03, Chad Armstrong wrote:

    > In my main application's menu (MyApp > About MyApp, Preferences,
    > etc...) I have a Registration menu item.  Is there a simple way to
    > hide the Registration menu item once the program has been
    > successfully registered?

    Can't you use -[NSMenu removeItem:]?

    David Dunham    A Sharp, LLC
    Voice/Fax: 206 783 7404    http://a-sharp.com
    "People seem to misinterpret complexity as sophistication" -- Niklaus
    Wirth
previous month october 2007 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