def xview(self, mode = None, value = None, units = None):
if type(value) == types.StringType:
value = string.atof(value)
if mode is None:
return self._horizScrollbar.get()
elif mode == 'moveto':
frameWidth = self._frame.winfo_reqwidth()
self.startX = value * float(frameWidth)
else: # mode == 'scroll'
clipperWidth = self._clipper.winfo_width()
if units == 'units':
jump = int(clipperWidth * self['horizfraction'])
else:
jump = clipperWidth
self.startX = self.startX + value * jump
self.reposition()
# Called when the user clicks in the vertical scrollbar.
# Calculates new position of frame then calls reposition() to
# update the frame and the scrollbar.
评论列表
文章目录