- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- 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 to set a Tkinter window to a constant size?
Whenever we run our tkinter application, it displays a window of certain size (i.e., width and height of the window). In order to set the window size constant or non-resizable, we will use the resizable() method.
Generally, the method takes two values, i.e., the width and height of the window. In order to make the window size constant, we can assign NULL or Zero to both width and height in the function parameters.
Example
#Import the tkinter library from tkinter import * #Create an instance of tkinter frame win = Tk() #Set the geometry win.geometry("650x350") #Make Constant size Window win.resizable(False, False) #Create a Label Label(win, text= "Hello!", font= ('Helvetica bold', 15)).pack(pady= 20) win.mainloop()
Output
Running the above code will display a constant size window.
- Related Articles
- How to Set a Tkinter Window with a Constant Size?
- How do I set a minimum window size in Tkinter?
- How to set a widget's size in Tkinter?
- How to resize the background image to window size in Tkinter?
- How to add a margin to a tkinter window?
- How to set the position of a Tkinter window without setting the dimensions?
- How to set the font size of a Tkinter Canvas text item?
- How to make a Tkinter window not resizable?
- How to delete Tkinter widgets from a window?
- How to set padding of all widgets inside a window or frame in Tkinter?
- Tkinter-How to get the current date to display in a tkinter window?
- How to close a Tkinter window by pressing a Button?
- How to make a Tkinter window jump to the front?
- How to bind the Enter key to a tkinter window?
- How to specify where a Tkinter window should open?

Advertisements