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