What am I doing wrong (RichTextCtrl, characterstyle?

Stef Mientki wrote:

hello,

If I put this code into the demo of RichTextCtrl at line 38
       self.rtc.Newline()
       self.rtc.BeginFontSize(6)
       self.rtc.WriteText('text1')
       self.rtc.Newline()
       self.rtc.EndFontSize()
       self.rtc.WriteText('text2')
I get both text1 and text2 in the fontsize 6.
Why, am I doing something wrong ?

Now if I exchange the lines (below marked with a '+') everthing works as expected.
       self.rtc.Newline()
       self.rtc.BeginFontSize(6)
       self.rtc.WriteText('text1')
    + self.rtc.EndFontSize() + self.rtc.Newline()
       self.rtc.WriteText('text2')

Isn't it allowed to span character styles over newlines ?

I would think so, but probably only Julian could say for sure. He's on the wx-users list.

···

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