Crash with "Choice" object on Android

Discuss GUI programming with the RapaGUI plugin here
Post Reply
bitRocky
Posts: 120
Joined: Fri Nov 14, 2014 6:01 pm

Crash with "Choice" object on Android

Post by bitRocky »

Hi,
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

SamuraiCrow
Posts: 475
Joined: Fri May 15, 2015 5:15 pm
Location: Waterville, Minnesota USA

Re: Crash with "Choice" object on Android

Post by SamuraiCrow »

The Hollywood Player plugin is RapaGUI version 2.0 on Android. MorphOS is still on RapaGUI 1.x and the 2 versions are not fully compatible.
I'm on registered MorphOS using FlowStudio.
bitRocky
Posts: 120
Joined: Fri Nov 14, 2014 6:01 pm

Re: Crash with "Choice" object on Android

Post by bitRocky »

It worked with HollywoodPlayer V8 which also had RapaGUI V2, I think.

But nonetheless it's IMHO a bug in the V9 player.
User avatar
airsoftsoftwair
Posts: 5425
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

Re: Crash with "Choice" object on Android

Post by airsoftsoftwair »

Thanks, that's fixed now. A fixed version will be pushed through the Play Store with the RapaGUI 2.0 release.
Post Reply