Guest User

Untitled

a guest
Jul 18th, 2017
199
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.72 KB | None | 0 0
  1. #!/usr/bin/python3
  2.  
  3. import tkinter as tk
  4.  
  5.  
  6. class Top:
  7.     def __init__(self, parent):
  8.         self.parent = parent
  9.         self.widget = tk.Toplevel(self.parent)
  10.  
  11.     def show(self, *args):
  12.         self.widget.wait_window()
  13.  
  14.  
  15. class Frame:
  16.     def __init__(self, parent_obj, expand=1, fill='both', side=None,
  17.                  padx=None, pady=None, ipadx=None, ipady=None):
  18.         self.type = 'Frame'
  19.         self.parent_obj = parent_obj
  20.         self.widget = tk.Frame(self.parent_obj.widget)
  21.         self.widget.pack(expand=expand, fill=fill, side=side,
  22.                          padx=padx, pady=pady, ipadx=ipadx, ipady=ipady)
  23.  
  24.  
  25. root = tk.Tk()
  26. top = Top(root)
  27. frame = Frame(top)
  28. top.show()
  29. root.mainloop()
Add Comment
Please, Sign In to add comment