0

So how do I make it so before my user enters anything into the text box it has a preview saying "Type your name" or something along those lines? e.g.

userName = Entry(text="Username", font = ('Arial', 15), bg = 'white').place(relx = 0.55, rely = 0.35)
#userName.insert(0, "User name")
password = Entry(text="Password", font = ('Arial', 15), bg = 'white',show = '•').place(relx = 0.55, rely = 0.43)
#password.insert(0, "Password")

1 Answers1

0

Try this:

text = Text(parent, width=40, height=10)
text.insert('1.0', 'here is my text to insert')

For more info see: the tk docs

Rolo
  • 81
  • 2
  • 4
  • thanks but it says nonetype has no attribute insert – Sam Derricott Mar 04 '20 at 18:06
  • Without seeing your code it's very difficult to help. Either edit your question or ask a new one. – Rolo Mar 04 '20 at 18:11
  • ok edited the question – Sam Derricott Mar 04 '20 at 18:13
  • Inserting first and placing second will probably do the trick. – Rolo Mar 04 '20 at 18:24
  • but how do i make it so when they start typing it goes away, also for the password thing i want it to not show what they type so insert doesnt really work for that – Sam Derricott Mar 04 '20 at 18:33
  • For your first question take a look at the question linked by jasonharper in his comment to your question, especially the last answer by Daniyal Ahmad. For the password thing to work a simple Google search gave me [this](https://stackoverflow.com/questions/2416486/how-to-create-a-password-entry-field-using-tkinter), look for Brōtsyorfuzthrāx's answer. – Rolo Mar 04 '20 at 18:51