I checked the manual, purearea samples and the english forum but couldnt find a solution to this. Verified on two windows xp professional installations with the latest PB 4.10 version.
Code: Select all
;- Window Constants
Global Window_Form1
;- Gadget Constants
Enumeration 1
;Window_Form1
Global Gadget_Form1_ScrollBar2
Global Gadget_Form1_ScrollArea3
Global Gadget_Form1_Area4
Global Gadget_Form1_ScrollBar5
EndEnumeration
Procedure.l Window_Form1()
Window_Form1=OpenWindow(#PB_Any,80,80,345,170,"Work Form1",#PB_Window_SystemMenu|#PB_Window_ScreenCentered|#PB_Window_Invisible)
If Window_Form1
If CreateGadgetList(WindowID(Window_Form1))
Gadget_Form1_ScrollBar2=ScrollBarGadget(#PB_Any,10,10,300,15,0,500,100)
Gadget_Form1_ScrollArea3=ScrollAreaGadget(#PB_Any,10,40,300,115,400,300,5)
CloseGadgetList()
Gadget_Form1_ScrollBar5=ScrollBarGadget(#PB_Any,320,10,15,145,0,500,100,#PB_ScrollBar_Vertical)
HideWindow(Window_Form1,0)
ProcedureReturn WindowID(Window_Form1)
EndIf
EndIf
EndProcedure
;- Main Loop
If Window_Form1()
quitForm1=0
Repeat
EventID =WaitWindowEvent(100)
; Repeat
; EventID = WindowEvent()
; If (EventID = 0)
; Debug "EV Timeout"
; Delay(10)
; EndIf
; Until EventID
If (EventID)
Debug "Event : " + Str(EventID)
MenuID =EventMenu()
GadgetID =EventGadget()
WindowID =EventWindow()
Select EventID
Case #PB_Event_CloseWindow
If WindowID=Window_Form1
quitForm1=1
EndIf
Case #PB_Event_Gadget
Select GadgetID
Case Gadget_Form1_ScrollBar2
Case Gadget_Form1_Area4
Case Gadget_Form1_ScrollBar5
EndSelect
EndSelect
Else
Debug "Event timeout"
EndIf
Until quitForm1
CloseWindow(Window_Form1)
EndIf
End
; IDE Options = PureBasic 4.10 (Windows - x86)
; CursorPosition = 81
; FirstLine = 34
; Folding = -
; EnableThread
; EnableXP
- Do i miss something? Is this behaviour intended or a bug?
- if this behaviour is "intended" - how can i make realtime updates to gadgets/areas while the scrollbar is dragged?
- why doesnt the scrollbar give any event while its beeing dragged?
- is longcat really as long as people claim it is?
Using a second thread, the window callback function and a mutex "may" get around this problem, but it feels very dirty and definitely isnt portable.

