wxSTC, the Clipboard, and Styles

David Woods wrote:

I'm using wxSTC as the basis for a crude, low-power RTF editor, and it's
performed the task admirably.

I notice, however, that when I use Cut and Paste, I lose my character
formatting and the pasted text is rendered in the default font. In
addition, when I paste text from other programs, it's lost its formatting.
Finally, when I use Paste to get character information from the Character
Map, it's lost it's font Face information, rendering it useless.

The theme in all of these instances is that I need to know how to get Style
information out of the Clipboard for use in wxSTC. Does anybody know how I
can do this? Two of the three use-cases here assume other programs as the
source of the data, so it's not a matter of making a better Cut/Copy (though
I may have to do that too.)

The wxSTC only puts or gets plain text data objects from the clipboard. You would have to teach it how to deal with rich text objects. There isn't a standard format id for RTF, but there probably is a standardized format name for it on Windows that you could use with wx.CustomDataFormat.

ยทยทยท

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