XWidgetSoft Forum

XWidget & XLaunchpad , Desktop customization
It is currently May 10th, 2025, 1:49 pm

All times are UTC - 8 hours




Post new topic Reply to topic  [ 7 posts ] 
Author Message
PostPosted: March 12th, 2016, 7:16 am 
Offline
User avatar

Joined: July 29th, 2013, 9:13 am
Posts: 609
In another engine it is possible to clone/spawn a new instance of a widget in code.

Therefore you can click on a button and create a widget that is a copy of the current widget. This is useful when you want to create something like a drive gauge the first of which is C: and then subsequent instances would monitor D:, E: &c.

I know this is possible from the dashboard but that is a cumbersome method that I want to avoid. Specifically I want to do it in code.

I would like a button that can be clicked to spawn a new instance of the widget. Is this possible? Has anyone down this already?


Last edited by yereverluvinuncleber on March 19th, 2016, 7:19 pm, edited 1 time in total.

Top
 Profile  
 
PostPosted: March 12th, 2016, 9:00 am 
Offline
User avatar

Joined: December 5th, 2012, 5:52 pm
Posts: 4887
I don't know if you mean this, but I can tell 2 ways that are too easy..! :)
1) If you want to create a new clone widget (and make some small changes on the second one) go to the XWidget's folder and simply make a copy of the widget's folder. Then rename the folder like "xxx 2" or whatever. Then open the XWidget dock with the installed widgets, right click - Refresh to appear the new widget. Edit the new one and change the name of the widget (same as the folder)

2) XWidget has default tag code for the right click options to duplicate the running widget. (I use it for the hdd widgets or for the aquarium fishes)

XWidget designer has all lot of ready functions through the tags. I don't understand why you don't want to use them...

_________________
...and remember: don't take life too seriously...
My profile on Deviantart: http://jimking.deviantart.com/


Top
 Profile  
 
PostPosted: March 12th, 2016, 12:37 pm 
Offline
User avatar

Joined: July 29th, 2013, 9:13 am
Posts: 609
No I don't mean that.

I mean I have a running gauge widget. I want to spawn another identical running widget. The same widget running twice, just as in spawning a new process.

I want it done in code, not using the dashboard or the start same widget. I want to be able to call the same function as "start same widget" but on on a button press instead I can create a duplicate widget.


Top
 Profile  
 
PostPosted: March 12th, 2016, 2:12 pm 
Offline
User avatar

Joined: December 5th, 2012, 5:52 pm
Posts: 4887
Quote:
No I don't mean that.

I mean I have a running gauge widget. I want to spawn another identical running widget.

We're saying the same thing man! You need to do what I wrote you (the num.2) and assign the tag for duplicate widget to a "click on" event. This is the tag: !CreateNew
This will give you exactly what you need.. If you want to create a hdd meter, add the right click option or a click on option to "change disk" so the users can put more than one meters on screen for multiple drivers.
ALL THE TAGS/RIGHT CLICK OPTIONS CAN ALSO BE USED FOR CLICK ON EVENTS.

If you want to use a script after all use this:

Code:
function xxxxxxxxxOnClick(Sender)
{
  widget.cmd("!CreateNew");
}

_________________
...and remember: don't take life too seriously...
My profile on Deviantart: http://jimking.deviantart.com/


Top
 Profile  
 
PostPosted: March 13th, 2016, 11:21 am 
Offline
User avatar

Joined: July 29th, 2013, 9:13 am
Posts: 609
THAT is what I wanted. Thankyou very much indeed.

If it works it will be invaluable.


Top
 Profile  
 
PostPosted: March 13th, 2016, 12:37 pm 
Offline
User avatar

Joined: December 5th, 2012, 5:52 pm
Posts: 4887
yereverluvinuncleber wrote:
THAT is what I wanted. Thankyou very much indeed.

If it works it will be invaluable.

I tested and it works :)

_________________
...and remember: don't take life too seriously...
My profile on Deviantart: http://jimking.deviantart.com/


Top
 Profile  
 
PostPosted: March 14th, 2016, 9:31 am 
Offline
User avatar

Joined: July 29th, 2013, 9:13 am
Posts: 609
It works perfectly and is exactly what I wanted.


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

All times are UTC - 8 hours


Who is online

Users browsing this forum: No registered users and 45 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:  

Powered by phpBB® Forum Software © phpBB Group