Multiple instances and/or dynamic configurations

0 views
Skip to first unread message

Pär Dahlberg

unread,
Oct 7, 2008, 5:44:09 AM10/7/08
to WidgetFX Developers
I plan to have several devices monitored with my disk space widget.
What would the best scenario be for WidgetFX? To let the user add
several instances of the widget or to configure the widget for several
devices in one instance?

I guess the best would be to be able to do both :)

As it is now I can only add one instance of a widget. But I guess that
most widgets could have a multi instance use. Even the clock if you
could configure the time zone. Is there a plan for this or is it
already possible, but I've missed it?

Then the programming question. I would like to let the user add an
optional number of devices to monitor, but I'm not sure how I would
code that with WidgetFX Configuration. Do you have any idea? I'm going
to let each device have at least path, title, icon, refresh rate and
progress bar warning threashold configurable. I guess it could work
with ...SequenceProperty, but I get the feeling it would be a bit
clumsy.

The widget post for reference:
http://groups.google.com/group/widgetfx-dev/browse_thread/thread/273b747290daa9f6/fb5ee74d31b3e9b0

/Pär

Stephen Chin

unread,
Oct 7, 2008, 12:15:08 PM10/7/08
to widget...@googlegroups.com
Answers below.

By the way, hurry up and fix the links on your blog (index and widget
launch), so I can link to it from the WidgetFX homepage. ;-)

Pär Dahlberg wrote:
> I plan to have several devices monitored with my disk space widget.
> What would the best scenario be for WidgetFX? To let the user add
> several instances of the widget or to configure the widget for several
> devices in one instance?
>
> I guess the best would be to be able to do both :)
>
> As it is now I can only add one instance of a widget. But I guess that
> most widgets could have a multi instance use. Even the clock if you
> could configure the time zone. Is there a plan for this or is it
> already possible, but I've missed it?
>
Right now the framework restricts widgets to a single instance only. I
was thinking about relaxing this restriction (it used to work before),
and I think you've convinced me it is worth doing. Maybe for the
upcoming 0.2 release...
> Then the programming question. I would like to let the user add an
> optional number of devices to monitor, but I'm not sure how I would
> code that with WidgetFX Configuration. Do you have any idea? I'm going
> to let each device have at least path, title, icon, refresh rate and
> progress bar warning threashold configurable. I guess it could work
> with ...SequenceProperty, but I get the feeling it would be a bit
> clumsy.
>
SequencesProperties are the way to go. JavaFX has a nice feature to
allow you to iterate over multiple properties in lock-step, so it might
not be as ugly as you think. (although I am open to suggestions)

Pär Dahlberg

unread,
Oct 7, 2008, 3:52:37 PM10/7/08
to widget...@googlegroups.com
Just fixed the links :)


Answers below.

By the way, hurry up and fix the links on your blog (index and widget
launch), so I can link to it from the WidgetFX homepage.  ;-)

Pär Dahlberg wrote:
> I plan to have several devices monitored with my disk space widget.
> What would the best scenario be for WidgetFX? To let the user add
> several instances of the widget or to configure the widget for several
> devices in one instance?
>
> I guess the best would be to be able to do both :)
>
> As it is now I can only add one instance of a widget. But I guess that
> most widgets could have a multi instance use. Even the clock if you
> could configure the time zone. Is there a plan for this or is it
> already possible, but I've missed it?
>
Right now the framework restricts widgets to a single instance only.  I
was thinking about relaxing this restriction (it used to work before),
and I think you've convinced me it is worth doing.  Maybe for the
upcoming 0.2 release...

Probably a good idea. Perhaps with a build in attribute that will have to be set to true to enable multi instance of the widget.
 
> Then the programming question. I would like to let the user add an
> optional number of devices to monitor, but I'm not sure how I would
> code that with WidgetFX Configuration. Do you have any idea? I'm going
> to let each device have at least path, title, icon, refresh rate and
> progress bar warning threashold configurable. I guess it could work
> with ...SequenceProperty, but I get the feeling it would be a bit
> clumsy.
>
SequencesProperties are the way to go.  JavaFX has a nice feature to
allow you to iterate over multiple properties in lock-step, so it might
not be as ugly as you think.  (although I am open to suggestions)

Hmm... I will have to look into that then.
 

/M v h Pär

Stephen Chin

unread,
Oct 8, 2008, 5:22:14 AM10/8/08
to widget...@googlegroups.com
Awesome!

I've posted a link on the Google Code site:
http://code.google.com/p/widgetfx/

Cheers,
--Steve

Pär Dahlberg

unread,
Oct 8, 2008, 5:37:52 AM10/8/08
to widget...@googlegroups.com
How nice. Even though describing it as "tutorial" might give people false hopes :)

/M v h Pär
Welcome to my blog, mostly about programming: http://www.pmdit.se/blog
Reply all
Reply to author
Forward
0 new messages