- Trending Categories
- Data Structure
- Operating System
- C Programming
- 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 create a resizable Windows without title bar in Tkinter?
To create a tkinter window without title bar, we can use overrideredirect(boolean) property which disables the navigation panel from the top of the tkinter window. However, it doesn’t allow the user to resize the window instantly.
If we are required to create a resizable window without the title bar programmatically, then we can use Sizegrip(parent) widget in Tkinter. The Sizegrip widget adds extendibility to the application that allows users to pull and resize the main window. To work with Sizegrip widget, we have to Bind the mouse buttons and a function that resizes the window whenever we pull the grip.
# Import the required libraries from tkinter import * from tkinter import ttk # Create an instance of tkinter frame or window win=Tk() # Set the size of the window win.geometry("700x350") # Remove the Title bar of the window win.overrideredirect(True) # Define a function for resizing the window def moveMouseButton(e): x1=winfo_pointerx() y1=winfo_pointery() x0=winfo_rootx() y0=winfo_rooty() win.geometry("%s x %s" % ((x1-x0),(y1-y0))) # Add a Label widget label=Label(win,text="Grab the lower-right corner to resize the window") label.pack(side="top", fill="both", expand=True) # Add the gripper for resizing the window grip=ttk.Sizegrip() grip.place(relx=1.0, rely=1.0, anchor="se") grip.lift(label) grip.bind("<B1-Motion>", moveMouseButton) win.mainloop()
If we run the above code, it will display a window without any title bar. We can resize this window by pulling the grip from the lower-right corner.
- How to remove the title bar in a Tkinter window without using overrideredirect() method?
- How to change the title bar in Tkinter?
- How to use Tkinter in python to edit the title bar?
- How to remove the icon from the title bar in Tkinter?
- How to make a Tkinter window not resizable?
- How to create a Dialog Box without a title in Android?
- How to create a download progress bar in Tkinter?
- How do I change the Tkinter default title in the OS bar?
- How to create a Dialog Box without a title in Android using Kotlin?
- How to create JFrame with no border and title bar in Java?
- How to create bar chart using ggplot2 with chart sub-title in R?
- How do I create child windows with Python tkinter?
- How to Change Tkinter Frame Title?
- How to set title for action bar in android?
- How to centre align action bar title in android?