diff options
author | Fredrik Lundh <fredrik@pythonware.com> | 2000-08-09 18:29:51 (GMT) |
---|---|---|
committer | Fredrik Lundh <fredrik@pythonware.com> | 2000-08-09 18:29:51 (GMT) |
commit | 5bd2cd663dad454da19f66ccde3ac6a3ee8aa6a6 (patch) | |
tree | 0632d49570db32961a66800e85eba52086f99248 /Lib/lib-tk | |
parent | 06d281535043f2e4f9a213ec3568408526464961 (diff) | |
download | cpython-5bd2cd663dad454da19f66ccde3ac6a3ee8aa6a6.zip cpython-5bd2cd663dad454da19f66ccde3ac6a3ee8aa6a6.tar.gz cpython-5bd2cd663dad454da19f66ccde3ac6a3ee8aa6a6.tar.bz2 |
-- added xview_moveto, xview_scroll, yview_moveto, yview_scroll
to the Text method (closes Bug #110605)
Diffstat (limited to 'Lib/lib-tk')
-rw-r--r-- | Lib/lib-tk/Tkinter.py | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/Lib/lib-tk/Tkinter.py b/Lib/lib-tk/Tkinter.py index 3743e7f..4f8e479 100644 --- a/Lib/lib-tk/Tkinter.py +++ b/Lib/lib-tk/Tkinter.py @@ -2830,11 +2830,27 @@ class Text(Widget): if not what: return self._getdoubles(self.tk.call(self._w, 'xview')) self.tk.call((self._w, 'xview') + what) - def yview(self, *what): + def xview_moveto(self, fraction): + """Adjusts the view in the window so that FRACTION of the + total width of the canvas is off-screen to the left.""" + self.tk.call(self._w, 'xview', 'moveto', fraction) + def xview_scroll(self, number, what): + """Shift the x-view according to NUMBER which is measured + in "units" or "pages" (WHAT).""" + self.tk.call(self._w, 'xview', 'scroll', number, what) + def yview(self, *args): """Query and change vertical position of the view.""" - if not what: + if not args: return self._getdoubles(self.tk.call(self._w, 'yview')) - self.tk.call((self._w, 'yview') + what) + self.tk.call((self._w, 'yview') + args) + def yview_moveto(self, fraction): + """Adjusts the view in the window so that FRACTION of the + total height of the canvas is off-screen to the top.""" + self.tk.call(self._w, 'yview', 'moveto', fraction) + def yview_scroll(self, number, what): + """Shift the y-view according to NUMBER which is measured + in "units" or "pages" (WHAT).""" + self.tk.call(self._w, 'yview', 'scroll', number, what) def yview_pickplace(self, *what): """Obsolete function, use see.""" self.tk.call((self._w, 'yview', '-pickplace') + what) |