Code: Select all
<?xml version="1.0" encoding="iso-8859-1"?>
<application id="app">
<window id="win" title="Treeview" height="400" width="500">
<vgroup>
<treeview id="tv">
<column title="ANIMAL FILES" width="150"/>
<column title="jpgfile" width="100"/>
<column title="pdffile" width="100"/>
<column title="docfile" width="100"/>
<node name="Pet Files">
<node name="CatFiles">
<leaf id="WildCats">
<item>Wild Cats</item>
<item>Tiger.jpg</item>
<item>Leopard.pdf</item>
<item>Panther.doc</item>
</leaf>
<leaf id="TameCats">
<item>Tame Cats</item>
<item>Ginger.jpg</item>
<item>Tonkinese.pdf</item>
<item>RagDoll.doc</item>
</leaf>
</node>
<node name="DogFiles">
<leaf id="WildDogs">
<item>Wild Dogs</item>
<item>Jackal.jpg</item>
<item>Wolf.jpg</item>
<item>Hyena.doc</item>
</leaf>
<leaf id="TameDogs">
<item>Tame Dogs</item>
<item>Labrador.jpg</item>
<item>Alsation.pdf</item>
<item>Bulldog.doc</item>
</leaf>
</node>
</node>
</treeview>
<hgroup>
<button id="viewjpg">View jpg</button>
<button id="viewpdf">View pdf</button>
<button id="viewdoc">View doc</button>
</hgroup>
</vgroup>
</window>
</application>
Code: Select all
@VERSION 6,1
@REQUIRE "RapaGUI"
Function p_EventFunc(msg)
Switch msg.action
Case "RapaGUI":
Switch msg.attribute
Case "Pressed":
Switch msg.id
Case "viewjpg":
Case "viewpdf":
Case "viewdoc":
EndSwitch
EndSwitch
EndSwitch
EndFunction
moai.CreateApp(FileToString("MyTreeview.xml"))
InstallEventHandler({RapaGUI = p_EventFunc})
moai.DoMethod("tv", "open", "root", True)
Repeat
WaitEvent
Forever
I have read the treeview blurb in the RAPAGUI manual but have not been able to follow the logic there (my fault I suppose, though I have done some programming in the past). Can anyone assist me as to how to parse the selected row using GetEntry? Thanks in advance.