What is the best way to handle resize events? I have a CanvasGadget that displays a map that is locked to all sides of the window. If the window is resized then I want to redraw the map to fill the CanvasGadget. Currently I have to have extra code in my event loop to handle this resize in addition to the ResizeGadgetsWindow_0 procedure that is generated, and it does not really fit with the way of defining event procedures.
For example, I have this:
Code: Select all
Repeat
ev = WaitWindowEvent()
Select EventWindow()
Case MainWindow
If MainWindow_Events(ev) = #False
quit = #True
ElseIf ev = #PB_Event_SizeWindow
DrawMap(@map_area)
EndIf
EndSelect
Until quit
Thanks.