Switch loop and dialog

Discuss GUI programming with the RapaGUI plugin here
Post Reply
User avatar
NubeCheCorre
Posts: 77
Joined: Mon Mar 19, 2012 1:24 am
Contact:

Switch loop and dialog

Post 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})

User avatar
airsoftsoftwair
Posts: 4371
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

Re: Switch loop and dialog

Post by airsoftsoftwair »

Hard to tell without knowing what p_CloseDialog() actually does :)

User avatar
NubeCheCorre
Posts: 77
Joined: Mon Mar 19, 2012 1:24 am
Contact:

Re: Switch loop and dialog

Post by NubeCheCorre »

Sorry :-D

Code: Select all

Function p_CloseDialog()

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

User avatar
NubeCheCorre
Posts: 77
Joined: Mon Mar 19, 2012 1:24 am
Contact:

Re: Switch loop and dialog

Post 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.

User avatar
NubeCheCorre
Posts: 77
Joined: Mon Mar 19, 2012 1:24 am
Contact:

Re: Switch loop and dialog

Post 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?

User avatar
airsoftsoftwair
Posts: 4371
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

Re: Switch loop and dialog

Post 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.

User avatar
NubeCheCorre
Posts: 77
Joined: Mon Mar 19, 2012 1:24 am
Contact:

Re: Switch loop and dialog

Post 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? :-)

User avatar
airsoftsoftwair
Posts: 4371
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

Re: Switch loop and dialog

Post 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.

User avatar
NubeCheCorre
Posts: 77
Joined: Mon Mar 19, 2012 1:24 am
Contact:

Re: Switch loop and dialog

Post by NubeCheCorre »

ok thanks, i send you an email with the script attached

Post Reply