Possible bug with Textview's "Append" method

Discuss GUI programming with the RapaGUI plugin here
Post Reply
User avatar
mrupp
Posts: 147
Joined: Sun Jan 31, 2021 7:44 pm
Location: Switzerland
Contact:

Possible bug with Textview's "Append" method

Post by mrupp »

Hi there

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
After appending the strings "text1", "text2" and "text3", on Windows it looks like this, as expected:
Image

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:
Image

Might be a RapaGUI or a MUI bug, I don't know...

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

Re: Possible bug with Textview's "Append" method

Post by airsoftsoftwair »

Looks like a bug. Thanks for reporting!
Post Reply