pos = moai.DoMethod(id, "Insert", pos, [icon1,] column1$, ...)
The entry data consists of a text string and, if the column has the
Listviewcolumn.Icon attribute set, an icon for each column.
The icon has to be passed before the text string and it has to be an
identifier of a Hollywood brush/icon which should be used as the icon for
the entry. If Listviewcolumn.Icon isn't set, then you must
omit the icon parameter and only pass text data for the listview
entry. If you've set Listviewcolumn.Icon to True
and you
don't want to show an icon in this particular row and column, you
can also pass the special value -1. In that case, RapaGUI won't
show an icon even though Listviewcolumn.Icon has been
set to True
. Please note that auto-generated IDs cannot be used.
Please also read about RapaGUI's image cache to learn more
about icon support in RapaGUI. See Image cache for details.
In case a column is showing a checkbox, you have to pass "On", "True", or "1" to select the checkbox and any other text to deselect the checkbox.
The insert position is specified in the pos
argument. The new
entry will be added in front of the entry specified by pos
. This
can be an absolute index position starting at 0 for the first entry
or one of the following special values:
Top
Active
Bottom
If pos
is bigger or equal to the number of entries in the listview, the
entry will be inserted as the last entry.
If the listview has sortable columns, pos
will be ignored and the entry
will automatically be sorted into the listview, depending on which column
currently has the sort focus. See Listview.SortColumn for details.
Listview.Insert returns the position of the newly inserted entry. This is especially useful when the listview has sortable columns because in that case, you can't easily compute where the entry will end up in the listview.
Note that on AmigaOS and compatibles icon support is only available with MUI 4.0 or better.