Advertisement
Guest User

Untitled

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