Posted: Wed Jul 17, 2002 2:19 am
Restored from previous forum. Originally posted by WolfgangS.
HI!
i really dont know why this (modified) example source NOT works on Win2k SP2 and PB3.2 . I see no ListViewGadget´s in the Window and it´s frozen. Any help ?
It seems the SetWindowCallback() isn´t working properly ... don´t hurt me if i´m wrong
cu
WolfgangS
HI!
i really dont know why this (modified) example source NOT works on Win2k SP2 and PB3.2 . I see no ListViewGadget´s in the Window and it´s frozen. Any help ?
It seems the SetWindowCallback() isn´t working properly ... don´t hurt me if i´m wrong
cu
WolfgangS
Code: Select all
#WindowWidth = 230
#WindowHeight = 230
Procedure WindowCallback(WindowID, Message, lParam, wParam)
Shared SplitterPosX, CursorType, MouseCaptured, OldWidth, MouseCaptureX
Select Message
Case #WM_MOUSEMOVE
If MouseCaptured
Width = WindowMouseX()-10
If Width OldWidth
OldWidth = Width
ResizeGadget(0, 10, 10, Width-3, 190)
ResizeGadget(1, 14+Width, 10, WindowWidth()-Width-30, 190)
UpdateWindow_(WindowID())
EndIf
Else
If WindowMouseX() > SplitterPosX; And WindowMouseX() SplitterPosX; And WindowMouseX() < SplitterPosX+10
If CursorType = 1
SetCapture_(WindowID())
MouseCaptured= 1
EndIf
EndIf
Case #WM_LBUTTONUP
If MouseCaptured= 1
MouseCaptured= 0
ReleaseCapture_()
EndIf
EndSelect
EndProcedure
If OpenWindow(0, 100, 120, #WindowWidth, #WindowHeight, #PB_Window_SystemMenu | #PB_Window_MinimizeGadget, "PureBasic - Gadget Demonstration")
If CreateGadgetList(WindowID())
Top = 10
GadgetHeight = 24
ListViewGadget(0, 10, 10, 100, 200)
For k=0 To 10
AddGadgetItem(0, -1, "Element "+Str(k))
Next
ListViewGadget(1, 115, 10, 100, 200)
For k=0 To 10
AddGadgetItem(1, -1, "Hello "+Str(k))
Next
EndIf
SplitterPosX = 100
SetWindowCallback(@WindowCallback())
Repeat
EventID = WaitWindowEvent()
Until EventID = #PB_EventCloseWindow
EndIf
End