How to create a frame inside a frame tkinter? Last Updated : 21 Jun, 2021 Comments Improve Suggest changes Like Article Like Report Prerequisite: Tkinter It is very easy to create a basic frame using Tkinter, this article focuses on how another frame can be created within it. To create a basic frame the name of the parent window is given as the first parameter to the frame() function. Therefore, to add another frame within this frame, just the name of the first frame needs to given to the second frame as the parent window. Optional values such as frame padding are give relative to the parent window. We can add multiple frames in this fashion using the same approach, by making the previous frame the parent of the current frame. Approach: Create Normal Tkinter WindowCreate first frame normallyCreate second frameTake the first window as its parent windowExecute code frame() is an inbuilt Tkinter method which helps realize our required functionality. Syntax: frame(master) Parameter: master: parent windowhighlightcolor: To set the color of the focus highlight when widget has to be focused.bd: to set the border width in pixels.bg: to set the normal background color.cursor: to set the cursor used.width: to set the width of the widget.height: to set the height of the widget. Program: Python3 # Import Module from tkinter import * # Create Tkinter Object root = Tk() # Set Geometry root.geometry("400x400") # Frame 1 frame1 = Frame(root,bg="black",width=500,height=300) frame1.pack() # Frame 2 frame2 = Frame(frame1,bg="white",width=100,height=100) frame2.pack(pady=20,padx=20) # Execute Tkinter root.mainloop() Output: Comment More infoAdvertise with us Next Article Create Multiple frames with Grid manager using Tkinter abhigoya Follow Improve Article Tags : Python Python-tkinter Practice Tags : python Similar Reads What are Widgets in Tkinter? Tkinter is Python's standard GUI (Graphical User Interface) package. tkinter we can use to build out interfaces - such as buttons, menus, interfaces, and various kind of entry fields and display areas. We call these elements Widgets.What are Widgets in Tkinter?In Tkinter, a widget is essentially a g 3 min read Tkinter Button WidgetPython Tkinter - Create Button WidgetThe Tkinter Button widget is a graphical control element used in Python's Tkinter library to create clickable buttons in a graphical user interface (GUI). It provides a way for users to trigger actions or events when clicked.Note: For more reference, you can read our article:What is WidgetsPython Tk 6 min read How to check which Button was clicked in Tkinter ?Are you using various buttons in your app, and you are being confused about which button is being pressed? Don't know how to get rid of this solution!! Don't worry, just go through the article. In this article, we will explain in detail the procedure to know which button was pressed in Tkinter.Steps 2 min read Looping through buttons in TkinterIn this article, letâs see how we can loop through the buttons in Tkinter. Stepwise implementation: Step 1: Import the Tkinter package and all of its modules and create a root window (root = Tk()). Python3 # Import package and it's modules from tkinter import * # create root window root = Tk() # roo 2 min read How to move a Tkinter button?Prerequisite: Creating a button in tkinter Tkinter is the most commonly used library for developing GUI (Graphical User Interface) in Python. It is a standard Python interface to the Tk GUI toolkit shipped with Python. As Tk and Tkinter are available on most of the Unix platforms as well as on the W 4 min read On/Off Toggle Button Switch in TkinterPrerequisite: Tkinter Python offers multiple options for developing a GUI (Graphical User Interface). Out of all the GUI methods, Tkinter is the most commonly used method. It is a standard Python interface to the Tk GUI toolkit shipped with Python. Python with Tkinter is the fastest and easiest way 2 min read How to place a button at any position in Tkinter?Prerequisite: Creating a button in Tkinter Tkinter is the most commonly used library for developing GUI (Graphical User Interface) in Python. It is a standard Python interface to the Tk GUI toolkit shipped with Python. Python offers multiple options for developing a GUI (Graphical User Interface). O 2 min read How To Dynamically Resize Button Text in Tkinter?Prerequisite: Python GUI â tkinter, Dynamically Resize Buttons When Resizing a Window using Tkinter In this article, we will see how to make the button text size dynamic. Dynamic means whenever button size will change, the button text size will also change. In Tkinter there is no in-built function, 3 min read How to Use Bitmap images in Button in Tkinter?Prerequisite: Python GUI â tkinter Python offers multiple options for developing GUI (Graphical User Interface). Out of all the GUI methods, tkinter is the most commonly used method. It is a standard Python interface to the Tk GUI toolkit shipped with Python. A bitmap is an array of binary data repr 2 min read How do you create a Button on a tkinter Canvas?In this article, we will see how to create a button on a Tkinter Canvas. The Canvas widget display various graphics on the application. It can be used to draw simple shapes to complicated graphs. We can also display various kinds of custom widgets according to our needs.  It is used trigger any func 1 min read How to Bind Multiple Commands to Tkinter Button?The button widget in Tkinter provides a way to interact with the application. The user presses a button to perform certain actions that are attached to that button. In general, we user provides a single action to a button but what if the user wants to attach more than one action to a button. In this 4 min read How to add a border color to a button in Tkinter?In this article, we will learn how to add border color to a button in Tkinter. In the first example, we are using the frame widget to add border color to a button in frame by highlighting the border with black color and a thickness of 2. Example 1: Using Frame widget to add border color to a button. 2 min read Change color of button in Python - TkinterIn this article, we are going to write a Python script to change the color of the button in Tkinter. It can be done with two methods:Using bg properties.Using activebackground properties.Prerequisite: Creating a button in tkinter, Python GUI â Tkinter Change the color of the button in Python - Tkint 1 min read How to make Rounded buttons in TkinterTkinter is a Python module that is used to create GUI (Graphical User Interface) applications with the help of a variety of widgets and functions. Like any other GUI module, it also supports images i.e you can use images in the application to make it more attractive. In this article, we will discuss 2 min read How to Close a Tkinter Window With a Button?Prerequisites: Tkinter Python's Tkinter module offers the Button function to create a button in a Tkinter Window to execute any task once the button is clicked. The task can be assigned in the command parameter of Button() function. Given below are various methods by which this can be achieved. Meth 3 min read How to Change Tkinter Button State?Tkinter is a Python Package for creating GUI applications. Python has a lot of GUI frameworks, but Tkinter is the only framework thatâs built into the Python standard library. Tkinter has several strengths; itâs cross-platform, so the same code works on Windows, macOS, and Linux. Tkinter is lightwei 4 min read How to Pass Arguments to Tkinter Button Command?When a user hits the button on the Tkinter Button widget, the command option is activated. In some situations, it's necessary to supply parameters to the connected command function. In this case, the procedures for both approaches are identical; the only thing that has to vary is the order in which 2 min read Tkinter - Button that changes its properties on hoverPython offers multiple options for developing GUI (Graphical User Interface). Out of all the GUI methods, tkinter is the most commonly used method. It is a standard Python interface to the Tk GUI toolkit shipped with Python. Python with tkinter is the fastest and easiest way to create GUI applicatio 2 min read Dynamically Resize Buttons When Resizing a Window using TkinterPrerequisite: Python GUI â tkinter Button size is static, which means the size of a button cannot be changed once it is defined by the user. The problem here is while resizing the window size, it can affect the button size problem. So the solution here is, make a dynamic button, which means the butt 2 min read Open a New Window with a Button in Python - TkinterTkinter is the most commonly used GUI (Graphical User Interface) library in Python. It is simple, easy to learn and comes built-in with Python. The name "Tkinter" comes from the tk interface, which is the underlying toolkit it uses.To create multiple windows in a Tkinter application, we use the Topl 3 min read Python | Add image on a Tkinter buttonTkinter is a Python module which is used to create GUI (Graphical User Interface) applications with the help of varieties of widgets and functions. Like any other GUI module it also supports images i.e you can use images in the application to make it more attractive. Image can be added with the help 3 min read Python | Add style to tkinter buttonTkinter is a Python standard library that is used to create GUI (Graphical User Interface) applications. It is one of the most commonly used packages of Python. Tkinter supports both traditional and modern graphics support with the help of Tk themed widgets. All the widgets that Tkinter also has ava 4 min read Label WidgetPython Tkinter - LabelTkinter Label is a widget that is used to implement display boxes where you can place text or images. The text displayed by this widget can be changed by the developer at any time you want. It is also used to perform tasks such as underlining the part of the text and spanning the text across multipl 4 min read How to Change the Tkinter Label Font Size?In Tkinter, labels are used to display text but adjusting their font size can improve readability or match a specific design. Tkinter offers multiple ways to modify a labelâs font size. Letâs explore different methods to achieve this.Using tkFont.Font()tkinter.font.Font() class allows you to define 3 min read How to Get the Tkinter Label Text?Prerequisite: Python GUI â Tkinter Python offers multiple options for developing a GUI (Graphical User Interface). Out of all the GUI methods, tkinter is the most commonly used method. It is a standard Python interface to the Tk GUI toolkit shipped with Python. Python with tkinter is the fastest and 2 min read How to Set Border of Tkinter Label Widget?The task here is to draft a python program using Tkinter module to set borders of a label widget. A Tkinter label Widget is an Area that displays text or images. We can update this text at any point in time. ApproachImport moduleCreate a windowSet a label widget with required attributes for borderP 2 min read How to change the Tkinter label text?Prerequisites: Introduction to tkinter Tkinter is a standard GUI (Graphical user interface) package for python. It provides a fast and easy way of creating a GUI application. To create a tkinter application: Importing the module â tkinterCreate the main window (container)Add any number of widgets to 3 min read Add Shadow in Tkinter Label in PythonTkinter is the standard GUI library for Python and is included with most Python installations. It provides a number of widgets and tools for creating graphical user interfaces (GUIs) in Python. One of the most common widgets in Tkinter is the Label widget, which is used to display text and images. I 4 min read Setting the position of TKinter labelsTkinter is the standard GUI library for Python. Tkinter in Python comes with a lot of good widgets. Widgets are standard GUI elements, and the Label will also come under these WidgetsNote: For more information, refer to Python GUI â tkinter Label: Tkinter Label is a widget that is used to implement 2 min read Python Tkinter | Create LabelFrame and add widgets to itTkinter is a Python module which is used to create GUI (Graphical User Interface) applications. It is a widely used module which comes along with the Python. It consists of various types of widgets which can be used to make GUI more user-friendly and attractive as well as functionality can be increa 2 min read How to remove text from a label in Python?Prerequisite: Python GUI â tkinter In this article, the Task is to remove the text from label, once text is initialized in Tkinter. Python offers multiple options for developing GUI (Graphical User Interface) out of which Tkinter is the most preferred means. It is a standard Python interface to the 1 min read Entry WidgetPython Tkinter - Entry WidgetPython offers multiple options for developing a GUI (Graphical User Interface). Out of all the GUI methods, Tkinter is the most commonly used method. Python with Tkinter is the fastest and easiest way to create GUI applications. Creating a GUI using Tkinter is an easy task.In Python3 Tkinter is come 5 min read How to create a multiline entry with Tkinter?Tkinter is a library in Python for developing GUI. It provides various widgets for developing GUI(Graphical User Interface). The Entry widget in tkinter helps to take user input, but it collects the input limited to a single line of text. Therefore, to create a Multiline entry text in tkinter there 3 min read How to Use Entry Box on Canvas - TkinterThere are various ways of creating GUI applications in Python. One of the easiest and most commonly used ways is through the use of the Tkinter module. Tkinter offers various widgets for creating web apps.  One such widget is the Entry box, which is used to display a single line of text. Are you fac 5 min read How to resize an Entry Box by height in Tkinter?In this article, we shall look at how can one resize the height of an Entry Box in Python Tkinter. An Entry Widget is a widget using which a user can enter text, it is similar to HTML forms. In Tkinter, the Entry widget is a commonly used Text widget, using which we can perform set() and get() meth 3 min read How to Set the Default Text of Tkinter Entry Widget?The Tkinter Entry widget is a simple input field in Python that lets users type or edit text. By default, it starts empty unless given an initial value. Adding default text improves user experience by acting as a hint, pre-filling known details and reducing repetitive typing in forms. Let's explore 2 min read Tkinter - Read only Entry WidgetPython has a number of frameworks to develop GUI applications like PyQT, Kivy, Jython, WxPython, PyGUI, and Tkinter. Python tkinter module offers a variety of options to develop GUI based applications. Tkinter is an open-source and available under Python license. Tkinter provides the simplest and fa 4 min read Python Tkinter - Validating Entry WidgetPython offers a variety of frameworks to work with GUI applications. Tkinter or Tk interface is one of the most widely used Python interface to build GUI based applications. There are applications that require validation of text fields to prevent invalid input from the user before the form is submit 5 min read Change the position of cursor in Tkinter's Entry widgetA widget in tkinter, which is used to enter a display a single line of text is called an entry widget. Have you created an entry widget in tkinter which contains a lot of information? Is a lot of text causing an issue to you to move at any other position in it? Don't worry, we have a solution to thi 3 min read Tkinter | Adding style to the input text using ttk.Entry widgetTkinter is a GUI (Graphical User Interface) module which is widely used to create GUI applications. It comes along with the Python itself. Entry widgets are used to get the entry from the user. It can be created as follows- entry = ttk.Entry(master, option = value, ...) Code #1: Creating Entry widge 3 min read Frame WidgetPython Tkinter - Frame WidgetPython offers multiple options for developing GUI (Graphical User Interface). Out of all the GUI methods, Tkinter is the most commonly used method. It is a standard Python interface to the Tk GUI toolkit shipped with Python. Python with Tkinter is the fastest and easiest way to create GUI applicatio 3 min read How to create a frame inside a frame tkinter?Prerequisite: Tkinter It is very easy to create a basic frame using Tkinter, this article focuses on how another frame can be created within it. To create a basic frame the name of the parent window is given as the first parameter to the frame() function. Therefore, to add another frame within this 2 min read Create Multiple frames with Grid manager using TkinterPrerequisites: Tkinter Tkinter can support the creation of more than one widget in the same frame. Not just this it also supports a mechanism to align them relative to each other. One of the easiest ways of aligning the different widgets in the Tkinter is through grid manager. Apart from aligning va 2 min read Python Tkinter - Frameless windowPrerequisite: Python GUI â tkinter Python offers multiple options for developing GUI (Graphical User Interface). Out of all the GUI methods, tkinter is the most commonly used method. It is a standard Python interface to the Tk GUI toolkit shipped with Python. To create a Frameless window, we will us 1 min read Tkinter Application to Switch Between Different Page FramesPrerequisites: Python GUI â tkinter Sometimes it happens that we need to create an application with several pops up dialog boxes, i.e Page Frames. Here is a step by step process to create multiple Tkinter Page Frames and link them! This can be used as a boilerplate for more complex python GUI applic 6 min read Scrollable Frames in TkinterA scrollbar is a widget that is useful to scroll the text in another widget. For example, the text in Text, Canvas Frame or Listbox can be scrolled from top to bottom or left to right using scrollbars. There are two types of scrollbars. They are horizontal and vertical. The horizontal scrollbar is u 3 min read How to Change Tkinter LableFrame Border Color?LableFrame in Tkinter is the widget that creates the rectangular area which contains other widgets. In this article, we are going to see how we can change the border of the label frame. But for achieving the color, we need to go through the theme for Tkinter, hence we use ttk module for the same whi 3 min read RadioButton WidgetRadioButton in Tkinter | PythonThe Radiobutton is a standard Tkinter widget used to implement one-of-many selections. Radiobuttons can contain text or images, and you can associate a Python function or method with each button. When the button is pressed, Tkinter automatically calls that function or method.Syntax:  button = Radio 4 min read CheckButton WidgetPython Tkinter - Checkbutton WidgetThe Checkbutton widget is a standard Tkinter widget that is used to implement on/off selections. Checkbuttons can contain text or images. When the button is pressed, Tkinter calls that function or method. Note: For more reference, you can read our article, What is WidgetsPython Tkinter OverviewPytho 5 min read Python | Tkinter ttk.Checkbutton and comparison with simple CheckbuttonTkinter is a GUI (Graphical User Interface) module which comes along with the Python itself. This module is widely used to create GUI applications. tkinter.ttk is used to create the GUI applications with the effects of modern graphics which cannot be achieved using only tkinter. Checkbutton is used 2 min read Python | How to dynamically change text of CheckbuttonTkinter is a GUI (Graphical User interface) module which is used to create various types of applications. It comes along with the Python and consists of various types of widgets which can be used to make GUI more attractive and user-friendly. Checkbutton is one of the widgets which is used to select 2 min read ListBox WidgetPython Tkinter - ListBox WidgetTkinter is a GUI toolkit used in python to make user-friendly GUIs.Tkinter is the most commonly used and the most basic GUI framework available in python. Tkinter uses an object-oriented approach to make GUIs. Note: For more information, refer to Python GUI â tkinter ListBox widget The ListBox widg 2 min read How to remove multiple selected items in listbox in Tkinter?Prerequisite: Tkinter, Listbox in Tkinter Python offers multiple options for developing GUI (Graphical User Interface). Out of all the GUI methods, Tkinter is the most commonly used method. It is a standard Python interface to the Tk GUI toolkit shipped with Python. Python with Tkinter is the fastes 2 min read Binding Function with double click with Tkinter ListBoxPrerequisites: Python GUI â tkinter, Python | Binding function in Tkinter Tkinter in Python is GUI (Graphical User Interface) module which is widely used for creating desktop applications. It provides various basic widgets to build a GUI program. To bind Double click with Listbox we use Binding func 1 min read Scrollable ListBox in Python-tkinterTkinter is the standard GUI library for Python. Tkinter in Python comes with a lot of good widgets. Widgets are standard GUI elements, and the Listbox, Scrollbar will also come under this Widgets. Note: For more information, refer to Python GUI â tkinter Listbox The ListBox widget is used to display 2 min read How to get selected value from listbox in tkinter?Prerequisites: Tkinter, Listbox ListBox is one of the many useful widgets provided by Tkinter for GUI development. The Listbox widget is used to display a list of items from which a user can select one or more items according to the constraints. In this article, we'll see how we can get the selected 2 min read ScrollBar WidgetPython-Tkinter ScrollbarPython offers multiple options for developing a GUI (Graphical User Interface). Out of all the GUI methods, Tkinter is the most commonly used method. It is a standard Python interface to the Tk GUI toolkit shipped with Python. Python with Tkinter is the fastest and easiest way to create GUI applicat 3 min read How to make a proper double scrollbar frame in TkinterTkinter is a Python binding to the Tk GUI(Graphical User Interface) Toolkit. It is a thin-object oriented layer on top of Tcl/Tk. When combined with Python, it helps create fast and efficient GUI applications. Note: For more information refer, Python GUI-tkinter Steps to Create a double scrollbar fr 3 min read Autohiding Scrollbars using Python-tkinterBefore moving on to the topic lets see what is Python Tkinter. So, we all know that Python has different options for creating GUI(s) and tkinter is one of them. It is the standard GUI library for Python. And it makes the creation of GUI applications very quick still simple when python is merged with 3 min read Menu WidgetPython | Menu widget in TkinterTkinter is Pythonâs standard GUI (Graphical User Interface) package. It is one of the most commonly used package for GUI applications which comes with the Python itself. Menus are the important part of any GUI. A common use of menus is to provide convenient access to various operations such as savin 2 min read Tkinter - OptionMenu WidgetPrerequisite: Python GUI -tkinter One of the most popular Python modules to build GUI(Graphical User Interface) based applications is the Tkinter module. It comes with a lot of functionalities like buttons, text-boxes, labels to be used in the GUI application, these are called widgets. In this artic 2 min read GUI Billing System and Menu Card Using PythonSo imagine that we're starting a new restaurant or being appointed as one of the employees in a restaurant company, and we find out that there's no fast method of doing the billing of customers, and it usually takes times for us to calculate the amount that a customer has to pay. This can be really 7 min read Right Click menu using TkinterPython 3.x comes bundled with the Tkinter module that is useful for making GUI based applications. Of all the other frameworks supported by Python Tkinter is the simplest and fastest. Tkinter offers a plethora of widgets that can be used to build GUI applications along with the main event loop that 5 min read Popup Menu in TkinterTkinter is Pythonâs standard GUI (Graphical User Interface) package. It is one of the most commonly used packages for GUI applications which comes with the Python itself. Note: For more information, refer to Python GUI â tkinter Menu Widget Menus are an important part of any GUI. A common use of men 2 min read How to change background color of Tkinter OptionMenu widget?Prerequisites: Tkinter While creating GUI applications, there occur various instances in which you need to make selections among various options available. For making such choices, the Option Menu widget was introduced. In this article, we will be discussing the procedure of changing menu background 2 min read What does the 'tearoff' attribute do in a Tkinter Menu?Prerequisite: Python GUI â tkinterMenus Python offers multiple options for developing GUI (Graphical User Interface). Out of all the GUI methods, tkinter is the most commonly used method. It is a standard Python interface to the Tk GUI toolkit shipped with Python. Python with tkinter is the fastest 2 min read How to activate Tkinter menu and toolbar with keyboard shortcut or binding?You might have seen the menubar and toolbar in the various desktop apps, which are opened through shortcut keys. Donât you know how to create such a menubar and toolbar which gets opened through a shortcut key? Have a read at the article and get to know the procedure to do the same. For activating 3 min read Changing the colour of Tkinter Menu BarPrerequisites: Tkinter Menus are an important part of any GUI. A common use of menus is to provide convenient access to various operations such as saving or opening a file, quitting a program, or manipulating data. Toplevel menus are displayed just under the title bar of the root or any other toplev 2 min read How to create Option Menu in Tkinter ?The Tkinter package is the standard GUI (Graphical user interface) for python, which provides a powerful interface  for the Tk GUI Toolkit. In this tutorial, we are expecting that the readers are aware of the concepts of python and tkinter module. OptionMenu In this tutorial, our main focus is to cr 3 min read Like