tkinter entry eat chars?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • phil

    #1

    tkinter entry eat chars?

    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

  • Harlin Seritt

    #2
    Re: tkinter entry eat chars?

    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

    "phil" <phillip.watts@ anvilcom.com> wrote in message
    news:mailman.33 06.1109866451.2 2381.python-list@python.org ...[color=blue]
    > 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
    >[/color]


    Comment

    Working...