mirror of
https://github.com/python/cpython.git
synced 2025-07-22 18:55:22 +00:00
Added {xview,yview}_{moveto,scroll} to the Canvas class.
This commit is contained in:
parent
423938a852
commit
4eaadf002e
1 changed files with 8 additions and 0 deletions
|
@ -1298,10 +1298,18 @@ class Canvas(Widget):
|
||||||
if not args:
|
if not args:
|
||||||
return self._getdoubles(self.tk.call(self._w, 'xview'))
|
return self._getdoubles(self.tk.call(self._w, 'xview'))
|
||||||
self.tk.call((self._w, 'xview') + args)
|
self.tk.call((self._w, 'xview') + args)
|
||||||
|
def xview_moveto(self, fraction):
|
||||||
|
self.tk.call(self._w, 'xview', 'moveto', fraction)
|
||||||
|
def xview_scroll(self, number, what):
|
||||||
|
self.tk.call(self._w, 'xview', 'scroll', number, what)
|
||||||
def yview(self, *args):
|
def yview(self, *args):
|
||||||
if not args:
|
if not args:
|
||||||
return self._getdoubles(self.tk.call(self._w, 'yview'))
|
return self._getdoubles(self.tk.call(self._w, 'yview'))
|
||||||
self.tk.call((self._w, 'yview') + args)
|
self.tk.call((self._w, 'yview') + args)
|
||||||
|
def yview_moveto(self, fraction):
|
||||||
|
self.tk.call(self._w, 'yview', 'moveto', fraction)
|
||||||
|
def yview_scroll(self, number, what):
|
||||||
|
self.tk.call(self._w, 'yview', 'scroll', number, what)
|
||||||
|
|
||||||
class Checkbutton(Widget):
|
class Checkbutton(Widget):
|
||||||
def __init__(self, master=None, cnf={}, **kw):
|
def __init__(self, master=None, cnf={}, **kw):
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue