Tkinter Frame

Tkinter Frame widget is used to organize other widgets present in Python GUI. It outlines the frame or structure for a Tkinter window of a fixed size. For better organization of widgets, create Frames within Frames.


The Parameter master represents the parent window and options can be used as key-value pairs separated by commas.

Options of Tkinker Frame:

height: This option shows the vertical dimension of the new frame.

bd: This option shows the size of the border around the indicator. By default it’s 2 pixels.

bg: This option shows the normal background color behind the label.

highlightthickness: This option shows thickness of the focus highlight.

highlightcolor: This shows the color shown in the focus highlight.

relief: This shows the the default value, relief=FLAT.

cursor: This option sets as a cursor name , the mouse cursor will change to the other pattern.

width: This option shows the normal width of the frame.

highlightbackground: This options shows the color of the background color when it is under focus.

from tkinter import *

appWindow = Tk()


frame1 = Frame(appWindow)

Right_Frame = Frame(appWindow)

Left_Frame = Frame(appWindow)

label1 = Label(frame1, text="PYTHON TKINTER FRAMES",bg="orange")

button1 = Button(Right_Frame, text="BUTTON 1")
button1.pack(padx=2, pady=2)
button2 = Button(Left_Frame, text = "BUTTON 2")
button2.pack(padx=2, pady=2)

06 Tkinter Frame

Comments are closed.