[Tutor] Tkinter Grid, Listbox expand
W W
srilyk at gmail.com
Thu Feb 26 20:45:17 CET 2009
Aha! I found the key - I was missing the weight argument:
1 from Tkinter import *
2 import os, shutil, tkFileDialog, tkMessageBox
3
4 class TkSync:
5 def __init__(self, root):
6 self.sbox = Listbox(root)
7 self.sbox.grid(row=0, column=0, sticky=N+S+E+W)
8 root.grid_rowconfigure(0, minsize=400, weight=1)
9 root.grid_columnconfigure(0, minsize=400, weight=1)
10
11 root = Tk()
12 TkSync(root)
13 root.mainloop()
Works perfectly.
-Wayne
--
To be considered stupid and to be told so is more painful than being
called gluttonous, mendacious, violent, lascivious, lazy, cowardly:
every weakness, every vice, has found its defenders, its rhetoric, its
ennoblement and exaltation, but stupidity hasn’t. - Primo Levi
More information about the Tutor
mailing list