textctrl background colour

1 view
Skip to first unread message

Marco Prosperi

unread,
Nov 12, 2009, 5:29:04 PM11/12/09
to wxPython-users
hi all, it seems is not possibile to change the background colour of a
disabled textctrl. You can verify it with the demo, just putting
(py2.5, wxpy 2.8.10.1, Vista):

t1.Enable(False)
t1.SetBackgroundColour(wx.BLACK)

Can you suggest me a workaround for this? Leaving t1.Enable(True) but
eating all the key pressing trying to change the textctrl value has
drawbacks? Or is there something more straightforward?

thanks in advance,

Marco

Mike Driscoll

unread,
Nov 13, 2009, 9:30:53 AM11/13/09
to wxPython-users
Hi Marco,
My guess is that this is a limitation with the native text control.
Did you try changing the color before disabling it?

-------------------
Mike Driscoll

Blog: http://blog.pythonlibrary.org

Marco Prosperi

unread,
Nov 13, 2009, 11:34:31 AM11/13/09
to wxPython-users


yes, without success

Robin Dunn

unread,
Nov 13, 2009, 1:51:40 PM11/13/09
to wxpytho...@googlegroups.com

The only other idea I have is to use the read-only style, but it looks
like that only has effect when used with the constructor, you can't
switch it back and forth after the widget has been created.

--
Robin Dunn
Software Craftsman
http://wxPython.org

Reply all
Reply to author
Forward
0 new messages