sorry for the double post
I think I know the problem.....
When the window is resized, it is automatically updated... Now The problem is that the gadgets are updated at the exact same time that your program decides to resize them (on the pb resize event)
To prevent this problem... simply add this line after every gadget resize
RedrawWindow_(GadgetID(GadgetNumber),0,0,#RDW_INTERNALPAINT|#RDW_UPDATENOW)
This is a less-than-elegant way of doing it, but I get very nice results...
Code: Select all
;
; ------------------------------------------------------------
;
; PureBasic - Gadget example file
;
; (c) 2003 - Fantaisie Software
;
; ------------------------------------------------------------
;
#WindowWidth = 640
#WindowHeight = 480
If OpenWindow(0, 0, 0, #WindowWidth, #WindowHeight, #PB_Window_SystemMenu | #PB_Window_ScreenCentered | #PB_Window_SizeGadget, "PureBasic - Gadget Demonstration")
If CreateGadgetList(WindowID())
TextGadget(7, 10, 5, 700, 15, "PureBasic splitter demonstation with Editor, ScrollArea, ExplorerTree and Web gadgets. Feel the power...")
WebGadget(0, 10, 10, 300, 20, "http://www.purebasic.com")
EditorGadget(1, 115, 10, 100, 190)
For k=1 To 10
AddGadgetItem(1, k-1, "Line "+Str(k))
Next
ExplorerTreeGadget(3, 115, 10, 100, 190, "", #PB_Explorer_AlwaysShowSelection|#PB_Explorer_FullRowSelect|#PB_Explorer_MultiSelect)
ScrollAreaGadget(6, 0, 0, 400, 400, 1000, 1000, 1)
ButtonGadget(20, 20, 20, 200, 200, "Scroll Area !")
CloseGadgetList()
SplitterGadget(2, 0, 0, #WindowWidth/2, #WindowHeight/2, 1, 0)
SplitterGadget(4, 0, 0, #WindowWidth, #WindowHeight, 3, 2, #PB_Splitter_Vertical)
SplitterGadget(5, 0, 25, #WindowWidth, #WindowHeight-25, 4, 6, #PB_Splitter_Vertical)
SetGadgetState(5, 500)
EndIf
Repeat
EventID = WaitWindowEvent()
If EventID = #PB_Event_Gadget
Select EventGadgetID()
Case 8
SetGadgetState(5, 333)
SetGadgetState(2, 333)
SetGadgetState(11, 5)
Case 20
Debug "ok"
EndSelect
ElseIf EventID = #PB_Event_SizeWindow
ResizeGadget(5, -1, -1, WindowWidth(), WindowHeight()-25) ; Our 'master' splitter gadget
;-##########This is the only added line :)##########
RedrawWindow_(GadgetID(5),0,0,#RDW_INTERNALPAINT|#RDW_UPDATENOW)
EndIf
Until EventID = #PB_EventCloseWindow
EndIf
End
Maybe someone can improve on this idea?

There still seems to be the problem of gadgets not getting updated when they are not resized...look at the text-at-the-top while resizeing... It doesn't refresh...
Added: This technique doesn't seem to work in every situation... PB needs a built-in solution for this... It
is a high-level language after all...