tkinter entry eat chars?

Discussion in 'Python' started by phil, Mar 2, 2005.

  1. phil

    phil Guest

    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
    phil, Mar 2, 2005
    #1
    1. Advertising

  2. 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" <> wrote in message
    news:...
    > 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, Mar 5, 2005
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Martijn Mulder

    does GC eat my JMenu?

    Martijn Mulder, Dec 16, 2005, in forum: Java
    Replies:
    3
    Views:
    396
    Roedy Green
    Dec 17, 2005
  2. Harald Massa

    Python can't eat little calf

    Harald Massa, Jul 5, 2004, in forum: Python
    Replies:
    0
    Views:
    329
    Harald Massa
    Jul 5, 2004
  3. walterbyrd
    Replies:
    31
    Views:
    734
    Michael
    Nov 17, 2006
  4. Kosio

    Floats to chars and chars to floats

    Kosio, Sep 16, 2005, in forum: C Programming
    Replies:
    44
    Views:
    1,241
    Tim Rentsch
    Sep 23, 2005
  5. Hongyu
    Replies:
    9
    Views:
    882
    James Kanze
    Aug 8, 2008
Loading...

Share This Page