1 Reply Latest reply on Jul 20, 2007 1:45 PM by Newsgroup_User

    Deactivate item of a submenu in OSControls xtra

    wgb14 Level 1
      Hi all,

      I am trying to deactivate the first item of a submenu create with OSXtra using this line

      sprite(20).setItem([#submenu:0 ], [1], [#enabled: 0]). However , it does'nt work any ideas why?

      Thanks
        • 1. Re: Deactivate item of a submenu in OSControls xtra
          Level 7
          > sprite(20).setItem([#submenu:0 ], [1], [#enabled: 0]). However , it does'nt
          > work any ideas why?

          The first parameter you send to setItem() needs to be a linear list that
          specifies the "path" to the item you want to disable.
          If the first item in your menu has a submenu with 3 items in it, and you
          want to disable the second item of this submenu, you'd use:
          sprite(20).setItem([1, 2], [#enabled: 0])
          If the "main" menu has 6 items and the third has a submenu with 2 items
          and you want to disable the first in this submenu, you'd use:
          sprite(20).setItem([5, 1], [#enabled: 0])