Ttk Scale widget is typically used to control the numeric value of a linked variable that varies uniformly over some range.
| 1042 | |
| 1043 | |
| 1044 | class Scale(Widget, tkinter.Scale): |
| 1045 | """Ttk Scale widget is typically used to control the numeric value of |
| 1046 | a linked variable that varies uniformly over some range.""" |
| 1047 | |
| 1048 | def __init__(self, master=None, **kw): |
| 1049 | """Construct a Ttk Scale with parent master. |
| 1050 | |
| 1051 | STANDARD OPTIONS |
| 1052 | |
| 1053 | class, cursor, style, takefocus |
| 1054 | |
| 1055 | WIDGET-SPECIFIC OPTIONS |
| 1056 | |
| 1057 | command, from, length, orient, to, value, variable |
| 1058 | """ |
| 1059 | Widget.__init__(self, master, "ttk::scale", kw) |
| 1060 | |
| 1061 | |
| 1062 | def configure(self, cnf=None, **kw): |
| 1063 | """Modify or query scale options. |
| 1064 | |
| 1065 | Setting a value for any of the "from", "from_" or "to" options |
| 1066 | generates a <<RangeChanged>> event.""" |
| 1067 | retval = Widget.configure(self, cnf, **kw) |
| 1068 | if not isinstance(cnf, (type(None), str)): |
| 1069 | kw.update(cnf) |
| 1070 | if any(['from' in kw, 'from_' in kw, 'to' in kw]): |
| 1071 | self.event_generate('<<RangeChanged>>') |
| 1072 | return retval |
| 1073 | |
| 1074 | |
| 1075 | def get(self, x=None, y=None): |
| 1076 | """Get the current value of the value option, or the value |
| 1077 | corresponding to the coordinates x, y if they are specified. |
| 1078 | |
| 1079 | x and y are pixel coordinates relative to the scale widget |
| 1080 | origin.""" |
| 1081 | return self.tk.call(self._w, 'get', x, y) |
| 1082 | |
| 1083 | |
| 1084 | class Scrollbar(Widget, tkinter.Scrollbar): |
no outgoing calls
no test coverage detected
searching dependent graphs…