[wxPython-users] Change the wx.TE_PASSWORD style in a TextCtrl

Chris Mellon arkanes at gmail.com
Mon Jul 23 06:05:37 PDT 2007


On 7/23/07, Marco Meoni - Sbaush <sbaush at gmail.com> wrote:
> i solved with this code:
>
> if "condition":
>       self.value.SetWindowStyle(wx.NORMAL)
> else: self.value.SetWindowStyle(wx.TE_PASSWORD)
>
> On Linux it works perfectly, but on Windows this doesn't work... It's
> normal?
> Can i write my code better?
>

As Robin said, there are some styles cannot be set after control
creation. This varies from platform to platform, and on windows the
password masking style is one of these.

You'll need to destroy the current text control and create a new one.




More information about the wxpython-users mailing list