Frage

I'm using a wxpython textctrl & would like to hide the caret. After a lot of searching it would appear that the best approach would be to simply change it's colour to white. However I can not work out how to do this.

I found the following info:

SetCaretForeground(fore)

Sets the foreground color of the caret. The parameter fore is a wxColour object, a #RRGGBB string, or a color spec like "white". Returns None.

from here: http://www.yellowbrain.com/stc/caret.html#setfg

The code for my current textctrl is below. Any help would be appreciated.

self.control = wx.TextCtrl(self, style=wx.TE_MULTILINE | wx.TE_READONLY | wx.HSCROLL)

Clinton.

War es hilfreich?

Lösung

You are using a wx.TextCtrl and the link you give is for a wx.StyledTextCtrl. These are completely different animals, and the wx.StyledTextCtrl has a lot more functionality than the simple wx.TextCtrl.

I don't think there's a way to set the caret color in an ordinary wx.TextCtrl.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top