STC_STYLE_DEFAULT

Peter Mott wrote:

In the first demo for the Styled Text Control there are two lines:

ed.StyleSetSpec(stc.STC_STYLE_DEFAULT, "size:%d,face:%s" % (pb, face3))
ed.StyleSetSpec(1, "size:%d,bold,face:%s,fore:#0000FF" % (pb+2, face1))

Style 1 is Blue but the default style is black. I can't change the colour of
the default font. I can try:

ed.StyleSetSpec(stc.STC_STYLE_DEFAULT, "size:%d,face:%s,fore:#0000FF" % (pb,
face3))

but this has no effect at all. Is it possible to change the color of the
default font in this control. I have been unable to either in the demo or my
own code.

Call ed.StyleClearAll() after setting the style for stc.STC_STYLE_DEFAULT. That resets all attributes of all styles to match the default style, including style zero which is what all the unstyled text in that sample are set to. If you don't call StyleClearAll then only the areas beyond the end of the lines will be set to those attributes.

···

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!

Thanks, this solves it both in the demo and my own code.

Peter

···

-----Original Message-----
From: Robin Dunn [mailto:robin@alldunn.com]
Sent: 11 March 2005 01:55
To: wxPython-users@lists.wxwidgets.org
Subject: Re: [wxPython-users] STC_STYLE_DEFAULT

Peter Mott wrote:
> In the first demo for the Styled Text Control there are two lines:
>
> ed.StyleSetSpec(stc.STC_STYLE_DEFAULT, "size:%d,face:%s" % (pb, face3))
> ed.StyleSetSpec(1, "size:%d,bold,face:%s,fore:#0000FF" % (pb+2, face1))
>
> Style 1 is Blue but the default style is black. I can't change the
colour of
> the default font. I can try:
>
> ed.StyleSetSpec(stc.STC_STYLE_DEFAULT, "size:%d,face:%s,fore:#0000FF" %
(pb,
> face3))
>
> but this has no effect at all. Is it possible to change the color of the
> default font in this control. I have been unable to either in the demo
or my
> own code.

Call ed.StyleClearAll() after setting the style for
stc.STC_STYLE_DEFAULT. That resets all attributes of all styles to
match the default style, including style zero which is what all the
unstyled text in that sample are set to. If you don't call
StyleClearAll then only the areas beyond the end of the lines will be
set to those attributes.

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!

---------------------------------------------------------------------
To unsubscribe, e-mail: wxPython-users-unsubscribe@lists.wxwidgets.org
For additional commands, e-mail: wxPython-users-help@lists.wxwidgets.org