Multiple Clock faces?

Monday, January 15, 2007 by jolhof | Discussion: Widget talk

Hi, I'm pretty new at creating gadgets for DesktopX and I need some help. I have created a basic analog clock. I would like to be able to have multiple clock faces and change them by a simple click on the clock. Is this possible, and if so, how or what do I do, besides have multiple clock faces ofcourse

Thanks
Vad_M
Reply #1 Tuesday, January 16, 2007 11:57 AM
It's very easy.

1. You may create a several skins for your clock. For example: skin1.png, skin2.png, skin3.png etc...
2. Then you need add a "states" into clock background object which corresponding to these skins. For example: skin1, skin2, skin3 etc...
3. After that you can use a simple code like this:

Dim num, total

Sub Object_OnScriptEnter
num = 1
total = 10 '<== or any other number (this is a total amount of your skins)
End Sub

Sub Object_OnStateChange(state)
If state = "Command executed" Then
desktopx.object("My Clock").state = "skin"&num
If num < total Then num = num + 1 Else num = 1
End If
End Sub

The clock faces will be changing step by step when you click on it.

Have a nice days with DesktopX.
jolhof
Reply #2 Wednesday, January 17, 2007 1:24 PM
Great Thanks for the response Vad_M,

Right now I have it with a right click menu, but I really would like to do it as I had planned and the way you discribed. Now lets see if I can do this
jolhof
Reply #3 Wednesday, January 17, 2007 7:23 PM
Got it working. Thanks Vad_M.
Bichur
Reply #4 Wednesday, January 17, 2007 8:14 PM
Cool info

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