Code: Select all
Procedure SizeHandler()
Protected w, h
w = WindowWidth(0)
h = WindowHeight(0)
ResizeGadget(0, #PB_Ignore, #PB_Ignore, w-41, #PB_Ignore)
ResizeGadget(1, #PB_Ignore, #PB_Ignore, w-41, #PB_Ignore)
ResizeGadget(2, #PB_Ignore, #PB_Ignore, w-41, #PB_Ignore)
ResizeGadget(3, #PB_Ignore, #PB_Ignore, w-41, #PB_Ignore)
EndProcedure
If OpenWindow(0, 0, 0, 720, 600, "Resize the window", #PB_Window_SystemMenu | #PB_Window_ScreenCentered | #PB_Window_SizeGadget)
ComboBoxGadget(0, 5, 59, 557, 27, #PB_ComboBox_Editable)
ComboBoxGadget(1, 5, 121, 557, 27, #PB_ComboBox_Editable)
ComboBoxGadget(2, 5, 183, 557, 27, #PB_ComboBox_Editable)
ComboBoxGadget(3, 5, 245, 557, 27, #PB_ComboBox_Editable)
For c=0 To 3
For i=0 To 7
AddGadgetItem(c, -1, Str(i))
Next
SetGadgetText(c, Str(i - 1))
Next
BindEvent(#PB_Event_SizeWindow, @SizeHandler())
Repeat
Select WaitWindowEvent()
Case #PB_Event_CloseWindow
End
EndSelect
ForEver
EndIf

