Re: Why doesn't changing window style flags work?

Tim Roberts <[email protected]>
Newsgroups gmane.comp.python.wxpython
Organization Providenza & Boekelheide, Inc.
Message-ID <[email protected]>
Tim Roberts wrote:
> ioprst wrote:
>>
>> Why does setting the wx.TE_READONLY flag (wx.TE_PASSWORD) for the 
>> wx.TextCtrl window not work?
>
> Are you using Windows?  Some of this is a limitation of the native 
> widget.  On Windows, setting the ES_READONLY style is not enough to 
> have it actually take effect.  You need to send the control an 
> EM_SETREADONLY message.  The "SetEditable" method does that. Please 
> try that instead.

The same situation exists with TE_PASSWORD, which maps to the Windows 
style ES_PASSWORD.  There is an EM_SETPASSWORDCHAR message to request a 
change in this bit, but wxWidgets doesn't expose that.  You could use 
SendMessage to send it directly, if you really need this, although I'm 
not sure why you would, and that would be Windows-only.  It might be 
easier just to delete the control and recreate it.

-- 
Tim Roberts, [email protected]
Providenza & Boekelheide, Inc.


-- 
You received this message because you are subscribed to the Google Groups "wxPython-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To view this discussion on the web visit https://groups.google.com/d/msgid/wxpython-users/b34059d8-3916-96da-a495-40a10d131e9c%40probo.com.
smime.p7s (application/pkcs7-signature, 3.3 KB) - not displayed
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.