XWidgetSoft Forum

XWidget & XLaunchpad , Desktop customization
It is currently May 8th, 2025, 3:09 pm

All times are UTC - 8 hours




Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: Creating instances
PostPosted: September 5th, 2012, 8:50 pm 
Offline
User avatar

Joined: August 29th, 2012, 2:34 am
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: October 9th, 2012, 8:59 am 
Offline
User avatar

Joined: August 2nd, 2012, 12:43 am
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 40 guests


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