Page 1 of 1

Switch loop and dialog

Posted: Sat Aug 15, 2020 9:33 pm
by NubeCheCorre
I wrote this simple code to check for event and id but I don't know what i am doing wrong.. When i press "cancel" to close the dialog window instead it closes also my app..

Here is the code, may you help me?

Code: Select all

Function p_EventFunc(msg)
	Switch msg.action
		Case "RapaGUI":
			Switch msg.attribute
				Case "Selected":
					Switch msg.id
						Case "nc_p":
							p_CreateDialog()
							p_OpenDialog()
					EndSwitch
						Case "Pressed":
							Switch msg.id
								Case "cancel":
								p_CloseDialog()
							EndSwitch						
			EndSwitch
	EndSwitch
EndFunction

Code: Select all

InstallEventHandler({RapaGUI = p_EventFunc})

Re: Switch loop and dialog

Posted: Sat Aug 15, 2020 9:57 pm
by airsoftsoftwair
Hard to tell without knowing what p_CloseDialog() actually does :)

Re: Switch loop and dialog

Posted: Sun Aug 16, 2020 12:16 pm
by NubeCheCorre
Sorry :-D

Code: Select all

Function p_CloseDialog()

	moai.DoMethod("dlg", "endmodal",0)	
					
EndFunction

Re: Switch loop and dialog

Posted: Sun Aug 16, 2020 6:09 pm
by NubeCheCorre
Ok I don't know if it is a bug but I just tested the demo "Dialog" inside Hollywood and it has the same behaviour of my app but in my app, it happens when i press "cancel" while in the dialog demo happens when i press "OK". Here I am working on Debian 10 buster.

Re: Switch loop and dialog

Posted: Sun Aug 16, 2020 6:33 pm
by NubeCheCorre
ok it is random... I don't know why.. may I send you my little project so that you can try to understand if I am missing something or if there is a bug inside rapagui?

Re: Switch loop and dialog

Posted: Sun Aug 16, 2020 9:12 pm
by airsoftsoftwair
It's very likely a bug in RapaGUI but it's probably already fixed in RapaGUI 2.0 because dialog stuff has been completely redesigned in RapaGUI 2.0 because of several issues. So it's most likely fixed.

Re: Switch loop and dialog

Posted: Sun Aug 16, 2020 9:19 pm
by NubeCheCorre
ok but this new version of rapagui is available in the download section of hollywood site or it has to be releasead still? :-)

Re: Switch loop and dialog

Posted: Sun Aug 16, 2020 9:23 pm
by airsoftsoftwair
It's not available yet. If you want to make sure, send me your script and I'll test if it works correctly with RapaGUI 2.0.

Re: Switch loop and dialog

Posted: Sun Aug 16, 2020 9:26 pm
by NubeCheCorre
ok thanks, i send you an email with the script attached