Wallpaper scripting

Monday, July 25, 2005 by WGoodrick | Discussion: DesktopX

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.
max861126
Reply #1 Friday, July 29, 2005 11:12 AM
it's a good idea but i don't know how do this....
whiterabbit007
Reply #2 Tuesday, August 2, 2005 4:29 PM
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
thomassen
Reply #3 Wednesday, August 3, 2005 3:09 PM
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.

Please login to comment and/or vote for this skin.

Welcome Guest! Please take the time to register with us.
There are many great features available to you once you register, including:

  • Richer content, access to many features that are disabled for guests like commenting on the forums and downloading skins.
  • Access to a great community, with a massive database of many, many areas of interest.
  • Access to contests & subscription offers like exclusive emails.
  • It's simple, and FREE!



web-wc01