collectordave wrote:Thanks Saw that so how to set the header of the checkbox column?
The following example demonstrates how to use Cocoa API methods to set the header text of a CheckBox column and increase the width of the column (tested successfully with PB 5.46 x64 in ASCII mode and with PB 5.71 x64):
Code: Select all
EnableExplicit
Procedure SetCheckBoxColumnHeaderText(ListIconID.I, Title.S,
ColumnWidth.CGFloat)
Protected *Column
*Column = CocoaMessage(0, CocoaMessage(0, GadgetID(ListIconID),
"tableColumns"), "objectAtIndex:", 0)
; ----- Check whether column 0 contains checkboxes
If PeekS(CocoaMessage(0, CocoaMessage(0, *Column, "identifier"),
"UTF8String"), -1, #PB_UTF8) = "CheckBox"
; ----- Increase width of column
CocoaMessage(0, *Column, "setWidth:@", @ColumnWidth)
; ----- Set header text of column 0
CocoaMessage(0, CocoaMessage(0, *Column, "headerCell"),
"setTitle:$", @Title)
EndIf
EndProcedure
OpenWindow(0, 200, 100, 490, 104, "ListIcon Example")
ListIconGadget(0, 10, 10, WindowWidth(0) - 20, WindowHeight(0) - 20,
"Name", 110, #PB_ListIcon_GridLines | #PB_ListIcon_CheckBoxes)
AddGadgetColumn(0, 1, "Address", GadgetWidth(0) - GetGadgetItemAttribute(0, 0,
#PB_ListIcon_ColumnWidth) - 51)
AddGadgetItem(0, -1, "Harry Rannit" + #LF$ +
"12 Parliament Way, Battle Street, By the Bay")
AddGadgetItem(0, -1, "Ginger Brokeit" + #LF$ +
"130 PureBasic Road, BigTown, CodeCity")
AddGadgetItem(0, -1, "Didi Foundit" + #LF$ +
"321 Logo Drive, Mouse House, Downtown")
SetCheckBoxColumnHeaderText(0, "Select", 40)
Repeat
Until WaitWindowEvent() = #PB_Event_CloseWindow