N
N
NightCAT_Busya2021-04-21 17:22:20
Python
NightCAT_Busya, 2021-04-21 17:22:20

How to make text placeholder in text python tkitner?

Let's say that we have a text input field and we need to make a placeholder text (what is displayed in the input field when there is no entered text, for example, when we enter into the Google search engine, there is a placeholder text: "Enter a search term in Google or provide a URL".) I mean the same thing that placeholder does in html, only in python.
How can we do it?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
B
Bogdan, 2021-04-21
@NightCAT_Busya

import tkinter as tk
root = tk.Tk()
root.geometry("200x100")

textExample = tk.Entry(root)
textExample.insert(0, "Default Text")
textExample.pack()

Y
Yupiter7575, 2021-04-21
@yupiter7575

I understand that your Google is broken? found on the first link

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question