XWidgetSoft Forum

XWidget & XLaunchpad , Desktop customization
It is currently 2017年 Jul 21日 18:50

All times are UTC - 8 hours




Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: Creating instances
PostPosted: 2012年 Sep 5日 20:50 
Offline
User avatar

Joined: 2012年 Aug 29日 02:34
Posts: 56
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]);

_________________
Image


Top
 Profile  
 
 Post subject: Re: Creating instances
PostPosted: 2012年 Oct 9日 08:59 
Offline
User avatar

Joined: 2012年 Aug 2日 00:43
Posts: 26
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.

_________________
deviantArt profile

My Widgets:
Game Specials v1.1


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC - 8 hours


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron

Powered by phpBB® Forum Software © phpBB Group