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

how change widget position (x,y) by code?
https://bbs.xwidget.com/viewtopic.php?f=8&t=3622
Page 1 of 1

Author:  Armando [ October 9th, 2013, 2:01 pm ]
Post subject:  how change widget position (x,y) by code?

Hi, I want to change the position of a widget to certain x and y coordinates. How can I do this by code?
Thanks!

Author:  meme [ October 9th, 2013, 6:15 pm ]
Post subject:  Re: how change widget position (x,y) by code?

This may help... not exactly what you asked, it starts a widget and positions it in the center of the screen.

// start the widget remotely from the main widget
var winX = (ScreenWidth - 480) / 2; // 480 is the width of the widget
var winY = (ScreenHeight - 720) / 2; // 720 is the height of the widget
startupWidget("YearCalendar",winX,winY); // start and position the widget

Author:  Armando [ October 10th, 2013, 5:46 am ]
Post subject:  Re: how change widget position (x,y) by code?

I found a easiest way:

widget.top = 350;
widget.Left = 30;

Yes... so easy :)
Thanks anyway!

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