[futurebasic] Re: [FB] Check/Unchecking Menu Item

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : May 1999 : Group Archive : Group : All Groups

From: tedd <tedd@...>
Date: Sun, 16 May 1999 13:36:44 -0400
>I'm stumped over how to toggle a menu between _enable and _checked and
>back.

Ken:

Two things I do: 1) Create a global gSoundFlag; 2) Then turn it on/off
(_true/_false) via the menu. From there, through-out your program you can
use it like so:

   LONG IF gSoundFlag = _true
      'do sound
   END IF

As far as the menu goes, to set the menu use:

   MENU 1,2, gSoundFlag + 1,"Sound On"

or
   LONG IF gSoundFlag = _true
      MENU 1,2, _checked,"Sound On"
   XELSE
      MENU 1,2, _enable,"Sound OFF"
   END IF

And, toggle the gSoundFlag by using:

   LONG IF gSoundFlag = _true
     gSoundFlag = false
   XELSE
     gSoundFlag = _true
   END IF

tedd

___________________________________________________________________
<mailto:tedd@...>	               http://sperling.com/