Page 1 of 1
ListView.GetSelection
Posted: Wed Mar 13, 2013 7:34 pm
by djrikki
Hello,
If I select all contents of a ListView and then perform a .GetSelection I end up with a table.
If I then use:
Code: Select all
For Local t = 0 to ListItems(table)-1
debugprint(table[t])
Next
I just get a list of numbers, how do I find out the contents of the first column?
I tried debugprint(table[t][0]) in the loop, but the program just froze.
Re: ListView.GetSelection
Posted: Wed Mar 13, 2013 7:47 pm
by djrikki
If I try and find an alternative solution I ended up with wanted data in the second code segment below:
Code: Select all
For Local t = 0 to mui.Get("search-matches","entries")-1
Local col1, col2, col3, col4 = mui.DoMethod("search-matches","getentry",t)
WriteLine(1,col1)
Next
Code: Select all
[4b559340] AmigaVersion.txt
[4ca794d0] amigaguide.catalog
[4ca794d0] amigaguide.catalog
[4ca794d0] amigaguide.catalog
[4ca794d0] amigaguide.catalog
...
I don't need the content contained within the square [] brackets, why is .GetEntry appending this to the front of the first column?
Re: ListView.GetSelection
Posted: Thu Mar 14, 2013 10:14 pm
by airsoftsoftwair
Listview.GetSelection() returns the indices of all selected rows in a table. So if you get a table that contains the number 0, 5, and 10 it means that rows 0, 5, and 10 are selected. To read the contents of these rows you need to use Listview.GetEntry() then.
I don't need the content contained within the square [] brackets, why is .GetEntry appending this to the front of the first column?
This is the raw representation of the image that you used in your listview. It's actually a pointer to the image data in memory

Re: ListView.GetSelection
Posted: Sat Mar 16, 2013 3:29 pm
by djrikki
RE: Icons
Are I see... I never thought of that.