not sure if i should post this on RappaGUI or here..anyway.
Toaday I went through the popfont method. I have extracted the code from the Demo in the RappaGUI examples.
When it comes to Popfont.Font it only shows the name of the selected font in the log beneath the selection fields.
No wonder it only gets the triggervalue and put it into a listview.
Now when I try to set the font via moai.set("example","font",t$) I got now yield.
I tried to boil it down and asking myself how to make use of this method.
here is the .hwp
Code: Select all
@REQUIRE "RapaGUI"
@DISPLAY 1,{X = 50, Y = 200, Width = 420, Height = 340, Color = #WHITE}
@FONT 1,"Arial",48
Function p_Log(t$)
moai.DoMethod("log", "insert", "bottom",t$)
/*here it comes*/
moai.Set("example", "font",t$)
moai.DoMethod("log", "jump", "bottom")
EndFunction
Function EventFunktion(msg)
Switch msg.action
Case "RapaGUI"
Switch msg.attribute
Case "Pressed":
Switch msg.id
Case "hwclear":
Cls
Default:
p_Log("Button click: " .. msg.id)
EndSwitch
Case "Selected":
Switch msg.id
Case "mn_quit":
End
Case "mn_about":
moai.Request("", "Widgets demo\n(C) 2015-2016 by Andreas Falkenhahn\n\nVisit the official Hollywood portal at:\nhttp://www.hollywood-mal.com", "OK")
Case "mn_aboutrapagui":
moai.DoMethod("app", "aboutrapagui")
EndSwitch
Case "Font":
p_Log(msg.triggervalue)
Case "RGB":
p_Log("Popcolor: " .. HexStr(msg.triggervalue))
EndSwitch
EndSwitch
EndFunction
InstallEventHandler({RapaGUI = EventFunktion})
moai.CreateApp(FileToString("PopGUI3.xml"))
Repeat
CheckEvent()
Forever
Code: Select all
<?xml version="1.0" encoding="iso-8859-1"?>
<application id="app">
<menubar id="menu">
<menu title="_File">
<item id="mn_about">_About...</item>
<item id="mn_aboutrapagui">About Rapa_GUI...</item>
<item/>
<item id="mn_quit">_Quit</item>
</menu>
</menubar>
<window title="Widgets demo" id="window" menubar="menu">
<vgroup>
<vgroup title="Poppers" icon="15">
<colgroup columns="2">
<label>Font</label>
<popfont id ="example" title="Please select a font..." notify="font"/>
<label>Color</label>
<popcolor title="Please select a color..." notify="rgb"/>
</colgroup>
</vgroup>
<vgroup frame="true" frametitle="Event logger">
<listview id="log">
<column/>
</listview>
</vgroup>
<text id="text1">hello</text>
</vgroup>
</window>
</application>
Lars