Pmw.TimeCounter

Name

Pmw.TimeCounter() -

Inherits

Pmw.MegaWidget

Description

Options

Options for this megawidget and its base classes are described below.

autorepeat
Initialisation option. The default is 1.

buttonaspect
Initialisation option. The default is 1.0.

initwait
Initialisation option. The default is 300.

labelmargin
Initialisation option. If the labelpos option is not None, this specifies the distance between the label component and the rest of the megawidget. The default is 0.

labelpos
Initialisation option. Specifies where to place the label component. If not None, it should be a concatenation of one or two of the letters 'n', 's', 'e' and 'w'. The first letter specifies on which side of the megawidget to place the label. If a second letter is specified, it indicates where on that side to place the label. For example, if labelpos is 'w', the label is placed in the center of the left hand side; if it is 'wn', the label is placed at the top of the left hand side; if it is 'ws', the label is placed at the bottom of the left hand side.

If None, a label component is not created. The default is None.

max
The default is ''.

min
The default is ''.

padx
Initialisation option. The default is 0.

pady
Initialisation option. The default is 0.

repeatrate
Initialisation option. The default is 50.

value
Initialisation option. The default is ''.

Components

Components created by this megawidget and its base classes are described below.

downhourarrow
By default, this component is a Tkinter.Canvas. Its component group is Arrow.

downminutearrow
By default, this component is a Tkinter.Canvas. Its component group is Arrow.

downsecondarrow
By default, this component is a Tkinter.Canvas. Its component group is Arrow.

frame
By default, this component is a Tkinter.Frame.

hourentryfield
By default, this component is a Pmw.EntryField.

hull
This acts as the body for the entire megawidget. Other components are created as children of the hull to further specialise the widget. By default, this component is a Tkinter.Frame.

label
If the labelpos option is not None, this component is created as a text label for the megawidget. See the labelpos option for details. Note that to set, for example, the text option of the label, you need to use the label_text component option. By default, this component is a Tkinter.Label.

minuteentryfield
By default, this component is a Pmw.EntryField.

secondentryfield
By default, this component is a Pmw.EntryField.

uphourarrow
By default, this component is a Tkinter.Canvas. Its component group is Arrow.

upminutearrow
By default, this component is a Tkinter.Canvas. Its component group is Arrow.

upsecondarrow
By default, this component is a Tkinter.Canvas. Its component group is Arrow.

Component aliases

Sub-components of components of this megawidget may be accessed via the following aliases.

hourentry
Alias for hourentryfield_entry.
minuteentry
Alias for minuteentryfield_entry.
secondentry
Alias for secondentryfield_entry.

Methods

Only methods specific to this megawidget are described below. For a description of its inherited methods, see the manuals for its base classes.

decrement()

getint()

getstring()

increment()

invoke()

Example

The image at the top of this manual is a snapshot of the window (or part of the window) produced by the following code.

class Demo:
    def __init__(self, parent):
        self._time = Pmw.TimeCounter(parent,
                labelpos = 'w',
                label_text = 'HH:MM:SS',
                min = '00:00:00',
                max = '23:59:59')
        self._time.pack(padx=10, pady=5)

        button = Tkinter.Button(parent, text = 'Show', command = self.show)
        button.pack()

    def show(self):
        stringVal = self._time.getstring()
        intVal =  self._time.getint()
        print stringVal + '  (' + str(intVal) + ')'

Home. Pmw 0.8.5 Maintainer gregm@iname.com. 9 Feb 2001