Announcement

Collapse
No announcement yet.

menu state

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • menu state

    Hi fellow programmers,

    In this forum I've found that MENU SET STATE does not work. Is there a patch or a workaround?
    I must create a menu with items of which the state depends of a situation. An item should be either grayed or enabled.
    Even this code does not return the expected result:
    Code:
    IF condition& = %TRUE THEN
      MENU ADD STRING, hPopup, "&True",  %ID_TRUE,  %MF_GRAYED
    ELSE
      MENU ADD STRING, hPopup, "&False", %ID_FALSE, %MF_ENABLED
    END IF
    BTW: I don't get the API call ModifyMenu working either, simply because I don't understand the explanation. Does someone have sample code?

    ------------------
    mailto:[email protected][email protected]</A>
    www.basicguru.com/zijlema/

    Egbert Zijlema, journalist and programmer (zijlema at basicguru dot eu)
    http://zijlema.basicguru.eu
    *** Opinions expressed here are not necessarily untrue ***

  • #2
    Unfortunately, MENU SET STATE is... uh... not working at the moment.

    Until this is fixed in the next update, please use the EnableMenuItem() API.

    JFYI: I don't know what you want to use it for, but ModifyMenu() has been replaced by SetMenuItemInfo() API.

    ------------------
    Lance
    PowerBASIC Support
    mailto:[email protected][email protected]</A>
    Lance
    mailto:[email protected]

    Comment


    • #3
      Thanks, Lance.
      It works.


      ------------------
      mailto:[email protected][email protected]</A>
      www.basicguru.com/zijlema/

      Egbert Zijlema, journalist and programmer (zijlema at basicguru dot eu)
      http://zijlema.basicguru.eu
      *** Opinions expressed here are not necessarily untrue ***

      Comment

      Working...
      X