Enable or Disable menuitem

  • I want to enable or disable one menuitem of one menu of my
    application menubar according to the value of a Boolean variable.
    How to reach a menuitem of a menu of the application menubar ?
    When I reached it, how to enable or disable it ?
    Tanks

    Eric PETIT
  • Look at the -validateMenuItem: method of NSObject. You'll want to
    implement it for some object in the responder chain of your app,
    normally a window controller or perhaps the app delegate.

    Mike.

    On 27 Dec 2007, at 20:47, Eric PETIT wrote:

    > I want to enable or disable one menuitem of one menu of my
    > application menubar according to the value of a Boolean variable.
    > How to reach a menuitem of a menu of the application menubar ?
    > When I reached it, how to enable or disable it ?
    > Tanks
    >
    > Eric PETIT
  • Take a look at the documentation for NSMenu and NSMenuItem. You can
    get your application's menu bar by calling [NSApp mainMenu]

    Omar Qazi
    Synergick Software
    1.310.294.1593

    On Dec 27, 2007, at 12:47 PM, Eric PETIT wrote:

    > I want to enable or disable one menuitem of one menu of my
    > application menubar according to the value of a Boolean variable.
    > How to reach a menuitem of a menu of the application menubar ?
    > When I reached it, how to enable or disable it ?
    > Tanks
    >
    > Eric PETIT
  • On Dec 27, 2007, at 12:47 PM, Eric PETIT wrote:

    > I want to enable or disable one menuitem of one menu of my
    > application menubar according to the value of a Boolean variable.
    > How to reach a menuitem of a menu of the application menubar ?
    > When I reached it, how to enable or disable it ?
    >
    You typically don't "reach" it, you implement the relevant validation
    method in its target.
    <http://developer.apple.com/documentation/Cocoa/Conceptual/MenuList/Articles
    /EnablingMenuItems.html
    >

    mmalc
previous month december 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