NAME

digit - A Dmhwidget for scoreboard style 4x7 lamp digits

SYNOPSIS

dmhwidgets::digit pathName ?options?

INHERITANCE

itk::Widget <- dmhwidgets::Digit

STANDARD OPTIONS

activebackground activeforeground background cursor disabledforeground font foreground highlightcolor highlightthickness

See the options manual entry for details on the standard options.

WIDGET-SPECIFIC OPTIONS

None

DESCRIPTION

The digit command creates a widget that represents a large digit drawn from an array of 4 x 7 lights, and a new Tcl command whose name is pathname. The command is then used to invoke various methods of the widget. The command has the general form:

pathName option ?arg arg ... arg?

The digit is implemented as a button. The default button action is to invoke the roll method.

The button action can be changed by configuring the -command option of the bdigit component. (For example, pathName component bdigit configure -command newCommand.) The digit depiction is based on displayed characters for the button text. A larger or smaller digit can be obtained by configuring a larger or smaller fixed pitch font for the widget.

WIDGET-SPECIFIC METHODS

pathName roll
Show a random digit from 0 to 9. The return value is the chosen face value.
pathName show N
Display the digit for the value N where 0 <= N <= 10. The value 10 displays a blank face.
pathName value
Return the numeric value corresponding to the displayed face.

EXAMPLE

package require Dmhwidgets

frame .digits -background grey22
pack .digits -expand 1 -fill both
dmhwidgets::digit .digits.d1
dmhwidgets::digit .digits.d2
pack .digits.d1 .digits.d2 -side left -expand 0  -padx 1m -pady 6m

proc digits_show d {
   set d1 [expr int($d/10)]
   set d2 [expr int($d % 10)]
   .digits.d1 show $d1
   .digits.d2 show $d2
   }

digits_show 37

AUTHOR

Hume Integration Software, www.hume.com

KEYWORDS

widget