Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class TkRoot(tk.Tk):
- def __init__(self):
- tk.Tk.__init__(self)
- main_window = MainWindow.create(parent=self)
- main_window.grid()
- class MainWindow(tk.Frame):
- @staticmethod
- def create(parent, num_rows=10, num_columns=10):
- window = MainWindow(parent)
- for rows in range(num_rows):
- return window.grid_rowconfigure(rows, weight=1)
- for cols in range(num_columns):
- return window.grid_columnconfigure(cols, weight=1)
- def __init__(self, parent):
- tk.Frame.__init__(self, parent=None)
- self.parent = parent
- def make_widgets(self):
- for n in range(10):
- lbl = tk.Label(parent=self, text="wat")
- lbl.grid(row=lambda r=n: r, column=lambda c=n:c, sticky='')
Add Comment
Please, Sign In to add comment