Table of Contents
Provides a standard incremental integer entry widget.
The following example sets up a series of GSpinner widgets. Each widget uses handles the data in a different format. The purpose is to illustrate how you can handle the data format for your use of the GSpinner widget.
The above script will generate a window that appears as the figure below,
Example of the GSpinner widget.
class GSpinner([parent, **keywords])
- Arguments:
- parent : Tkinter.Frame
- Parent widget, widget we insert into.
- keywords
- Variable keyword list defined below.
- Keywords:
- min : integer
- Minimum value for the spinner. Default is -sys.MAX_INT.
- max : integer
- Maximum value for the spinner. Default is sys.MAX_INT.
- rtv : IntegerRTV
- Variable to associate with the spinner.
- Signal:
- const.sigON_CHANGE
- Emitted when the contents of the GSpinner object change. Attempts to guarantee that the text value of the entry component is convertable to an integer prior to signal emission.
- Components:
- entry
- GTextEntry component where the user enters the integer.
- uparrow
- GArrow component representing the up arrow in the GSpinner object.
- downarrow
- GArrow component representing the down arrow in the GSpinner object.
Note
If there is a var on this widget, and the var changes its value to a value that lies outside of the range [min, max], the rtv will then get its value clamped.
- clearerror()
- Removes any flagging of an error state for the spinner. If the spinner was not in an error state, then nothing happens.
- destroy()
- Handles the Tkinter de-allocation.
- disable()
- Set the spinner to ignore user events.
- enable()
- Set the spinner to respond to user events.
- flagerror()
- Flags spinner as being in an error state. If the spinner is already in an error state, then nothing happens.
- updatevars()
- Synchronizes the Graphical User Interface (GUI) with the internal variable.