String & Numeric
Posted: Mon Apr 12, 2004 7:36 am
Hi,
can some tell me, how to set the state of an trackbargadget with a stringgadget ?
can some tell me, how to set the state of an trackbargadget with a stringgadget ?
http://www.purebasic.com
https://www.purebasic.fr/english/
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