2

I'm making a program but I can't write things inside the entry box of ttk. The windows digital keyboard doesn't pop out and either so I can't copy/paste things inside it. can someone help fixing this?

# Definindo Valores iniciais
    i_nome = tk.StringVar()
    i_nome.set("Correia cap")
    i_max = tk.StringVar()
    i_max.set(15)
    i_min = tk.StringVar()
    i_min.set(3)
    i_exist = tk.StringVar()
    i_exist.set(10)
    i_pi = tk.StringVar()
    i_pi.set(190001234)

    e_nome = tk.Entry(windowpct, state='normal', textvariable=i_nome)
    e_qtd_max = tk.Entry(windowpct, state='normal', textvariable=i_max)
    e_qtd_min = tk.Entry(windowpct, state='normal', textvariable=i_min)
    e_qtd_exist = tk.Entry(windowpct, state='normal', textvariable=i_exist)
    e_pi = tk.Entry(windowpct, state='normal', textvariable=i_pi)

it doesn't read the initial values as well...

Xiddoc
  • 3,369
  • 3
  • 11
  • 37
Sir Eiras
  • 21
  • 1
  • When using `tk.Entry` this code works with all messages visible but use `ttk.Entry` and it doesn't! However if I place it into a class (prepending self. to all objects), it works!! I'm still looking for a reason. – Derek Jan 05 '23 at 09:12

1 Answers1

1

You are going to need use insert to add text initially into the Entry try this:

e_qtd_min.insert(0,“The text you want”)

I’m not sure how it would work with a StrVar. But this might work:

e_qtd_min.insert(0,variable name)

I’m sorry but I cannot try as I am on a phone.

NejoFS
  • 100
  • 8