I think I found a bug concerning the "Append" method on a textview widget. Please check out the following example:
Code: Select all
@REQUIRE "RapaGUI", {Link = True}
@APPTITLE "Textview-Append-Test"
Function p_EventFunc(msg)
Switch msg.id
Case "btnAppend":
Local text = moai.Get("ctrlInput", "text")
If moai.Get("ctrlAddline", "selected") Then text = text .. "\n"
moai.DoMethod("ctrlTextview", "append", text)
Case "btnClear":
moai.Set("ctrlTextview", "text", "")
EndSwitch
EndFunction
moai.CreateApp([[<?xml version="1.0" encoding="iso-8859-1"?>
<application id="app">
<window id="mainWindow" width="400" height="300" title="Textview-Append-Test">
<vgroup id="mainGroup">
<textentry id="ctrlInput">test</textentry>
<hgroup>
<checkbox id="ctrlAddline" selected="true">Add linebreak</checkbox>
<rectangle />
</hgroup>
<button id="btnAppend">Append</button>
<textview id="ctrlTextview" />
<button id="btnClear">Clear</button>
</vgroup>
</window>
</application>]])
InstallEventHandler({RapaGUI = p_EventFunc})
Repeat
WaitEvent
Forever
On OS4 with MUI 5.0 (20210831), though, not only the text from the textentry is appended but also the existing text, too, so it looks like this:
Might be a RapaGUI or a MUI bug, I don't know...
Cheers,
Michael