Tkinter Entry – Disable

Tkinter – Clear/Delete value in the Entry field

In Tkinter, you can disable an Entry widget so that user cannot enter a value in the Entry field.

Tkinter Entry - Disable
Tkinter Entry disabled

To disable an Entry widget in Tkinter, call the configure() method on the Entry object and pass the value of “disabled” for state parameter, as shown in the following.



  • entry is our Entry widget that needs to be disabled.

In this tutorial, you will learn how to disable an Entry widget in Tkinter, with examples.


1. Disable Entry field

In this example, we create a basic Tk window with an Entry widget and button. By default the Entry widget is enabled. If user clicks on the Disable button, in the event handler function disable_entry(), we disable the Entry widget.

Python Program

import tkinter as tk

# Create the main window
window = tk.Tk()

label = tk.Label(window, text="Enter input value")

# Function to disbale the Entry field
def disable_entry():

# Create an Entry field
entry = tk.Entry(window)

# Create a button
button = tk.Button(window, text="Disable", command=disable_entry)

# Run the application


In Windows

In MacOS

Run the program. The Entry field is normal by default.

Disable Entry in Tkinter - Example

Click on the Disable button.

Tkinter Entry disabled
Tkinter Entry disabled

The Entry widget is disabled.


In this Python Tkinter tutorial, we have shown how to disable an Entry field in Tkinter, with examples.

Related Tutorials

Code copied to clipboard successfully 👍