Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/python3
- import tkinter as tk
- class Top:
- def __init__(self, parent):
- self.parent = parent
- self.widget = tk.Toplevel(self.parent)
- def show(self, *args):
- self.widget.wait_window()
- class Frame:
- def __init__(self, parent_obj, expand=1, fill='both', side=None,
- padx=None, pady=None, ipadx=None, ipady=None):
- self.type = 'Frame'
- self.parent_obj = parent_obj
- self.widget = tk.Frame(self.parent_obj.widget)
- self.widget.pack(expand=expand, fill=fill, side=side,
- padx=padx, pady=pady, ipadx=ipadx, ipady=ipady)
- root = tk.Tk()
- top = Top(root)
- frame = Frame(top)
- top.show()
- root.mainloop()
Add Comment
Please, Sign In to add comment