Page 1 of 1

[6.10 Beta 6] SetGadgetItemAttribute() with #PB_ListIcon_ColumnAlignment

Posted: Sat Feb 17, 2024 1:22 pm
by Shardik
According to the english help for SetGadgetItemAttribute() the second parameter should be the item index of the row in a ListIconGadget (-1: header row, 0: index of 1st row). But the given index is not respected. Independant from the given index all cell texts in a column plus header text are right-aligned. In the following example the cell text in the 2nd row and 2nd column should be right-aligned but all cell texts plus header text in the 2nd column are right-aligned (tested on Linux Mint 21.3 x64 'Virginia' with Cinnamon and PB 6.10 x64 Beta 6):

Code: Select all

OpenWindow(0, 200, 100, 410, 130, "Column justification")
ListIconGadget(0, 10, 10, 390, 85, "Name", 100)
AddGadgetColumn(0, 1, "Address", 280)
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")
ButtonGadget(1, 70, 100, 250, 25, "Right-align text in 2nd row and 2nd column")

Repeat
  Select WaitWindowEvent()
    Case #PB_Event_CloseWindow
      Break
    Case #PB_Event_Gadget
      If EventGadget() = 1
        SetGadgetItemAttribute(0, 1, #PB_ListIcon_ColumnAlignment,
          #PB_ListIcon_Right, 1)
      EndIf
  EndSelect
ForEver

Re: [6.10 Beta 6] SetGadgetItemAttribute() with #PB_ListIcon_ColumnAlignment

Posted: Sat Feb 17, 2024 2:10 pm
by Fred
No it works per column, not per cell. The doc is wrong.

Re: [6.10 Beta 6] SetGadgetItemAttribute() with #PB_ListIcon_ColumnAlignment

Posted: Sat Mar 02, 2024 7:57 pm
by Andre
Any concrete suggestion for changing the docs? Thank you :)