I’m currently trying to set a background image from a binding (the variably contains the path to the image).

I’m currently trying to set a background image from a binding (the variably contains the path to the image). I created a dummy binding and wrote the following code:

if($albumart!=null && $albumart!=””) item.setBoxBackground(LL.createImage($albumart),”nsf”,true);

But the background was updated only once. It doesn’t change anymore if the variable changes. What am I doing wrong?

]]>

12 Commentsto I’m currently trying to set a background image from a binding (the variably contains the path to the image).

  1. Anonymous says:

    < ![CDATA[

    You have to set first this kind of instruction else you won’t have any refresh


    var unused = $ll_minute;



    It means your bindings will be refreshed /run every minute

    ]]>

  2. Anonymous says:

    < ![CDATA[

    image = LL.createImage($albumart);


    item.setBoxBackground(image,”n”,true);


    return;



    Works

    ]]>

  3. Anonymous says:

    < ![CDATA[

    Bruno-Isa LAMOUR-ARNOULD the operation of loading an image is quite expensive. But I want to load the image instantly if it changes. So I would have to set a very short interval. That doesn’t sound like an acceptable solution.



    username undefined​ this is the same as my script above, it works once, but doesn’t react to changes.

    ]]>

  4. Anonymous says:

    < ![CDATA[

    I am working on a bug where a binding could become inactive when using the script Item.setBinding API. Could it be that somewhere in you setup you call this API ?

    ]]>

  5. Anonymous says:

    < ![CDATA[

    Pierre Hébert no. But I think I found the problem: the path of the file didn’t change, only the content. I added another variable that indicates content change and returned that in the binding.

    ]]>

  6. Anonymous says:

    < ![CDATA[

    Ok, that makes sense

    ]]>

  7. Anonymous says:

    < ![CDATA[

    is it possible to do the same (update an image) for an icon via bindings? and which is more expensive, to update an image for box background or icon (assuming they are the same size)?

    ]]>

  8. Anonymous says:

    < ![CDATA[

    Wern-Yuen Tan yes. I would assume that there is no relevant performance difference.

    ]]>

  9. Anonymous says:

    < ![CDATA[

    Pierre Hébert on a sidenote: I also tried .setImage and it didn’t work at all.

    ]]>

  10. Anonymous says:

    < ![CDATA[

    Lukas Morawietz which “property” binding field would one use to change the icon image? can’t seem to find it … i assume for box background we use the “box” field and just enter the script

    ]]>

  11. Anonymous says:

    < ![CDATA[

    Wern-Yuen Tan I’d use dummy for both

    ]]>

  12. Anonymous says:

    < ![CDATA[

    Lukas Morawietz thanks didn’t realize dummy could be used, never used that before. have been doing this via script triggered by Tasker

    ]]>

Leave a Reply

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