XWidgetSoft Forum
https://www.bbs.xwidget.com/

BUG: forcing a widget to reload in code
https://www.bbs.xwidget.com/viewtopic.php?f=8&t=3447
Page 1 of 1

Author:  yereverluvinuncleber [ August 6th, 2013, 9:02 am ]
Post subject:  BUG: forcing a widget to reload in code

I have saved a number of settings to a preference.ini file and when the preferences are changed I wish to force the widget to reload (when the save button is pressed) so that the widget will restart with all new settings. So, is it possible to force a restart in code? (not from the menu).

Author:  digigamer [ September 22nd, 2013, 11:06 pm ]
Post subject:  Re: HELP: forcing a widget to reload in code

widget.cmd("!Reload");

Author:  yereverluvinuncleber [ September 23rd, 2013, 11:58 am ]
Post subject:  Re: HELP: forcing a widget to reload in code

Thanks very much, will try and test and report back.

Author:  hamid [ November 25th, 2013, 7:19 am ]
Post subject:  Re: HELP: forcing a widget to reload in code

digigamer wrote:
widget.cmd("!Reload");


there is not any !Reload command in the Autocomplete List.
Also when i use this command i don't see any effect.

am i doing wrong?
or is there another option?

just to note:
i want to Reload one of widget window from the code

Author:  yereverluvinuncleber [ October 12th, 2014, 7:06 am ]
Post subject:  Re: HELP: forcing a widget to reload in code

BUMP

This didn't work for me either.

I need a way to reload a widget from the menu. At the moment I am creating a menu option that calls a routine that runs widget.cmd("!Reload");

It does nothing. Does anyone have a method for reloading a widget from code?

Author:  theyinas [ October 13th, 2014, 1:06 am ]
Post subject:  Re: HELP: forcing a widget to reload in code

PUSH

I would also like to reload the widget from the press of a button.
Currently it seems to me, when the system is put to sleep, after waking up certain information does not refresh.
eg.: weather information (in general), which can't be fixed by "update weather" alone, the widget has to be refreshed

Author:  Jimking [ October 13th, 2014, 6:53 am ]
Post subject:  Re: HELP: forcing a widget to reload in code

Just click everywhere ON the widget and press "F5". Works like the windows refresh.. ;)

Author:  yereverluvinuncleber [ October 13th, 2014, 8:01 am ]
Post subject:  Re: HELP: forcing a widget to reload in code

That's really useful information Jim. Good to know - we must document that somewhere, I am getting more involved in Xwidget now so will try to help there soon.

I do need to be able to do this in code though. All my previous widget engines have a simple "Reload Widget" which exists to sort out widgets that are malfunctioning through getting confused, communication, thread, memory issues all sorted by a 'reload widget'. I reckon the function might be in there somewhere I just don't know whether or where.

Author:  hamid [ October 25th, 2014, 6:38 pm ]
Post subject:  Re: HELP: forcing a widget to reload in code

jimking wrote:
Just click everywhere ON the widget and press "F5". Works like the windows refresh.. ;)

i didn't know this...
it hadn't been pointed anywhere,
thanks

=============
yereverluvinuncleber wrote:
I do need to be able to do this in code though. All my previous widget engines have a simple "Reload Widget" which exists to sort out widgets that are malfunctioning through getting confused, communication, thread, memory issues all sorted by a 'reload widget'. I reckon the function might be in there somewhere I just don't know whether or where.

i don't know if the Reload command going to be available in next version or not...


but as a temporary solution:
you can send keyboard input in code by using ActiveX objects,
so you can send F5 to your widget through code:

example:
Code:
wsc=new ActiveXObject("WScript.Shell")
widget.ForceToFround()
wsc.SendKeys("{f5}")

Comment:
1. 1st line will create activex object
2. 2nd line will make the widget to TopMost and Set Focus to it
3. 3rd line will send F5 key


Note:
make sure you set the focus to your widget before sending key to it (as i have done it in 2nd line),
to prevent sending key incorrectly to other programs

Author:  meme [ October 25th, 2014, 8:30 pm ]
Post subject:  Re: HELP: forcing a widget to reload in code

Thank you hamid and jimking great to know :mrgreen:

Author:  yereverluvinuncleber [ October 26th, 2014, 4:33 am ]
Post subject:  Re: HELP: forcing a widget to reload in code

Thanks for the input everyone.

I have a workaround

Reopening the post as a bug so it can be added to the list.

Page 1 of 1 All times are UTC - 8 hours
Powered by phpBB® Forum Software © phpBB Group
http://www.phpbb.com/