Is there a text control that can dynamically mask/unmask its text?

Hello,

I would like to use a simple text control that can switch between:

-- Echoing the typed characters as usual,
-- Echoing asterisks like wx.TE_PASSWORD style in wx.TextCtrl,

after the control has been initialized (for instance, controlled by a
"mask/unmask" checkbox).

I have experimented with TextCtrl.SetWindowStyle and
TextCtrl.SetWindowStyleFlag, without success. As far as I can tell, I
cannot change the style to wx.TE_PASSWORD once the control is
created.. Is there a way to do this, or another control capable of
such behavior?

Thanks,
-amv-

Faster and nicer yours then mine, Phil. Chapeau.

···

2008/4/5, Phil Mayes pmayes@olivebr.com:

I would like to use a simple text control that can switch between:

– Echoing the typed characters as usual,

– Echoing asterisks like wx.TE_PASSWORD style in wx.TextCtrl,

after the control has been initialized (for instance, controlled by a

“mask/unmask” checkbox).

I have experimented with TextCtrl.SetWindowStyle and

TextCtrl.SetWindowStyleFlag, without success. As far as I can tell, I

cannot change the style to wx.TE_PASSWORD once the control is

created… Is there a way to do this, or another control capable of

such behavior?
At 06:25 AM 4/5/2008, Andriy wrote:

I would intercept wx.EVT_TEXT and if in password mode, read the value, extract the non-* char, save it, and replace the text with *'s.

Phil


wxpython-users mailing list

wxpython-users@lists.wxwidgets.org

http://lists.wxwidgets.org/mailman/listinfo/wxpython-users