When I resize a window I get a lot of #PB_Event_SizeWindow events. This is not usually a problem but I had a case where the data being re-loaded to the gadgets was large and having many #PB_Event_SizeWindow events was slowing things down with the repeated re-loads. Is there a way to get just one #PB_Event_SizeWindow event when the window is resized?
Code: Select all
#wndid=1 : #gadget1=1
Procedure UpdateGadgetInfo()
;ClearGadgetItems(#gadget1) ; taken out to show the repeated loading
AddGadgetItem(#gadget1,-1,"Added line")
EndProcedure
If OpenWindow(#wndid, 100, 200, 195, 260, "PureBasic Window", #PB_Window_SystemMenu | #PB_Window_SizeGadget)
ListViewGadget(#gadget1,10,10,175,240)
UpdateGadgetInfo()
EndIf
Repeat
Event = WaitWindowEvent()
Select event
Case #PB_Event_CloseWindow
End
Case #PB_Event_SizeWindow
Debug "Window resized"
ResizeGadget(#gadget1,#PB_Ignore,#PB_Ignore,WindowWidth(#wndid)-20,WindowHeight(#wndid)-20)
UpdateGadgetInfo()
EndSelect
ForEver