Please also note the blank space at the bottom of the scrollbars (in dataview mode) for mac-ppc, only after the window is resized, they are painted correctly.
Example script:
Code: Select all
@REQUIRE "RapaGUI", {Link = True}
@APPTITLE "ListView-Test"
Function p_EventFunc(msg)
DebugPrint(msg.id, msg.Attribute)
If msg.Attribute = "DoubleClick"
Local activeObject = moai.Get("mainWindow", "activeObject")
moai.Set("lblInfo", "text", activeObject)
DebugPrint("activeObject:", activeObject)
EndIf
EndFunction
moai.CreateApp([[<?xml version="1.0" encoding="iso-8859-1"?>
<application id="app">
<window id="mainWindow" title="ListView-Test">
<vgroup>
<text id="lblInfo">Double click on an item to get the currently active object</text>
<hgroup frame="true" frametitle="Listview1 in listview mode">
<listview id="listview1" notify="doubleclick" forceMode="listview">
<column title="ID" />
<column title="Text" />
</listview>
</hgroup>
<hgroup frame="true" frametitle="Listview2 in dataview mode">
<listview id="listview2" notify="doubleclick" forceMode="dataview">
<column title="ID" />
<column title="Text" />
</listview>
</hgroup>
<hgroup frame="true" frametitle="Listview3 with hidden column">
<listview id="listview3" notify="doubleclick">
<column hide="true" />
<column title="Text" />
</listview>
</hgroup>
</vgroup>
</window>
</application>
]])
InstallEventHandler({RapaGUI = p_EventFunc})
For Local i = 0 To 100
moai.DoMethod("listview1", "insert", "bottom", i, "Item " .. i)
moai.DoMethod("listview2", "insert", "bottom", i, "Item " .. i)
moai.DoMethod("listview3", "insert", "bottom", i, "Item " .. i)
Next
Repeat
WaitEvent
Forever