OptionGadget

Just starting out? Need help? Post your questions and find answers here.
loulou2522
Enthusiast
Enthusiast
Posts: 503
Joined: Tue Oct 14, 2014 12:09 pm

OptionGadget

Post by loulou2522 »

For others gadget like stringGadget you can have acess to event with #PB_EventType_Change
Is there something similar with OptionGadget ?
Thanks
User avatar
TI-994A
Addict
Addict
Posts: 2512
Joined: Sat Feb 19, 2011 3:47 am
Location: Singapore
Contact:

Re: OptionGadget

Post by TI-994A »

loulou2522 wrote:For others gadget like stringGadget you can have acess to event with #PB_EventType_Change
Is there something similar with OptionGadget ?
Not really. But this provides a similar solution:

Code: Select all

wFlags = #PB_Window_SystemMenu | #PB_Window_ScreenCentered
If OpenWindow(0, 0, 0, 200, 110, "OptionGadget", wFlags)
  OptionGadget(0, 60, 20, 100, 20, "Option 1")
  OptionGadget(1, 60, 45, 100, 20, "Option 2")
  OptionGadget(2, 60, 70, 100, 20, "Option 3")
  SetGadgetState(0, 1)
  Repeat 
    event = WaitWindowEvent()
    Select event
      Case #PB_Event_CloseWindow
        appQuit = 1
      Case #PB_Event_Gadget
        Select EventGadget()
          Case 0 To 2
            Debug "Selected Option: #" + Str(EventGadget() + 1)
        EndSelect          
    EndSelect      
  Until appQuit    
EndIf
Texas Instruments TI-99/4A Home Computer: the first home computer with a 16bit processor, crammed into an 8bit architecture. Great hardware - Poor design - Wonderful BASIC engine. And it could talk too! Please visit my YouTube Channel :D
Post Reply