tkinter entry eat chars?

P

phil

In a Tkinter entry field (or Pmw entry)
how could I eat charactres?

Say a certain char is keyed in. Say &
I notice in the event handler for <key>.
I don't want any more charactres to display or
be in the field until I handle a see, in the
event handler, another character. Say ?

Can the event handler somehow destroy the char?

Thanks
 
H

Harlin Seritt

You can use the textvariable option for the Entry widget. Set a bind event
for this widget that when any key pressed the StringVar() will be polled via
StringVar().get(). You do some checking for certain chars you don't want
entered and then delete them as they occur.

Harlin
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,767
Messages
2,569,570
Members
45,045
Latest member
DRCM

Latest Threads

Top