XWidgetSoft Forum

XWidget & XLaunchpad , Desktop customization
It is currently 2017年 Oct 22日 18:25

All times are UTC - 8 hours




Post new topic Reply to topic  [ 7 posts ] 
Author Message
PostPosted: 2016年 Mar 12日 07:16 
Offline
User avatar

Joined: 2013年 Jul 29日 09:13
Posts: 563
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 2016年 Mar 19日 19:19, edited 1 time in total.

Top
 Profile  
 
PostPosted: 2016年 Mar 12日 09:00 
Offline
User avatar

Joined: 2012年 Dec 5日 17:52
Posts: 4549
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...

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


Top
 Profile  
 
PostPosted: 2016年 Mar 12日 12:37 
Offline
User avatar

Joined: 2013年 Jul 29日 09:13
Posts: 563
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: 2016年 Mar 12日 14:12 
Offline
User avatar

Joined: 2012年 Dec 5日 17:52
Posts: 4549
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");
}

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


Top
 Profile  
 
PostPosted: 2016年 Mar 13日 11:21 
Offline
User avatar

Joined: 2013年 Jul 29日 09:13
Posts: 563
THAT is what I wanted. Thankyou very much indeed.

If it works it will be invaluable.


Top
 Profile  
 
PostPosted: 2016年 Mar 13日 12:37 
Offline
User avatar

Joined: 2012年 Dec 5日 17:52
Posts: 4549
yereverluvinuncleber wrote:
THAT is what I wanted. Thankyou very much indeed.

If it works it will be invaluable.

I tested and it works :)

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


Top
 Profile  
 
PostPosted: 2016年 Mar 14日 09:31 
Offline
User avatar

Joined: 2013年 Jul 29日 09:13
Posts: 563
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 7 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