Trouble getting values from listview

Discuss GUI programming with the RapaGUI plugin here
Post Reply
Figgy78
Posts: 30
Joined: Wed Oct 11, 2017 9:13 am

Trouble getting values from listview

Post by Figgy78 » Fri Oct 27, 2017 1:56 pm

Hi!

I'm trying to fetch a couple of values from a listview.

The listview has two columns: "fermentable" and "grams".
I have entered two test rows:
Row 0: "Fermentable1", "123"
Row 2: "Fermentable2", "234"

Using a button I made I want to write those to a file, so to debug I wrote this code:

Code: Select all

;Add Fermentables to a Table (array)
fermentablesTable = {}
For local a = 0 to (moai.Get("fermentlistview","Entries")-1)
	fermentablesTable[a] = moai.DoMethod("fermentlistview", "GetEntry", a)
	DebugPrint(fermentablesTable[a])		
next
This outputs the following in the Debug window:

Code: Select all

Fermentable1
Fermentable2
So.. Why am I not getting the "grams" column in the debug window? Am I being an idiot? I presume I am. :)

Erlend

p-OS
Posts: 89
Joined: Tue Nov 02, 2010 12:56 am

Re: Trouble getting values from listview

Post by p-OS » Fri Oct 27, 2017 5:08 pm

GetEntry results as many values as you have columns in your listview

Code: Select all

  v_fermentable , v_grams = moai.DoMethod("fermentlistview", "GetEntry", a)
 

Figgy78
Posts: 30
Joined: Wed Oct 11, 2017 9:13 am

Re: Trouble getting values from listview

Post by Figgy78 » Tue Oct 31, 2017 10:09 am

Ahhh.. That's great. Thanks. I think I learned something fundamental just now :)

Post Reply