AddGadgetColumn()

Syntax

AddGadgetColumn(#Gadget, Position, Title$, Width)
Description
Adds a new column to the specified gadget.

Parameters

#Gadget The gadget to use.
Position The column index where the new item should be inserted. Column indexes start from 0, which is the leftmost column, and increase by 1 for each column to the right. When you add a column, all the old columns which are on the right of the new column will have a position which is one more than they previously had.
Title$ The text for the column header.
Width The initial width of the new column.

Return value

None.

Remarks

This command can be used with the following types of gadgets:

- ListIconGadget()

Example

  Global Index = 1     ; "Standard column" has already index 0
  
  Procedure AddNewColumnEvent()
    AddGadgetColumn(0, index, "Column " + Index, 80)
    Index + 1
  EndProcedure
  
  If OpenWindow(0, 0, 0, 400, 150, "ListIcon - Add Columns", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
    ListIconGadget(0, 10, 10, 380, 100, "Standard Column", 150, #PB_ListIcon_GridLines)
    ButtonGadget(1, 10, 120, 150, 20, "Add new column")
    
    BindGadgetEvent(1, @AddNewColumnEvent())
  EndIf

See Also

RemoveGadgetColumn(), ListIconGadget()

Supported OS

All

Gadget Index - AddGadgetItem() ->