Sunday, February 7, 2021

Frame Widget

frame.py


from tkinter import *

#from PIL import ImageTk,Image


root = Tk()

#root.iconbitmap('@miscA38.xbm')


frame = LabelFrame(root, text='My Frame', padx=50, pady=50)

frame.pack(padx=10,pady=10)


frame2 = Frame(root, padx=50, pady=50,bg="red")

frame2.pack(padx=10,pady=10)


b1 = Button(frame, text="Hi there")

b2 = Button(frame, text="Hi there")

b1.grid(row=0,column=0)

b2.grid(row=1,column=1)


b3 = Button(frame2, text="Hi there")

b4 = Button(frame2, text="Hi there")

b3.grid(row=0,column=0)

b4.grid(row=1,column=1)


root.mainloop()


No comments:

Post a Comment