You may be able to do it by calling HideCaret via ctypes, but I did find
one message stating that that API doesn't apply to the standard text
control because it handles the caret in a different way. (It probably
draws it itself.)
Why are you wanting to do this? Perhaps a different widget, or a custom
one, will meet your needs better.
--
Robin Dunn
Software Craftsman
http://wxPython.org
Have you tried using the wx.TE_READ_ONLY style? It probably still
displays the caret since it allows you to select text by the keyboard
and to position the caret to be able to do so, but otherwise it gives
you what you want.
yourTextCtrl.GetCaret().Hide()
hope that helps
The Caret referred to by GetCaret is a wx.Caret which is intended for
use with your own custom classes that need a caret not the native
widgets. Unless you explicitly created one of them then the window
doesn't have a wx.Caret.
The caret you see in a wx.TextCtrl is one provided by the native control
and wx doesn't have access to it. If the native widget allows you to
turn it on or off then it may be possible to do it via a native API
accessible with ctypes or something, but wx doesn't expose anything like
that.