Python_2  1.0
Classes | Functions | Variables
_08b_clock_bezier Namespace Reference

This most entertaining program was written in Tcl/Tk by Scott Hess (shess.nosp@m.@win.nosp@m.terne.nosp@m.t.co.nosp@m.m). More...

Classes

class  _hand
 Holds clock handles shape and size. More...
 
class  makeThread
 Creates a new thread. More...
 

Functions

def buildClock (e)
 
def hands (aa)
 
def incrType (e)
 
def incrWidth (e)
 
def setClock (hour, minute, second)
 
def getTime ()
 
def updateClock ()
 
def stopClock ()
 
def trigger ()
 Creates a thread for the clock. More...
 
def main ()
 

Variables

list types = ["normal", "curve", "angle", "bezier"]
 
float pi180 = pi / 180.0
 
bool resize = True
 
 mw = Tk()
 
 clock = Canvas()
 
 hand = _hand()
 
bool clock_on = True
 

Detailed Description

This most entertaining program was written in Tcl/Tk by Scott Hess (shess.nosp@m.@win.nosp@m.terne.nosp@m.t.co.nosp@m.m).

It's a clock that uses a bezier curve anchored at four points - the hour position, the minute position, the second position and the center of the clock - to show the time.

Mouse <Button-1> switches between display modes, and mouse <Button-2> switches between line thicknesses.

This program needs a tcl compiled with threads enabled, or alternatively, to replace Tkinter for mtTkinter.

Author
Paulo Roma
Since
2009/08/06
See also
http://www.tcl.tk/software/plugin/bclock.html

Function Documentation

◆ buildClock()

def _08b_clock_bezier.buildClock (   e)
Build the clock. Puts tickmarks every 30 degrees, tagged
   "ticks", and prefills the "hands" line.

References hands().

Referenced by main().

◆ getTime()

def _08b_clock_bezier.getTime ( )
Returns the current time: hours, minutes and seconds.

Referenced by updateClock().

◆ hands()

def _08b_clock_bezier.hands (   aa)
Calculate the set of points for the current hand type and
   the angles in the passed array.

Referenced by buildClock(), and setClock().

◆ incrType()

def _08b_clock_bezier.incrType (   e)
Goes to the next clock type.

◆ incrWidth()

def _08b_clock_bezier.incrWidth (   e)
Goes to the next clock width.

◆ main()

def _08b_clock_bezier.main ( )
Main program.

References buildClock(), stopClock(), and trigger().

◆ setClock()

def _08b_clock_bezier.setClock (   hour,
  minute,
  second 
)
Calculate the angles for the second, minute, and hour hands,
   and then update the clock hands to match.

References hands().

Referenced by updateClock().

◆ stopClock()

def _08b_clock_bezier.stopClock ( )

Referenced by main().

◆ trigger()

def _08b_clock_bezier.trigger ( )

Creates a thread for the clock.

Creates a thread for the clock.

Referenced by main().

◆ updateClock()

def _08b_clock_bezier.updateClock ( )
Updates the hands of the clock each second.

References getTime(), and setClock().

Variable Documentation

◆ clock

_08b_clock_bezier.clock = Canvas()

◆ clock_on

bool _08b_clock_bezier.clock_on = True

◆ hand

_08b_clock_bezier.hand = _hand()

◆ mw

_08b_clock_bezier.mw = Tk()

◆ pi180

float _08b_clock_bezier.pi180 = pi / 180.0

◆ resize

bool _08b_clock_bezier.resize = True

◆ types

list _08b_clock_bezier.types = ["normal", "curve", "angle", "bezier"]