Page 1 of 1

Possible bug: dynamic buttons with "hide" attribute

Posted: Fri Jan 14, 2022 11:33 am
by mrupp
Hi there

Found a bug, probably wxWidget related. The following example dynamically creates buttons with every 2nd button having the "hide" attribute set:

Code: Select all

@REQUIRE "RapaGUI", {Link = True}
@APPTITLE "DynamicButtons-Test"

Function p_Init()
	moai.DoMethod("mainGroup", "initChange")
	Local hide = False
	For Local i = 1 To 10
		Local id$ = "btn" .. i
		moai.CreateObject(FormatStr([[<button id="%s" %s>Dynamic button %s</button>]], id$, IIf(hide, [[hide="true"]], ""), i), "mainWindow")
		moai.DoMethod("mainGroup", "append", id$)

		hide = Not hide
	Next
	moai.DoMethod("mainGroup", "exitChange")
EndFunction

moai.CreateApp([[<?xml version="1.0" encoding="iso-8859-1"?>
<application id="app">
	<window id="mainWindow" width="300" title="DynamicButtons-Test">
		<vgroup id="mainGroup">
			<button id="btn0">Static button</button>
		</vgroup>
	</window>
</application>]])

p_Init()

Repeat
	 WaitEvent
Forever
Now, with MUI, everything works as expected, even with the old MUI 3.8, but on Windows and macOS, the hidden buttons are visible:

Image Image

Image Image

Please note the different spaces between the buttons, these only appear when using "hide", without it all spaces are correct.

Cheers and a happy New Year to all of you,
Michael

Re: Possible bug: dynamic buttons with "hide" attribute

Posted: Sat Jan 15, 2022 7:24 pm
by airsoftsoftwair
I haven't examined it yet but this is likely to be a RapaGUI bug, not a wxWidgets one. So it's very likely to get fixed ;)