[Tkinter-discuss] poor-man's table widget

Stewart Midwinter stewart.midwinter at gmail.com
Sat Feb 12 09:41:12 CET 2005

well, I managed to implement a poor-man's table widget -  I used the
multiListbox widget!  Luckily for me, I was interested in editing all
of a record, handily displayed as a row in the widget.  Using the
show() method, I am able to get the index of the selected row. A
gotcha: that index is actually returned  as a tuple! e.g. the 18th row
will yield a return value of (17,).

Having the index of the desired row, it's a simple matter to create a
dialog widget that displays the fields of the desired record, then
simply replace those elements in the lists that have been created for
each column's data.

Finally, after completing an edit of a record, I delete the
multiListbox widget and redraw with the edited lists' contents. 
Easier than figuring out how to implement live updating on a
cell-by-cell basis!

Hope this helps someone.  If I get a chance, I'll post an example in
the next week or two.


Stewart Midwinter
Stewart at Midwinter.ca
sent from my Toshiba e830
Stewart Midwinter
stewart at midwinter.ca
stewart.midwinter at gmail.com

More information about the Tkinter-discuss mailing list