Index: Lib/lib-tk/Tkinter.py =================================================================== --- Lib/lib-tk/Tkinter.py (revision 73134) +++ Lib/lib-tk/Tkinter.py (working copy) @@ -2402,21 +2402,26 @@ self.tk.call(self._w, 'selection', 'from', index) select_from = selection_from def selection_present(self): - """Return whether the widget has the selection.""" + """Return True if there are characters selected in the entry, False + otherwise.""" return self.tk.getboolean( - self.tk.call(self._w, 'selection', 'present')) + self.tk.call(self._w, 'selection', 'present')) select_present = selection_present def selection_range(self, start, end): - """Set the selection from START to END (not included).""" + """Set the selection from START to END (the character at END is not + selected).""" self.tk.call(self._w, 'selection', 'range', start, end) select_range = selection_range def selection_to(self, index): """Set the variable end of a selection to INDEX.""" self.tk.call(self._w, 'selection', 'to', index) select_to = selection_to - def xview(self, index): + def xview(self, index=None): """Query and change horizontal position of the view.""" - self.tk.call(self._w, 'xview', index) + if index is None: + return self._getdoubles(self.tk.call(self._w, 'xview')) + else: + self.tk.call(self._w, 'xview', index) def xview_moveto(self, fraction): """Adjust the view in the window so that FRACTION of the total width of the entry is off-screen to the left."""