开发者

wxPython: Copying text from RichTextCtrl

开发者 https://www.devze.com 2023-04-02 05:05 出处:网络
I\'ve been trying to figure out how to copy rich text from a RichTextCtrl to the clipboard. I\'m able to copy the text just fine, but not the rich text information. For exam开发者_如何学编程ple, if I

I've been trying to figure out how to copy rich text from a RichTextCtrl to the clipboard. I'm able to copy the text just fine, but not the rich text information. For exam开发者_如何学编程ple, if I copy some bold text from my RichTextCtrl and then paste it in to another program, it is just plain text.

Any ideas?

Thanks, Peter


Take a look at the PyRTFParser project.

From the project website:

...the Cut, Copy, and Paste methods in the RichTextCtrl support only plain text, not formatted text

Cut / Copy / Paste of RTF-formatted text through the clipboard between Word on Windows and Word and TextEdit on OS X has been implemented in the PyRTFParserDemo.py file.

0

精彩评论

暂无评论...
验证码 换一张
取 消