In styled text widget, how does one set the background/foreground color
to say green for a certain line say 120?
You're looking for SetStyle and wxTextAttr. The code below is from the
wxTextCtrl in demo.py for wxPython 2.3.1. I don't think they are listed in
the docs.
t4 = wxTextCtrl(self, 40, "If supported by the native control, this
is red, and this is a different font.",
size=(200, 100), style=wxTE_MULTILINE|wxTE_RICH)
t4.SetInsertionPoint(0)
t4.SetStyle(44, 47, wxTextAttr("RED", "YELLOW"))
points = t4.GetFont().GetPointSize() # get the current size
f = wxFont(points+2, wxROMAN, wxITALIC, wxBOLD, true)
t4.SetStyle(63, 77, wxTextAttr("BLUE", wxNullColour, f))
ka
···
-----Original Message-----
From: wxpython-users-admin@lists.wxwindows.org
[mailto:wxpython-users-admin@lists.wxwindows.org]On Behalf Of Hassan
Aurag
Sent: Thursday, October 25, 2001 7:09 AM
To: WxPython Mailing List
Subject: [wxPython] Styled Text background color?In styled text widget, how does one set the background/foreground color
to say green for a certain line say 120?_______________________________________________
wxpython-users mailing list
wxpython-users@lists.wxwindows.org
http://lists.wxwindows.org/mailman/listinfo/wxpython-users
In styled text widget, how does one set the background/foreground color
to say green for a certain line say 120?
For wxStyledTextCtrl you can do it with styles.
Or, IIRC, if you have no margin setup for markers then the background colour
of the line will be changed if you set a marker on the line. (Is this right
Neil?)
···
--
Robin Dunn
Software Craftsman
robin@AllDunn.com Java give you jitters?
http://wxPython.org Relax with wxPython!
I am talking about wxStyledText control and not the usual wxpython Text
control
···
On Thu, 2001-10-25 at 12:04, Kevin Altis wrote:
You're looking for SetStyle and wxTextAttr. The code below is from the
wxTextCtrl in demo.py for wxPython 2.3.1. I don't think they are listed in
the docs.t4 = wxTextCtrl(self, 40, "If supported by the native control, this
is red, and this is a different font.",
size=(200, 100), style=wxTE_MULTILINE|wxTE_RICH)
t4.SetInsertionPoint(0)
t4.SetStyle(44, 47, wxTextAttr("RED", "YELLOW"))points = t4.GetFont().GetPointSize() # get the current size
f = wxFont(points+2, wxROMAN, wxITALIC, wxBOLD, true)
t4.SetStyle(63, 77, wxTextAttr("BLUE", wxNullColour, f))ka
> -----Original Message-----
> From: wxpython-users-admin@lists.wxwindows.org
> [mailto:wxpython-users-admin@lists.wxwindows.org]On Behalf Of Hassan
> Aurag
> Sent: Thursday, October 25, 2001 7:09 AM
> To: WxPython Mailing List
> Subject: [wxPython] Styled Text background color?
>
>
> In styled text widget, how does one set the background/foreground color
> to say green for a certain line say 120?
>
>
>
>
>
>
> _______________________________________________
> wxpython-users mailing list
> wxpython-users@lists.wxwindows.org
> http://lists.wxwindows.org/mailman/listinfo/wxpython-users
>_______________________________________________
wxpython-users mailing list
wxpython-users@lists.wxwindows.org
http://lists.wxwindows.org/mailman/listinfo/wxpython-users
About markers, I discovered that by accident. But if I double click on a
word in there, the whole thing crashes with zillions of gdkgc warnings
about selecting a rectangle ..... But this is maybe due to some of my
signals, so I'll double check...
···
On Thu, 2001-10-25 at 13:39, Robin Dunn wrote:
> In styled text widget, how does one set the background/foreground color
> to say green for a certain line say 120?
>For wxStyledTextCtrl you can do it with styles.
Or, IIRC, if you have no margin setup for markers then the background colour
of the line will be changed if you set a marker on the line. (Is this right
Neil?)--
Robin Dunn
Software Craftsman
robin@AllDunn.com Java give you jitters?
http://wxPython.org Relax with wxPython!_______________________________________________
wxpython-users mailing list
wxpython-users@lists.wxwindows.org
http://lists.wxwindows.org/mailman/listinfo/wxpython-users
Robin Dunn:
> In styled text widget, how does one set the background/foreground color
> to say green for a certain line say 120?
>For wxStyledTextCtrl you can do it with styles.
Or, IIRC, if you have no margin setup for markers then the background
colour
of the line will be changed if you set a marker on the line. (Is this
right
Neil?)
The normal way to do this is with markers which will display either as
symbols in a margin or as a background colour change if there is no margin
to display them. In Scintilla 1.41 there will also be a SC_MARK_BACKGROUND
that is only displayed as a background colour change.
Neil