Change the look and feel of the "Clock" widget?

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
Xacto
Posts: 26
Joined: Thu Dec 15, 2016 1:34 am

Change the look and feel of the "Clock" widget?

Post by Xacto » Sat Dec 31, 2016 7:39 pm

Is there a way to change the look and feel of the clock face widget in live code?

bn
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 4172
Joined: Sun Jan 07, 2007 9:12 pm

Re: Change the look and feel of the "Clock" widget?

Post by bn » Sun Jan 01, 2017 3:00 pm

Hi Xacto,

to change the Clock Widget you would have to change the "clock.lcb" file using Livecode Builder language. The look and feel is coded there.

Here is a Livecode Script Clock that may be easier to tweak.

http://forums.livecode.com/viewtopic.ph ... ock#p84736

Kind regards
Bernd

bn
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 4172
Joined: Sun Jan 07, 2007 9:12 pm

Re: Change the look and feel of the "Clock" widget?

Post by bn » Sun Jan 01, 2017 9:38 pm

Hi Xacto,

may be you tell us what you want to change in the clock widget and we can tell you how hard it is to change that.

the Livecode Script Clock I indicated above is also in the sample stacks, it has some more features you can change.

http://livecodeshare.runrev.com/stack/749/Clock

Kind regards
Bernd

Xacto
Posts: 26
Joined: Thu Dec 15, 2016 1:34 am

Re: Change the look and feel of the "Clock" widget?

Post by Xacto » Mon Jan 02, 2017 2:20 am

The stack and code that you provided is exactly what I was looking for. Thank you!!
I will dig in and see if I can make it work.

Cheers. :D

bn
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 4172
Joined: Sun Jan 07, 2007 9:12 pm

Re: Change the look and feel of the "Clock" widget?

Post by bn » Mon Jan 02, 2017 11:30 am

Hi Xacto,

glad it helped. If you get stuck modifying the clock just ask.

here is another clock, a swiss railway clock, technically a little trickier than the other clock.

Kind regards
Bernd
Attachments
railwayclock.livecode.zip
(6.45 KiB) Downloaded 196 times

Xacto
Posts: 26
Joined: Thu Dec 15, 2016 1:34 am

Re: Change the look and feel of the "Clock" widget?

Post by Xacto » Wed Jan 04, 2017 5:53 am

These are perfect - thank you so much for sharing.
Quick question... is there a way to use SVG or PNG's graphics for the hands instead of line graphics?

bn
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 4172
Joined: Sun Jan 07, 2007 9:12 pm

Re: Change the look and feel of the "Clock" widget?

Post by bn » Wed Jan 04, 2017 10:31 am

Quick question... is there a way to use SVG or PNG's graphics for the hands instead of line graphics?
unfortunately not. Livecode script does not know anything about SVG, only Livecode Builder. It would be much easier to do with SVGs and cleaner too. That is the reason for the clock widget to show the power of SVGs.

You could use PNGs but it would not be as smooth as using Livecode Script graphics since PNGs are bitmapped images. Turning bitmapped images at arbitrary degrees leads to artifacts since they have to be recalculated.

Kind regards
Bernd

Post Reply