ListView.GetSelection

Discuss GUI programming with the MUI Royale plugin here
Post Reply
djrikki
Posts: 682
Joined: Wed Apr 06, 2011 12:26 am

ListView.GetSelection

Post 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.
Evolve - Rapid GUI Development tool for MUI Royale and RapaGUI
http://myevolve.wordpress.com
djrikki
Posts: 682
Joined: Wed Apr 06, 2011 12:26 am

Re: ListView.GetSelection

Post 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?
Evolve - Rapid GUI Development tool for MUI Royale and RapaGUI
http://myevolve.wordpress.com
User avatar
airsoftsoftwair
Posts: 5443
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

Re: ListView.GetSelection

Post 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 :)
djrikki
Posts: 682
Joined: Wed Apr 06, 2011 12:26 am

Re: ListView.GetSelection

Post by djrikki »

RE: Icons

Are I see... I never thought of that.
Evolve - Rapid GUI Development tool for MUI Royale and RapaGUI
http://myevolve.wordpress.com
Post Reply