- Trending Categories
- Data Structure
- Operating System
- C Programming
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
How can I resize the root window in Tkinter?
In this example, we will see how to resize a tkinter window using the geometry manager. Tkinter geometry manager is generally used to configure the width and height of a tkinter window.
The geometry(width, height)method takes width and height as instances and resizes the window accordingly. We can also define the position of the tkinter window by adding geometry(width x height, X, Y) where x and y are horizontal and vertical positions of the window.
#Import tkinter library from tkinter import * from tkinter import ttk #Create an instance of tkinter frame or window win= Tk() #Set the geometry of tkinter frame win.geometry("750x250+400+300") #Create a Label widget label1= Label(win, text="Hello There!", font= ('Courier 20 underline')) label1.pack() win.mainloop()
Now, run the above code to display the dynamically resized tkinter window.
- How do I get rid of the Python Tkinter root window?
- Resize the Tkinter Listbox widget when the window resizes
- How to resize the background image to window size in Tkinter?
- Dynamically Resize Buttons When Resizing a Window using Tkinter
- How can I prevent a window from being resized with Tkinter?
- How do I close a tkinter window?
- How do I handle the window close event in Tkinter?
- How to Resize Browser Window in WebDriver?
- How do I position the buttons on a Tkinter window?
- How do I create a popup window in Tkinter?
- Python Tkinter – How to position a topLevel() widget relative to the root window?
- How can I change root username in MySQL?
- How do I create a popup window using Tkinter?
- How do I set a minimum window size in Tkinter?
- How do I use Window Manager (wm) attributes in Tkinter?