Page 1 of 1

String & Numeric

Posted: Mon Apr 12, 2004 7:36 am
by Switchblade
Hi,

can some tell me, how to set the state of an trackbargadget with a stringgadget ?

Posted: Mon Apr 12, 2004 8:15 am
by DarkDragon

Code: Select all

#WindowWidth = 200
#WindowFlags =  #PB_Window_TitleBar | #PB_Window_SystemMenu | #PB_Window_MinimizeGadget | #PB_Window_ScreenCentered | #PB_Window_SizeGadget | #PB_Window_MaximizeGadget
#WindowHeight = 40

hWnd = OpenWindow(0, 0, 0, #WindowWidth, #WindowHeight, #WindowFlags, "Titel")

If CreateGadgetList(WindowID())
  StringGadget(0, 0, 0, 200, 20, "0")
  TrackBarGadget(1, 0, 20, 200, 20, 0, 100)
EndIf

Repeat
  Event = WindowEvent()
  Select Event
    Case #PB_Event_Gadget
      Select EventGadgetID()
        Case 0
          ;!!!!!!!Look here!!!!!!!
          SetGadgetState(1, Val(GetGadgetText(0)))
        Case 1
          ;!!!!!!!And here!!!!!!!
          SetGadgetText(0, Str(GetGadgetState(1)))
      EndSelect
  EndSelect
  Delay(10)
Until Event = #PB_Event_CloseWindow
End

Posted: Mon Apr 12, 2004 9:43 am
by Switchblade
ok thx mate, but ive found it out ;) juuhu