![]() |
Python_2
1.0
|
This most entertaining program was written in Tcl/Tk by Scott Hess (shess). @win terne t.co mMore...
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 |
This most entertaining program was written in Tcl/Tk by Scott Hess (shess). @win terne t.co 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.
def _08b_clock_bezier.buildClock | ( | e | ) |
def _08b_clock_bezier.getTime | ( | ) |
Returns the current time: hours, minutes and seconds.
Referenced by updateClock().
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().
def _08b_clock_bezier.incrType | ( | e | ) |
Goes to the next clock type.
def _08b_clock_bezier.incrWidth | ( | e | ) |
Goes to the next clock width.
def _08b_clock_bezier.main | ( | ) |
Main program.
References buildClock(), stopClock(), and trigger().
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().
def _08b_clock_bezier.stopClock | ( | ) |
Referenced by main().
def _08b_clock_bezier.trigger | ( | ) |
def _08b_clock_bezier.updateClock | ( | ) |
Updates the hands of the clock each second.
References getTime(), and setClock().
_08b_clock_bezier.clock = Canvas() |
bool _08b_clock_bezier.clock_on = True |
_08b_clock_bezier.hand = _hand() |
_08b_clock_bezier.mw = Tk() |
float _08b_clock_bezier.pi180 = pi / 180.0 |
bool _08b_clock_bezier.resize = True |
Referenced by _16_sierpinski_arrowhead.main(), and _16_sierpinski_gasket.main().
list _08b_clock_bezier.types = ["normal", "curve", "angle", "bezier"] |