What you see in the pic is not a widget. It is a fully scripted canvas.

What you see in the pic is not a widget. It is a fully scripted canvas.

In this ‘WIP’, it only updates when the refresh-button is pushed.

What would be the smartest way to make it update automatically? (Battery wise)

]]>

12 Commentsto What you see in the pic is not a widget. It is a fully scripted canvas.

  1. Anonymous says:

    < ![CDATA[

    Use setTimeout once from the load event event of the container.


    A period of 1 second should not be too noticeable, 1 minute is really invisible.


    Having to set the timer in the container prevents this widget from being autonomous, but I hope it will be possible to “package” scripts in the future.


    Maybe try to Paint.setStrokeCap(Paint.Cap.Round), it will avoid sharp edges at the needle ends.

    ]]>

  2. Anonymous says:

    < ![CDATA[

    setTimeout-script on the load of the panel, I’ll try. Thanks!


    The edges in the centre, i covered with a little circle. 😉

    ]]>

  3. Anonymous says:

    < ![CDATA[

    Pierre Hébert after a few hours of trail and error, i’m lost. The clock is a panel with label “LLA”.


    The script got to it by:


    var widget = LL.getEvent().getItem().getParent().getItemByLabel(“LLA”);



    Do I need the load-event of the panel-LLA or from the panel containing this panel?


    And how do I address it?


    So I can do:


    widget.setBoxBackground(img, “ns”);

    ]]>

  4. Anonymous says:

    < ![CDATA[

    This must be done in the container of the item. I would suggest to use a dummy shortcut instead of a panel if possible (cheaper, needs less resources).


    In the load event of the container you can do something like this:



    var PERIOD = 1000; // ms


    var ITEM = “LLA”



    var widget = LL.getEvent().getItem().getParent().getItemByLabel(ITEM);



    var update = function() {


       // update the image here


      var img =


      widget.setBoxBackground(img, “ns”);



      // set the timer again


      setTimeout(update, PERIOD);


    }



    // initiate the periodic update


    update();

    ]]>

  5. Anonymous says:

    < ![CDATA[

    I would suggest to use the load event of your desktop. 

    ]]>

  6. Anonymous says:

    < ![CDATA[

    On load LL.getEvent().getItem() is null. 🙁

    ]]>

  7. Anonymous says:

    < ![CDATA[

    LL.getEvent().getContainer().getItemByLabel(“LLA”)

    ]]>

  8. Anonymous says:

    < ![CDATA[

    Lukas Morawietz that does indeed not throw an exception. But my next statement widget. getWidth does 🙁

    ]]>

  9. Anonymous says:

    < ![CDATA[

    In which load event did you set it?


    In how many panels is the clock?


    My line should work, if you have it in the load event of the desktop and the clock (the panel) is directly on the desktop 

    ]]>

  10. Anonymous says:

    < ![CDATA[

    1 panel-LLA in a panel-X of my current desktop. On the load event of panel-X I set the script.

    ]]>

  11. Anonymous says:

    < ![CDATA[

    As proof of concept i wil add a fresh desktop and try.

    ]]>

  12. Anonymous says:

    < ![CDATA[

    I think the script needs some kind of delay. It works from context-menu

    ]]>

Leave a Reply

Your email address will not be published. Required fields are marked *