Can't Get A Selection from Tktable...

jerry.levan at gmail.com jerry.levan at gmail.com
Tue Jul 11 14:48:42 EDT 2006


Hi,
I have a Tktable object (self.table) and when I click on a row the
whole row is selected.

If I click of a button to get the row contents then

self.table.curselection() fails with a traceback of:

Traceback (most recent call last):
  File
"/Library/Frameworks/Python.framework/Versions/2.4//lib/python2.4/lib-tk/Tkinter.py",
line 1345, in __call__
    return self.func(*args)
  File "/Users/jerry/python/PyPgExplorerUni/Resources/editor.py", line
159, in deleteRow
    print self.table.curselection()
  File
"/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/Tktable.py",
line 139, in curselection
    return self._getCells(self.tk.call(self._w, 'curselection'))
  File
"/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/Tktable.py",
line 106, in _getCells
    for i in string.split(cellString):
  File
"/Library/Frameworks/Python.framework/Versions/2.4//lib/python2.4/string.py",
line 292, in split
    return s.split(sep, maxsplit)
AttributeError: 'tuple' object has no attribute 'split'

It is my reading that curselection will return the indices of the
selected cells...

Help,

Jerry




More information about the Python-list mailing list