Advertisement
here2share

# Tk_center_frame_in_frame.py

Jun 5th, 2018
231
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.29 KB | None | 0 0
  1. # Tk_center_frame_in_frame.py
  2.  
  3. from Tkinter import *
  4.  
  5. root=Tk()
  6. f1 = Frame(width=200, height=200, background="red")
  7. f2 = Frame(width=100, height=100, background="blue")
  8.  
  9. f1.pack(fill="both", expand=True, padx=20, pady=20)
  10. f2.place(in_=f1, anchor="c", relx=.5, rely=.5)
  11.  
  12. root.mainloop()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement