[wxPython] how to erase the text?

From: "Robin Dunn" <robin@alldunn.com>
Reply-To: wxpython-users@lists.wxwindows.org
To: <wxpython-users@lists.wxwindows.org>
Subject: Re: [wxPython] how to erase the text?
Date: Tue, 26 Jun 2001 13:57:13 -0700

>
> I am trying to repaint the wxTextCtrl when the length of the input text is
> more than four, but Refresh() didn't work here. Could somebody give me
any
> suggestion?

Platform and version?

Windows 2000 plus wxPython2.3.

> #------------------------------------------------------
> self.extension = wxTextCtrl(panel, ID_EXTENSION, "")
> EVT_TEXT(self, ID_EXTENSION, self.check)
> def check(self, event):
> text = self.extension.GetValue()
> if (len(text) > 4 ):
> print "error"
> self.extension.Refresh(true)

How can you tell it isn't working? The wxTextCtrl does a very good job of
keeping itself painted, there shouldn't be any reason to call Refresh on it.

I guess I misunderstood the Refresh() function. But could you please
tell me how to reset self.extension to be a blank text field when the error occurs? Thanks a lot.

--
Robin Dunn
Software Craftsman
robin@AllDunn.com Java give you jitters?
http://wxPython.org Relax with wxPython!

_______________________________________________
wxpython-users mailing list
wxpython-users@lists.wxwindows.org
http://lists.wxwindows.org/mailman/listinfo/wxpython-users

Jenny

···

_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com

I guess I misunderstood the Refresh() function. But could you please
tell me how to reset self.extension to be a blank text field when the

error

occurs? Thanks a lot.

    self.extension.SetValue("")

···

--
Robin Dunn
Software Craftsman
robin@AllDunn.com Java give you jitters?
http://wxPython.org Relax with wxPython!