Page 1 of 3
InstallEventHandler & RapaGUI...
Posted: Wed Dec 27, 2017 11:13 pm
by Tuxedo
Ok guys...
probably the most stupid question of all time...
I tryed to change the eventhandler in the RapaGUI tutorial script this way:
InstallEventHandler({RapaGUI = p_EventFunc, OnKeyDown = p_EventFunc})
To check when a key is pressed to do some tests...
However seems that the event wasnt installed but only the RapaGUI callback was installed...
For sure I make some weird mistake but...what?
Thank you for patience...
Re: InstallEventHandler & RapaGUI...
Posted: Thu Dec 28, 2017 11:45 am
by airsoftsoftwair
Are you expecting "OnKeyDown" to report key presses in a RapaGUI window? That won't work. "OnKeyDown" will only work with normal Hollywood displays. If you want to have "OnKeyDown" for a RapaGUI window, you need to embed a Hollywood display inside the RapaGUI window to get "OnKeyDown".
Re: InstallEventHandler & RapaGUI...
Posted: Thu Dec 28, 2017 2:12 pm
by Tuxedo
Ok,
Thank you.
I want, for exercise, to add a function that add automatically to the List the typed strings after press enter.
I really hate to press the add button every time...
And dont seems that in RapaGUI there was a finction/callback to do that...or I'm wrong?
Re: InstallEventHandler & RapaGUI...
Posted: Thu Dec 28, 2017 2:16 pm
by airsoftsoftwair
Re: InstallEventHandler & RapaGUI...
Posted: Thu Dec 28, 2017 11:49 pm
by Tuxedo
ho my....
As wrote above "most stupid question ever..." SORRY!
BTW, maybe I discovered one bug...
I've do that:
Code: Select all
/* RapaGUI Tutorial */
@APPTITLE "RapagGUI Tutorial"
@APPVERSION "$VER RapaGUI Tutorial 1.0 (29.12.2015)"
@APPCOPYRIGHT "Copyright 2015, Andreas Falkenhann"
@APPAUTHOR "Andreas Flakenhann"
@APPDESCRIPTION "Il tutorial dalla guida di RapaGUI"
@REQUIRE "RapaGUI"
Function p_EventFunc(msg)
; DebugPrint(msg.class, msg.Attribute, msg.id, msg.action, msg.)
Switch msg.CLass
Case "Menuitem":
Switch msg.Attribute
Case "Selected":
Switch msg.id
Case "menuabout":
moai.Request("Test", "Test program\n" ..
"C 2015 by Andreas Falkenhann", "OK")
Case "menuaboutrapagui":
moai.DoMethod("app", "aboutrapagui")
Case "menuquit":
End
EndSwitch
EndSwitch
Case "Listview":
Switch msg.Attribute
Case "Active":
s$ = moai.DoMethod("mylistview", "getentry", "active")
moai.Set("mystring", "text", s$)
moai.Set("mybt2", "disabled", IIf(msg.triggervalue = -1, True, False))
EndSwitch
Case "Textentry": ; quì ci entro se premo "RETURN"
s$ = moai.Get("mystring", "text")
moai.DoMethod("mylistview", "insert", "sorted", s$)
Wait(5) ; ***************** Without that Wait() the * moai.Set("mywin", "ActiveObject", "mystring") * DONT works here...
moai.Set("mywin", "ActiveObject", "mystring")
Case "Button": ; quì ci entro se premo un PULSANTE
Switch msg.Attribute
Case "Pressed":
Switch msg.ID
Case "mybt1": ; E' stato premuto il pulsante "Aggiungi"
s$ = moai.Get("mystring", "text")
moai.DoMethod("mylistview", "insert", "sorted", s$)
moai.Set("mywin", "ActiveObject", "mystring")
Case "mybt2": ; E' stato premuto il pulsante "Rimuovi"
moai.DoMethod("mylistview", "remove", "active")
EndSwitch
EndSwitch
EndSwitch
EndFunction
moai.CreateApp(FileToString("TutorialGUI.xml"))
InstallEventHandler({RapaGUI = p_EventFunc})
Repeat
WaitEvent
Forever
With that gui definition:
Code: Select all
<?xml version="1.0" encoding="iso-8859-1"?>
<application id="app">
<menubar id="mymenubar">
<menu title="File">
<item id="menabout">About...</item>
<item id="menaboutrapagui">About RapaGUI...</item>
<item/>
<item id="menuquit">Quit</item>
</menu>
</menubar>
<window title="Esempio RapaGUI" id="mywin" menubar="mymenubar">
<vgroup>
<listview id="mylistview" notify="active">
<column/>
</listview>
<hgroup>
<label align="right">_Pippo</label>
<textentry id="mystring" notify="acknowledge"/>
</hgroup>
<hgroup>
<button id="mybt1">Aggiungi</button>
<button id="mybt2">Rimuovi</button>
</hgroup>
</vgroup>
</window>
</application>
As described on the note while pressing Return the textentry doesnt "reactivate" automatically if the Wait() wasnt present...with the "Add" button all work as expected instead...
A bug or my fault somewhere?
Thank you!
Re: InstallEventHandler & RapaGUI...
Posted: Fri Dec 29, 2017 12:13 pm
by airsoftsoftwair
Which platform?
Re: InstallEventHandler & RapaGUI...
Posted: Fri Dec 29, 2017 1:52 pm
by Tuxedo
AmigaOS4.1FEupd1 on Pegasos2 g4
Re: InstallEventHandler & RapaGUI...
Posted: Fri Dec 29, 2017 9:52 pm
by airsoftsoftwair
I can reproduce it. Could be a MUI bug (or feature). Thore should be able to explain this so it might be worth filing a ticket over at
http://muidev.de for it...
Re: InstallEventHandler & RapaGUI...
Posted: Fri Dec 29, 2017 10:05 pm
by Tuxedo
ok,
I'll try to do that...not so expert however... ;P
Thore will have patience.
Re: InstallEventHandler & RapaGUI...
Posted: Sat Dec 30, 2017 11:39 pm
by Tuxedo
I tryed to submit a bug in MUI bugtracker but get always(tryed 3 times):
Trac error
Submission rejected as potential spam
Akismet says content is spam
What to do?