[Python-checkins] r63949 - in sandbox/trunk/ttk-gsoc/src: 2.x/ttk.py 3.x/ttk.py
guilherme.polo
python-checkins at python.org
Wed Jun 4 22:47:51 CEST 2008
Author: guilherme.polo
Date: Wed Jun 4 22:47:51 2008
New Revision: 63949
Log:
Implemented method get for the new Scale widget since Ttk Scale supports optional x and y params and the type conversion done at Tkinter is not needed for Ttk Scale.
Modified:
sandbox/trunk/ttk-gsoc/src/2.x/ttk.py
sandbox/trunk/ttk-gsoc/src/3.x/ttk.py
Modified: sandbox/trunk/ttk-gsoc/src/2.x/ttk.py
==============================================================================
--- sandbox/trunk/ttk-gsoc/src/2.x/ttk.py (original)
+++ sandbox/trunk/ttk-gsoc/src/2.x/ttk.py Wed Jun 4 22:47:51 2008
@@ -1009,6 +1009,15 @@
Widget.__init__(self, master, "ttk::scale", kw)
+ def get(self, x=None, y=None):
+ """Get the current value of the value option, or the value
+ corresponding to the coordinates x, y if they are specified.
+
+ x and y are pixel coordinates relative to the scale widget
+ origin."""
+ return self.tk.call(self._w, 'get', x, y)
+
+
class Scrollbar(Widget, Tkinter.Scrollbar):
"""Ttk Scrollbar controls the viewport of a scrollable widget."""
Modified: sandbox/trunk/ttk-gsoc/src/3.x/ttk.py
==============================================================================
--- sandbox/trunk/ttk-gsoc/src/3.x/ttk.py (original)
+++ sandbox/trunk/ttk-gsoc/src/3.x/ttk.py Wed Jun 4 22:47:51 2008
@@ -1009,6 +1009,15 @@
Widget.__init__(self, master, "ttk::scale", kw)
+ def get(self, x=None, y=None):
+ """Get the current value of the value option, or the value
+ corresponding to the coordinates x, y if they are specified.
+
+ x and y are pixel coordinates relative to the scale widget
+ origin."""
+ return self.tk.call(self._w, 'get', x, y)
+
+
class Scrollbar(Widget, tkinter.Scrollbar):
"""Ttk Scrollbar controls the viewport of a scrollable widget."""
More information about the Python-checkins
mailing list