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

# Set the size of the window

# Remove the Title bar of the window

# Define a function for resizing the window
def moveMouseButton(e):

   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(), rely=1.0, anchor="se")
grip.bind("<B1-Motion>", moveMouseButton)


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.


Published on 18-Jun-2021 13:35:26