Wallpaper scripting

I am VERY new to scripting. In a way, I'd like to not have to learn it because in my current state I have a problem retaining information that is new to me. This is legitimate, and in no way do I simply want to get code for nothing and call it my own or what-have-you. But I am having a problem understanding what would seem to me a simple thing to do because I've seen it in various aspects with widgets or objects.

Please keep in mind I have searched here and various other sites on scripting, and have also read [but possibly not understood] the documentation for DX 3.1

What I would like to do is make my own desktop picture viewer that on a click of the currently displayed image would apply that image as the desktop wallpaper.

I have 'modified' the included 'Silica Picture Frame' so that there is no resize, no color changer, no exit button, no name display etc. Over the past two days I have edited the scripts so that I get no errors in my widget and in fact in works perfectly except I want to add the ability to simply click on the current image to apply it as my desktop.

I have downloaded and looked at [extensively] a couple of wallchangers that do work, but require the drag and drop of files, or making of a list to be read etc. They are just a bit too complex for what I want to do though, or just too flashy as a widget. I like the fact that the Silica viewer can read a dir and simply display the images in sequence. I've also spent some time modifying it to look the way I want it to, so that time invested is kind of important to me ... I just need that one added function to make it perfect.

So, what I'd like to know is, how can I add an onLbuttondown [or right] to the silica script? [either one in the widget] Or, isn't it that simple? The reason I ask with regard to the Silica widget is because it came with DX and I figure anyone who is willing to help would already have that as reference.
2,152 views 3 replies
Reply #2 Top
Not knowing how you modified the silica widget I can't tell you exactly what to write but...

You need to put the Object_OnLButtonDown function inside a script for your "image object", i.e. the one that displays the actual images.

Then (inside that function) use the System.SetWallpaper function.

Details on how to use the setwallpaper function are found here Link, under scripting->reference->system namespace

Hope that helps
Reply #3 Top
A better choice than Object_OnLButtonDown for executing commands is Object_OnLButtonUp. If you look at most other controls that triggers commands it's after the button is released.