wxPython ,Change the background colour of a StyledTextCtrl

Posted by user1357159 on Stack Overflow See other posts from Stack Overflow or by user1357159
Published on 2012-06-02T21:26:01Z Indexed on 2012/06/03 4:40 UTC
Read the original article Hit count: 219

Filed under:
|
|
|

I tried (but nothing happens)

    self.txt.SetBackgroundColour ((255,0,0))

As said in the title I'm trying to change the background colour StyledTextCtrl. Does anyone know a method that could be used? I've checked the API docs but I couldn't seem to find one, http://wxpython.org/docs/api/wx.stc.StyledTextCtrl-class.html

(by background colour, I mean the whole writing area, of course)

Does anyone know a way I could do this?

EDIT:

The background doesn't change in the following code

import wx
import wx.stc

app = wx.App(redirect=True)
top = wx.Frame(None, title="StyledTXTCtrl", size=(300,200))
txt=wx.stc.StyledTextCtrl(top)
txt.SetBackgroundColour((255,255,0))
txt.Refresh()
top.Show()
app.MainLoop()

© Stack Overflow or respective owner

Related posts about python

Related posts about wxpython