Guest User

Untitled

a guest
Jan 16th, 2019
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.77 KB | None | 0 0
  1. class TkRoot(tk.Tk):
  2. def __init__(self):
  3. tk.Tk.__init__(self)
  4. main_window = MainWindow.create(parent=self)
  5. main_window.grid()
  6.  
  7. class MainWindow(tk.Frame):
  8. @staticmethod
  9. def create(parent, num_rows=10, num_columns=10):
  10. window = MainWindow(parent)
  11. for rows in range(num_rows):
  12. return window.grid_rowconfigure(rows, weight=1)
  13. for cols in range(num_columns):
  14. return window.grid_columnconfigure(cols, weight=1)
  15.  
  16. def __init__(self, parent):
  17. tk.Frame.__init__(self, parent=None)
  18. self.parent = parent
  19.  
  20. def make_widgets(self):
  21. for n in range(10):
  22. lbl = tk.Label(parent=self, text="wat")
  23. lbl.grid(row=lambda r=n: r, column=lambda c=n:c, sticky='')
Add Comment
Please, Sign In to add comment