the following code works as expected e.g. with PB 5.31 beta 1 x64 on Windows 7.
With that, I mean that I can change the gadget value by
- clicking at the up or down arrow with the mouse
- typing a number in the small edit field
- pressing the up or down arrow key
I encountered this on a virtual machine. However, in other programs that run on the same virtual machine (e.g. the PB IDE), the up and down arrow keys are working fine.
How can the below code be changed, in order to make the arrow keys work as expected on Linux?
Or is this a bug in PB?
Code: Select all
If OpenWindow(0, 0, 0, 140, 70, "SpinGadget", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
SpinGadget (0, 20, 20, 100, 25, 0, 1000)
SetGadgetState (0, 5) : SetGadgetText(0, "5") ; set initial value
Repeat
Event = WaitWindowEvent()
If Event = #PB_Event_Gadget
If EventGadget() = 0
Select EventType()
Case #PB_EventType_Up, #PB_EventType_Down
SetGadgetText(0, Str(GetGadgetState(0)))
Case #PB_EventType_Change
SetGadgetState(0, Val(GetGadgetText(0)))
EndSelect
EndIf
EndIf
Until Event = #PB_Event_CloseWindow
EndIf