top of page

Python Tkinter

Public·1 member

Tkinter Frame - Creating Tkinter Parents Frame And its Nested Frame

What is Frame in Tkinter?


The frame is a widget or container which used to handle the tkinter GUI.

Frist, we will create the main frame or parent frame, inside it, we have created nested frames. When we need to devided the window more than two or three parts then we will use the concept of Frame. It makes easy to design the tkinter frame and positioning widgets as per your choice.


Here we will divide the main window into the three parts using frame:


Creating the Main Frame :


Here the syntax to creating the main frame:



frame = tkinter.Frame(root,bg="white")
frame.config()
frame.pack()

After this we will create the nested frame: like left, center, and right


Left Frame:


frameLeft = tkinter.Frame(frame,bg="white")
frameLeft.config()
frameLeft.pack(side=tkinter.LEFT)

Center Frame

 
 frameRight = tkinter.Frame(frame,bg="white") 
 frameRight .config()  
 frameRight .pack(side=tkinter.LEFT)  
 

Right Frame


frameRight = tkinter.Frame(frame,bg="white")
frameRight .config() 
frameRight .pack(side=tkinter.LEFT) 

Now we apply all these frames into Tkinter code:



1536 Views
naveen kumar
naveen kumar
May 25, 2021

Really good blog for tkinter learners

bottom of page