XWidgetSoft Forum https://www.bbs.xwidget.com/ |
|
Creating instances https://www.bbs.xwidget.com/viewtopic.php?f=10&t=2085 |
Page 1 of 1 |
Author: | vlad [ September 5th, 2012, 8:50 pm ] |
Post subject: | Creating instances |
I want to add a new shortcut dynamically. The question is how to create a new instance of a core or new text and add it to the layer / parent / widget?? like that: Code: //Not working:
shortcutArr[i] = new ShortCutCore(); //Not working: textArr[i] = new Text(); //Set core and position. textArr[i].Core = shortcutArr[i]; textArr[i].Left = i * textArr[i].Width + 20; textArr[i].OnClick = openShortcutOnClick; // How to add child to parent? layerTextContainer.AddObject(textArr[i]); |
Author: | Sooner266 [ October 9th, 2012, 8:59 am ] |
Post subject: | Re: Creating instances |
I found a method in the auto complete that says: class.Create(parent); So I did text1 = Text.Create(widget); Then defined all the attributes a default text object has in the xul file. It seems to work, I can print all the attributes, but it doesn't want to show up in the skin, so there may be something special you have to do, if it's even possible. I'd really like to see this work too, would be very useful. |
Page 1 of 1 | All times are UTC - 8 hours |
Powered by phpBB® Forum Software © phpBB Group http://www.phpbb.com/ |