Numeric Thumb Nails. Numeric thumb nails are a pair of up- and down-buttons. A comb-widget of num consisting of numeric thumb nails, an entry, a label and a checkbutton is used to input numbers. A user can input a number by either typing it into the entry, or by pressing one of the thumb buttons. The label and checkbutton are options that can be specified in the widget creation. EXAMPLE: The following example creates a frm widget and then adds a num widget into it. The num widget is configured with a format string of %.2f to accept float numbers of two decimals and a checkbutton for an additional status of the input data. Finally, the num widget is bound to a script that prints out the value of the entry sub-widget when button of either up- or down- thum is released or <Return> of the entry is pressed. catch "destroy .num" CLASS NAME: num COMB-WIDGET OPTIONS -ent options It specifies options for a sub-widget of Entry to accept input form the keyboard. A presss of <Return> will complete the input. -up options It specifies options for a sub-widget of Button. Pressing this button increases the number in the entry. Releasing this button triggers any scripts that are bound to the <Return> event of the -ent. -down options It specifies options for a sub-widget of Button. Pressing this button decreases the number in the entry. Releasing this button triggers any scripts that are bound to the <Enter> event of the -ent. -label options It specifies option for a sub-widget of Label. It displays a text label at the left side of the entry. This sub-widget is optional. It is only created when the option is specified during the widget creation. -max maximum It specifies the maximun value allowed for the num widget. -min minimum It specifies the minimun value allowed for the num widget. -init initialValue It specifies the initial value of the entry in a num widget creation. -inc increment It specifies the increment when the up-thumb button is pressed. -dec decrement It specifies the decrement when the down-thumb button is pressed. -chck options It specifies an optional checkbutton that can be bound to scripts for further control of a num widget. -fmt format It specifies a format string used in displaying the content of the entry and accepting numbers of different types such as integer and float numbers.WIDGET API num.bind pathname event scripts -varName. This command binds the event of the sub-widget referred to by the -varName to the scripts. The pathname must refer to a num widget. If the event is not specified, the current event that was bound to the sub-widget is returned. If the scripts is not specified, the current scripts bound to the event is returned. The scripts may be appended to the current ones if "+scripts" is specified instead of "scripts". If the -varName is not specified, the command bindpathname event scripts is invoked. num.bindChange pathname scripts. This command binds any events that may change the number of the num widget to the scripts. These events include <Return> of the entry referred to by the -ent, <ButtonPress-1> of the up- and down- thumb buttons referred to by the -up and -down. num.cget pathname -varName. This command retrieves the value of the -varName for an num widget. The pathname must refer to a num widget. The available -varNames are: -ent, -up, -down, -label, -max, -min, -inc, and -dec. num.config pathname ?options?. This command configures options of a num widget referred to by the pathname. If the ?options? is not specified, a list of the num widget configuration is returned. Each element of the list is a list that provides information of a configurable option. The first element of a configurable option list is always the -varName. The rest of the contents depend on what the -varName refers to. If the -varName refers to a regular variable, the second element that is also the last element is the value for that variable. If the -varName refers to a sub-widget, the second element is the pathname of the sub-widget, the third is the class name, and the fourth that is also the last is the options used in previous widget creation or configuraiton. num.create pathname ?options?. This command creates a num widget with the given options. If the num widget is successfully created, the pathname is returned. Otherwise, an empty string is returned. The available options for an num.create command are: -ent, -up, -down, -label, -max, -min, -inc, -dec, and -init. num.get pathname. This command retrieves the number of a num widget. num.set pathname number. This command sets the entry of a num widget with a value number.RELATED PROCEDURES The followings are procedures used in a num widget implementation and test. A user may access to these procedures through the num widget API, and should never use these procedures directly in an application program. num.down pathname |