Tkinter Question

Marko Balabanovic (marko@CS.Stanford.EDU)
16 Feb 1995 02:00:54 GMT

I seem to have come across an anomaly, which is probably because I am using a
weird version of something.

In my TK (which I think is 3.6) the Entry class has a 'view' method. However, in
Tkinter.py this is defined as select_view, which doesn't work. You need this to
link a scrollbar to an entry widget.

Here is the error:

TclError: bad select option "view": must be adjust, clear, from, or to
> /usr/home/marko/lib/python/tkinter/Tkinter.py(931)select_view
-> self.tk.call(self._w, 'select', 'view', index)

The fix is fairly simple, but I was wondering if this was a bug or just because I
need a newer Tk.

Fix:

from Tkinter import *
class MyEntry(Entry):
def __init__(self, master=None, cnf={}):
Entry.__init__(self, master, cnf)
def view(self,index):
self.tk.call(self._w, 'view', index)

I am using the beta version of Python 1.2.

Marko

--------------------------------------------------------------------------
Marko Balabanovic Email: marko@CS.Stanford.EDU
Department of Computer Science, Stanford University, Stanford CA 94305 USA
Office: Laurel 103 Phone: (415) 725 8783 Fax: (415) 725 1449
URL: http://robotics.stanford.edu/people/marko/marko.html
--------------------------------------------------------------------------