Tk Tablelist embedded window

- - latias100 at gmail.com
Sat Feb 5 02:56:56 CET 2011


I have some really Tcl code which I would like to run in Python:

package require Tk
package require Tablelist
proc main {} {
tablelist::tablelist .t -columns {0 Test} -stretch 1
.t insert end {{} {}}
.t cellconfigure end,0 -window {createWindow}
.t insert end {{} {}}
.t cellconfigure end,0 -window {createWindow}
pack .t -side top -fill both -expand true
}
proc createWindow {t row col path} {
set width [.t columnwidth 0 -total]
button $path -width $width
}
main

This is what I have in Python:

from Tkinter import *
import tktablelist
def createWindow(t,row,col,path):
    b = Button(path)
def main():
    t = tktablelist.TableList(root,columns = (0,' '))
    t.insert(END, (None, None))
    t.cellconfigure("end,0",window=createWindow)
    t.pack()
root = Tk()
main()
root.mainloop()

I get an error because I don't know how to format the "window" for
createWindow. What should I do to embed the button in the Tablelist?
I am using the Tablelist wrapper from this website:
http://tkinter.unpythonic.net/wiki/TableListWrapper
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20110204/c12f5323/attachment.html>


More information about the Python-list mailing list