I have some really Tcl code which I would like to run in Python:<br><br><span style="font-family: courier new,monospace;">package require Tk</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">package require Tablelist</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">proc main {} {</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">tablelist::tablelist .t -columns {0 Test} -stretch 1</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">.t insert end {{} {}}</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">.t cellconfigure end,0 -window {createWindow}</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">.t insert end {{} {}}</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">.t cellconfigure end,0 -window {createWindow}</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">pack .t -side top -fill both -expand true</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">}</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">proc createWindow {t row col path} {</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">set width [.t columnwidth 0 -total]</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">button $path -width $width</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">}</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">main</span><br><br>This is what I have in Python:<br><br><span style="font-family: courier new,monospace;">from Tkinter import *</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">import tktablelist</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">def createWindow(t,row,col,path):</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> b = Button(path)</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">def main():</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> t = tktablelist.TableList(root,columns = (0,' '))</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> t.insert(END, (None, None))</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> t.cellconfigure("end,0",window=createWindow)</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> t.pack()</span><br>
<span style="font-family: courier new,monospace;">root = Tk()</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">main()</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">root.mainloop()</span><br><br>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?<br>
I am using the Tablelist wrapper from this website: <a href="http://tkinter.unpythonic.net/wiki/TableListWrapper">http://tkinter.unpythonic.net/wiki/TableListWrapper</a><br>