this script crashes on Android (with the HollywoodPlayer) if you press the "Clear" button.
It works as it should on MorphOS.
It should clear the Choice object and then insert some new entries.
Code: Select all
@REQUIRE "RapaGUI"
@APPTITLE "ChoiceTest"
@DISPLAY {Width = 480, Height = 240}
/*
** Handles all incoming events
*/
Function p_EventFunc(msg)
DebugPrint("action = "..msg.action)
Switch msg.action
Case "RapaGUI"
Switch msg.attribute
Case "Pressed":
Switch msg.id
Case "cycledemo":
;moai.Set("cycle", "active", moai.Get("cycleactive", "text"), "nonotify", True)
moai.DoMethod("cycle", "clear")
For Local i = 0 To 5 Do moai.DoMethod("cycle", "insert", "bottom", "Item "..i)
Default:
EndSwitch
EndSwitch
EndSwitch
EndFunction
moai.CreateApp([[
<?xml version="1.0" encoding="iso-8859-1"?>
<application id="app">
<window title="Choice demo" id="window" >
<vgroup>
<vgroup title="Choice" icon="21">
<vgroup frame="true" frametitle="Choice demo">
<choice id="cycle" notify="active">
<item>Item number 1</item>
<item>Item number 2</item>
<item>Item number 3</item>
<item>Item number 4</item>
<item>Item number 5</item>
<item>Item number 6</item>
<item>Item number 7</item>
<item>Item number 8</item>
<item>Item number 9</item>
</choice>
<hgroup>
<label>Active entry</label>
<textentry id="cycleactive" accept="0123456789">0</textentry>
</hgroup>
<button id="cycledemo">Clear</button>
</vgroup>
</vgroup>
</vgroup>
</window>
</application>
]])
; listen to these events!
InstallEventHandler({RapaGUI = p_EventFunc})
; main loop!
Repeat
WaitEvent
Forever