Moving the column width with the mouse works.
But double-clicking on the column width (autosize) does not work and creates a very wide column.
Update Beta 9
Code: Select all
;-TOP
Image = CreateImage(0, 32, 32, 32, #Red)
Image2 = CreateImage(1, 32, 32, 32, #Blue)
Procedure UpdateWindow()
Protected dx, dy
dx = WindowWidth(0)
dy = WindowHeight(0)
ResizeGadget(0, 10, 10, dx - 20, dy - 20)
EndProcedure
Procedure Main()
Protected dx, dy, RowHeight.CGFloat
If OpenWindow(0, 210, 210, 520, 520, "Window", #PB_Window_SystemMenu | #PB_Window_SizeGadget)
dx = WindowWidth(0)
dy = WindowHeight(0)
ListIconGadget(0, 10, 10, dx - 20, dy - 20, "Column 0", 200)
AddGadgetColumn(0, 1, "Comlum 1", 200)
AddGadgetColumn(0, 2, "Comlum 2", 400)
; AddGadgetColumn(0, 3, "", 0) ; Dummy column
; Set big row height for test
RowHeight = 44
CocoaMessage(0, GadgetID(0), "setRowHeight:@", @RowHeight)
CocoaMessage(0, GadgetID(0), "setUsesAlternatingRowBackgroundColors:", #YES)
For i = 0 To 25
If i & 1
AddGadgetItem(0, -1, "Data " + i + #LF$ + "ListBox Item Data 1" + #LF$ + "ListBox Item Data 2", ImageID(1))
Else
AddGadgetItem(0, -1, "Data " + i + #LF$ + "ListBox Item Data 1" + #LF$ + "ListBox Item Data 2", ImageID(0))
EndIf
Next
; Not work beta 9
; SetGadgetItemAttribute(0, 0, #PB_ListIcon_ColumnWidth, 400, 2)
BindEvent(#PB_Event_SizeWindow, @UpdateWindow(), 0)
Repeat
Select WaitWindowEvent()
Case #PB_Event_CloseWindow
Break
EndSelect
ForEver
EndIf
EndProcedure : Main()