RealyUniqueName / StablexUI

UI engine for Haxe OpenFL designed to give as much freedom as possible in customizing UI
http://ui.stablex.ru/doc
Other
337 stars 80 forks source link

Dynamically created event handlers do not work on C++ platform when Button is not initialized with dimensions #180

Closed dreamycactus closed 9 years ago

dreamycactus commented 9 years ago

Title pretty much contains problem and temporary workaround.

This code

 var b = UIBuilder.create(Button, {
//                    w : 50,
//                    h : 50,
                    text : 'hello',
                    skinName : 'skinName'
                }); 
                b.addEventListener(MouseEvent.CLICK, loadLevel.bind(path) );

Works as expected on Flash platform, as the button is just initialized with some default dimensions. However, on C++, the event does not trigger. As soon as a the dimensions are added, it works. It took me a long time to track down the reason for this...

Just as a side note, onInitialize and onCreate do not affect the problem.

RealyUniqueName commented 9 years ago

What versions of StablexUI, OpenFL, Haxe and hxcpp do you use? I test with lastest versions and everything seems to work fine.

dreamycactus commented 9 years ago

Seems to work on latest for me as well. I'm not able to reproduce using the latest, so that's fine with me.