0

Writing my Second tkinter project, I faced a problem.

The problem is: I need to make some unclearable text in the field(like you can't clear it with backspace). Is there any way to do it?

P. S. Don't suggest using Labels, I need unclearable text for TextField

Delta888
  • 84
  • 6
  • 1
    Tkinter doesn't have a "Text Field". Are you referring to a `Text` widget, or an `Entry` widget? Does this answer your question? https://stackoverflow.com/a/11180132/7432 – Bryan Oakley Jul 25 '20 at 15:24
  • I mean ScrolledText/Text – Delta888 Jul 25 '20 at 15:33
  • i think what your looking for is called a placeholder and tkinter does not have a placeholder by default, tho u could make them, like @BryanOakley showed – Delrius Euphoria Jul 25 '20 at 17:11
  • 1
    @CoolCloud: I don't think they are asking about a placeholder. I think they just want a region of text that can't be deleted. Placeholder text is "deleted" (goes away) when you click in an entry field. – Bryan Oakley Jul 25 '20 at 17:28
  • @BryanOakley exactly, i mean a region of text that can't be deleted – Delta888 Jul 26 '20 at 07:23

1 Answers1

0

You can create a textbox and make its state disabled.

tb1 = Text(root, state = "disabled")

Now you won't be able to edit the text inside the textbox.

HSB
  • 70
  • 8