RichTextCtrl.ApplyUnderlineToSelection() problem on Windows

29 views
Skip to first unread message

David Woods

unread,
Oct 4, 2012, 5:28:49 PM10/4/12
to wxpytho...@googlegroups.com
Hi all,

I'm having a problem with text formatting in the RichTextCtrl on Windows
only. I see the same thing in wxPython 2.8.12.1 and 2.9.4.0. I've
tried Windows 7 and Windows XP, as well as OS X and Ubuntu. It fails on
Windows, not OS X or Linux.

The RichTextCtrl has handy formatting methods for
ApplyBoldToSelection(), ApplyItalicToSelection() and
ApplyUnderlineToSelelction(). But on Windows,
ApplyUnderlineToSelection() doesn't always show up immediately. If you
underline a selection, the underlining for that original selection won't
show up until a subsequent Underline or Bold call is made elsewhere.
Removing underlining always occurs immediately. Bold and Italics appear
to work immediately. Underlining appears to work if called immediately
AFTER Bold. But sometimes it doesn't happen immediately.

Update(), Refresh(), and UpdateWindowUI() have no effect.

I've attached a simple sample.

1. Can others replicate this?

2. Is there a workaround anyone can find?

3. Is this an issue with my code, wxPython, or wxWidgets?

Thanks in advance,
David
RTF Format Problem.py

Robin Dunn

unread,
Oct 8, 2012, 12:55:32 PM10/8/12
to wxpytho...@googlegroups.com
On 10/4/12 2:28 PM, David Woods wrote:
> Hi all,
>
> I'm having a problem with text formatting in the RichTextCtrl on Windows
> only. I see the same thing in wxPython 2.8.12.1 and 2.9.4.0. I've
> tried Windows 7 and Windows XP, as well as OS X and Ubuntu. It fails on
> Windows, not OS X or Linux.
>
> The RichTextCtrl has handy formatting methods for
> ApplyBoldToSelection(), ApplyItalicToSelection() and
> ApplyUnderlineToSelelction(). But on Windows,
> ApplyUnderlineToSelection() doesn't always show up immediately. If you
> underline a selection, the underlining for that original selection won't
> show up until a subsequent Underline or Bold call is made elsewhere.
> Removing underlining always occurs immediately. Bold and Italics appear
> to work immediately. Underlining appears to work if called immediately
> AFTER Bold. But sometimes it doesn't happen immediately.
>
> Update(), Refresh(), and UpdateWindowUI() have no effect.
>
> I've attached a simple sample.
>
> 1. Can others replicate this?

Yes.

>
> 2. Is there a workaround anyone can find?
>
> 3. Is this an issue with my code, wxPython, or wxWidgets?

Looks like a wxWidgets bug to me. Please create a ticket about it at
trac.wxwidgets.org.


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

David Woods

unread,
Oct 8, 2012, 3:47:17 PM10/8/12
to wxpytho...@googlegroups.com
Thanks. I've submitted ticket #14735.

One other note. If the line with Underlining ALSO contains Bold or
Italics formatting, then Underline works fine. This problem seems to
occur only when underline is the only formatting applied to a line.

David
Reply all
Reply to author
Forward
0 new messages