Gadgets creep slightly...
Code:
;{- Enumerations / DataSections
;{ Windows
Enumeration
#Window_0
EndEnumeration
;}
;{ Gadgets
Enumeration
#ListIcon_0
#Button_1
#CheckBox_2
EndEnumeration
;}
Define.l Event, EventWindow, EventGadget, EventType, EventMenu
;}
Procedure OpenWindow_Window_0()
If OpenWindow(#Window_0, 450, 200, 636, 294, "Window_0", #PB_Window_SystemMenu|#PB_Window_SizeGadget|#PB_Window_MinimizeGadget|#PB_Window_TitleBar)
ListIconGadget(#ListIcon_0, 5, 5, 625, 240, "Gadget_0", 100, #PB_ListIcon_AlwaysShowSelection|#PB_ListIcon_GridLines|#PB_ListIcon_FullRowSelect)
SendMessage_(GadgetID(#ListIcon_0), #LVM_SETCOLUMNWIDTH, 0, #LVSCW_AUTOSIZE_USEHEADER)
ButtonGadget(#Button_1, 15, 255, 125, 25, "Gadget_1")
CheckBoxGadget(#CheckBox_2, 515, 250, 115, 15, "Gadget_2")
; Gadget Resizing
PureRESIZE_SetGadgetResize(#ListIcon_0, 1, 1, 0, 0)
PureRESIZE_SetGadgetProportionalResize(#ListIcon_0, 1, 1, 0, 0)
PureRESIZE_SetGadgetResize(#Button_1, 1, 0, 0, 1)
PureRESIZE_SetGadgetResize(#CheckBox_2, 0, 0, 1, 1)
EndIf
EndProcedure
OpenWindow_Window_0()
;{- Event loop
Repeat
Event = WaitWindowEvent(10)
Select Event
; ///////////////////
Case #PB_Event_Gadget
EventGadget = EventGadget()
EventType = EventType()
If EventGadget = #ListIcon_0
ElseIf EventGadget = #Button_1
ElseIf EventGadget = #CheckBox_2
EndIf
; ////////////////////////
Case #PB_Event_CloseWindow
EventWindow = EventWindow()
If EventWindow = #Window_0
CloseWindow(#Window_0)
Break
EndIf
EndSelect
ForEver
;
;}
If you resize the window -- the button & checkbox will slowly creep up to (resize window smaller) or away from (resize window larger) the listicongadget...