Possible bug: dynamic buttons with "hide" attribute

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: dynamic buttons with "hide" attribute

Post 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
User avatar
airsoftsoftwair
Posts: 5433
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

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

Post 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 ;)
Post Reply