Re: wx.Theclipboard
Nathan smith <[email protected]> Mon, 8 Jan 2024 20:20:24 +0000
| Newsgroups | gmane.comp.python.wxpython |
|---|---|
| Message-ID | <[email protected]> |
Evening David and Dietmar, thank you both for your responses. I have now finished reading through the information you=C2=A0 both pointed = me=20 too and can say gladly, goal achieved! David, apologies if I came across as one of these "waaa, code it for=20 meeeee!" types, totally was not my intention and what you did was=20 actually what I was hoping for, a here is how this does it approach, now=20 you figure it out. All the best, Nathan On 08/01/2024 16:56, David Woods wrote: > Hi Nathan, > > Your request is not a small ask, and I don't have time to write=20 > something new and custom and targeted to your specific situation. > > If you want an example of using the Clipboard with complex data, take=20 > a look at https://github.com/DKWoods/PyParserDemo, starting with the=20 > PyParserDemo.py file's OnCutCopy() and OnPaste() methods, which handle=20 > transferring formatted text between a wxPython app and a word=20 > processor.=C2=A0 It uses wx.DataObjectComposite() to pass both formatted= =20 > and plain text versions of the data being passed through the=20 > clipboard.=C2=A0 In OnPaste(), you can see the code attempt to find=20 > formatted text and if that fails, to use plain text. > > To run my code, which demonstrates DOCx and RTF support for the=20 > wxPython RichTextCtrl, you will need to install the python-docx module=20 > fork from my repository as well as wxPython. > > Hope that helps. > > David > > > > On 1/8/24 6:39 AM, Nathan smith wrote: >> Hello, >> >> >> Would someone mind awfully writing me an example script ath shows me=20 >> how to copy multiple formats to the clipboard and paste/ >> >> What I want to achieve here is: >> >> I have one object that is plane text, >> >> and another object that is bytes. >> >> I want basically to be able to set the clipboard with both formats,=20 >> then in the paste function say if the plain text is present, set that=20 >> to a variable, if the bytes format is present, use that too. >> >> >> Thanks in advance, >> >> Nathan >> > --=20 You received this message because you are subscribed to the Google Groups "= wxPython-users" group. To unsubscribe from this group and stop receiving emails from it, send an e= mail to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/= wxpython-users/81642774-cc9b-429a-b634-784ce14d1bd6%40gmail.com.