Resizing ExplorerList gadgets from a callback
Posted: Mon Jun 23, 2003 9:19 pm
Hello,
(fr34k, this is what I asked you about a few days ago ;)
I'm trying to resize some gadgets from a window callback. The code below shows the problem I am having - when I resize the gadgets only the one on the right is redrawn. It also happens with ExplorerTree gadgets.
In this code you can move the mouse left and right over the window (but NOT! over the explorerList gadgets) to resize the gadgets.
Now, it's either because I'm doing something naughty with the callbacks or the explorer list gadget is screwed. Either answer will suit me as long as some explanation comes with it ;p
Thanks.
(fr34k, this is what I asked you about a few days ago ;)
I'm trying to resize some gadgets from a window callback. The code below shows the problem I am having - when I resize the gadgets only the one on the right is redrawn. It also happens with ExplorerTree gadgets.
In this code you can move the mouse left and right over the window (but NOT! over the explorerList gadgets) to resize the gadgets.
Code: Select all
Procedure.l Balance_Callback(*window.l, Message.l, wParam.l, lParam.l)
DefType.l result
If Message=#WM_MOUSEMOVE And UseWindow(0)
mx = WindowMouseX()
my = WindowMouseY()
If mx>10 And mx<390 And my>10 And my<390
LockWindowUpdate_(WindowID())
width1 = mx
ResizeGadget(1, -1, -1, width1, -1)
ResizeGadget(2, 4 + width1 + 4, -1, 400 - width1, -1)
LockWindowUpdate_(0)
UpdateWindow_(WindowID())
EndIf
EndIf
result = #PB_ProcessPureBasicEvents
ProcedureReturn result
EndProcedure
If OpenWindow(0, 400, 400, 412, 300, 0, "fghjk", 0)
SetWindowCallback(@Balance_Callback())
width1.l = 200
If CreateGadgetList(WindowID())
ExplorerListGadget(1, 4, 50, width1, 200, "c:\*.*", 0)
ExplorerListGadget(2, 4 + width1 + 4, 50, 400 - width1, 200, "c:\*.*", 0)
ButtonGadget(3, 156, 4, 100, 20, "Redraw", 0)
EndIf
While ev.l <> #PB_Event_CloseWindow
ev.l = WaitWindowEvent()
If ev=#PB_Event_Gadget
If EventGadgetID()=3
EndIf
EndIf
Wend
EndIf
End
Thanks.