Here is the simplest code I could make that reproduces the error.
Code: Select all
;*** This script requires the RapaGUI plugin ******************************************************
@REQUIRE "RapaGUI"
;*** Setup GUI **************************************************************************************
moai.CreateApp([[
<?xml version="1.0" encoding="iso-8859-1"?>
<application id="app">
<window Id="main" width="1024" height="768" margin="10" Open="false">
<hgroup color="#607BAA">
<button Id="end_main"> OK </button>
</hgroup>
</window>
<window Title=" LOGIN" Width="300" Id="pswd" Margin="10" Open="False"
Closegadget="False" MinimizeGadget="False" MaximizeGadget="False" SizeGadget="False">
<vgroup color="#608CAF">
<vspace Height="10"/>
<hgroup>
<hspace Width="20"/>
<vgroup Padding="10" Spacing="5">
<text Align="Center" Fontsize="big"> Please enter your Password </text>
<hgroup>
<text Align="Left" Fontsize="big">Password : </text>
<textentry Id="logapp" Password="1" Notify="Acknowledge" Fontsize="big" Weight="250"></textentry>
</hgroup>
</vgroup>
<hspace Width="20"/>
</hgroup>
<vgroup>
<vspace Height="10"/>
<hline/>
<vspace Height="10"/>
</vgroup>
<vgroup>
<vspace Height="2"/>
<hgroup>
<hspace Width="10"/>
<button Id="logOK" notify="Pressed" weight="50" fontsize="big"> LOGIN </button>
<hspace Width="40"/>
<button Id="logcancel" notify="Pressed" weight="50" fontsize="big"> CANCEL </button>
<hspace Width="10"/>
</hgroup>
<vspace Height="5"/>
</vgroup>
</vgroup>
</window>
</application>
]])
;*** Handler for all incoming events **************************************************************
Function E_EventFunc(msg)
Switch msg.action
Case "RapaGUI"
Switch msg.attribute
Case "CloseRequest": ; ============================================================
Switch msg.id
Case "main"
End
EndSwitch
Case "Pressed": ; =================================================================
Switch msg.id
Case "end_main"
End
Case "logOK"
Password$ = moai.Get("logapp", "Text")
If Password$ = Login$
moai.Set("pswd", "Open", False)
moai.Set("main", "Open", True)
Else
PTry = PTry + 1
moai.Request(" INCORRECT LOGIN ! ",
" You entered an invalid Password." ..
"\n You have only ".. (4 - PTry).. " tries left.","OK")
moai.Set("logapp", "Text", "")
If PTry = 4
END
EndIf
moai.Set("pswd", "Activeobject", "logapp")
EndIf
Case "logcancel"
End
EndSwitch
Case "Acknowledge": ; =============================================================
Switch msg.id
Case "logapp"
Password$ = moai.Get("logapp", "Text")
If Password$ = Login$
moai.Set("pswd", "Open", False)
moai.Set("main", "Open", True)
Else
PTry = PTry + 1
moai.Request(" INCORRECT LOGIN ! ",
" You entered an invalid Password." ..
"\n You have only " .. (4 - PTry) .. " tries left.", "OK")
moai.Set("logapp", "Text", "")
If PTry = 4
END
EndIf
moai.Set("pswd", "Activeobject", "logapp")
EndIf
EndSwitch
EndSwitch
EndSwitch
EndFunction
;*** listen to these events ***********************************************************************
InstallEventHandler({RapaGUI = E_EventFunc})
Login$ = "Amiga"
moai.Set("pswd", "Open", True)
moai.Set("pswd", "Activeobject", "logapp")
;*** main loop ************************************************************************************
Repeat
WaitEvent
Forever
I have tried turning Off notifications but that made no difference. Adding in the Requester seem to help a bit but it still did not work like hitting the Login button.
I have spent a lot of time trying all sorts of work arounds but with no joy.
Hope I have explained it good enough for you.
Cheers
Leo