| Home | Trees | Indices | Help |
|
|---|
|
|
Tkinter.Misc --+
|
Tkinter.BaseWidget --+
|
Tkinter.Pack --+
|
Tkinter.Place --+
|
Tkinter.Grid --+
|
Tkinter.Widget --+
|
Tkinter.Frame --+
|
KeyboardEntry.KeyboardEntry --+
|
Dial
This class implements a Dial widget. The widget has a pointer that can be moved around a circle. The range corresponding to one full turn can be specified as well as the min and max values that are allowed. By defaults these are set to None meaning that there is no min and no max. One turn corresponds to 360 units by default. A dial can also operate in discrete mode (if self.increment is set to x). In this mode the values will be restrained to be multiples of self.increment.
The Widget has a Callback manager. Callback functions get called at every value change if self.contiguous is set to 1, else they get called when the mouse button is released. They always get called with the current value as an argument.
An optional label can be displayed at the center of the Dial widget. The size of the dial has to be specified at instanciation. Other parameters can be set after the widget has been created. The widget tried to adjust automatically the size of the arrow according to the size of the dial.
The widget has a configure() method: type, min, max, increment, precision, showLabel, value, continuous, oneTurn can be set this way.
master, labCfg and size can be passed only to the constructor.
a lock() method is used to disable the various gui components of the options panel. Usage: <instance>.lock(<component>=<value>) components see configure(). value is 0 or 1. 1 disables, 0 enables.
Setting values with increment enabled: if using the method set(), the actual value will 'snap' to the next increment. i.e., if the value is set to 3, and the increment is set to 2, setting the value to 6 will actually result in 7 (3,5,7,9,.....) To still be able to set the value, disregarding the current active increment, the set method understands the optional keyword force=True, i.e. dial.set(<value>, force=True)), which will set the value to <value>. The increment will now be added to this new <value>
|
|||
|
|||
|
__init__(self,
master=None,
type='float',
labCfg={'fg': 'black','side': 'left','text': None},
min=None,
max=None,
increment=.0,
precision=2,
showLabel=1,
value=0.0,
continuous=1,
oneTurn=360.,
size=50,
callback=None,
lockMin=0,
lockBMin=0,
lockMax=0,
lockBMax=0,
lockIncrement=0,
lockBIncrement=0,
lockPrecision=0,
lockShowLabel=0,
lockValue=0,
lockType=0,
lockContinuous=0,
lockOneTurn=0,
**kw) Construct a frame widget with the parent MASTER. |
||
| setFromEntry(self, valueString) | ||
| handleKeyStroke(self, event) | ||
|
setSize(self,
size) Set widget size. |
||
|
setCallback(self,
cb) Set widget callback. |
||
| toggleOptPanel(self, event=None) | ||
| setArrow(self, size=None) | ||
| mouseDown(self, event) | ||
| mouseUp(self, event) | ||
| mouseMove(self, event) | ||
| mouseWheel(self, event) | ||
| get(self) | ||
| printLabel(self) | ||
| set(self, val, update=1, force=0) | ||
| drawArrow(self) | ||
| createCanvas(self, master) | ||
| toggleWidgetLabel(self, val) | ||
| setValue(self, val) | ||
| setLabel(self, labCfg) | ||
|
configure(self,
**kw) Configure resources of a widget. |
||
| setType(self, Type) | ||
| setMin(self, min) | ||
| setMax(self, max) | ||
| setIncrement(self, incr) | ||
| setPrecision(self, val) | ||
|
setContinuous(self,
cont) cont can be None, 0 or 1 |
||
|
setShowLabel(self,
val) Show label can be 0, 1 or 2 0: no label 1: label is always shown 2: show label only when value changes |
||
| setOneTurn(self, oneTurn) | ||
| lockTypeCB(self, mode) | ||
| lockMinCB(self, mode) | ||
| lockBMinCB(self, mode) | ||
| lockMaxCB(self, mode) | ||
| lockBMaxCB(self, mode) | ||
| lockIncrementCB(self, mode) | ||
| lockBIncrementCB(self, mode) | ||
| lockPrecisionCB(self, mode) | ||
| lockShowLabelCB(self, mode) | ||
| lockValueCB(self, mode) | ||
| lockContinuousCB(self, mode) | ||
| lockOneTurnCB(self, mode) | ||
|
Inherited from Inherited from Inherited from Inherited from Inherited from Inherited from Inherited from Inherited from |
|||
|
|||
|
Inherited from Inherited from |
|||
|
|||
Construct a frame widget with the parent MASTER. Valid resource names: background, bd, bg, borderwidth, class, colormap, container, cursor, height, highlightbackground, highlightcolor, highlightthickness, relief, takefocus, visual, width.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Configure resources of a widget. The values for resources are specified as keyword arguments. To get an overview about the allowed keyword arguments call the method keys.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| Home | Trees | Indices | Help |
|
|---|
| Generated by Epydoc 3.0alpha3 on Fri Nov 2 14:06:01 2007 | http://epydoc.sourceforge.net |