Hey all,
I was wondering how I could check the clipboard and see if it is either empty or has something copied to it other than text (such as an image or file). If I could do this through a platform-independent method, that would be great (if not, could you show me how to do it on windows, linux, and mac?)
Also, what is the function to see if some text is highlighted? And what’s the function for moving the cursor to the end of a line?
(I’m starting to sound like a leecher…)
Thanks so much for any help. It would also help if you can show me some documentation.
From: Trey K [mailto:trey.wxpython@gmail.com]
Sent: Monday, October 15, 2007 6:31 PM
To: wxPython-users@lists.wxwidgets.org
Subject: Checking the clipboard
Hey all,
I was wondering how I could check the clipboard and see if it
is either empty or has something copied to it other than text
(such as an image or file). If I could do this through a
platform-independent method, that would be great (if not,
could you show me how to do it on windows, linux, and mac?)
Also, what is the function to see if some text is
highlighted? And what's the function for moving the cursor to
the end of a line?
(I'm starting to sound like a leecher...)
Thanks so much for any help. It would also help if you can
show me some documentation.
Trey
What widget are your using (or planning to use)? I'm not aware of a
cross-platform way to get at the clipboard. I do know how to get at the
Windows version though. You'll need the pyWin32 package. Then check out
this link:
Hey all,
I was wondering how I could check the clipboard and see if it
is either empty or has something copied to it other than text
(such as an image or file). If I could do this through a
platform-independent method, that would be great (if not,
could you show me how to do it on windows, linux, and mac?)
Also, what is the function to see if some text is
highlighted? And what's the function for moving the cursor to
the end of a line?
(I'm starting to sound like a leecher...)
Thanks so much for any help. It would also help if you can
show me some documentation.
Trey
What widget are your using (or planning to use)? I'm not aware of a
cross-platform way to get at the clipboard. I do know how to get at the
Windows version though. You'll need the pyWin32 package. Then check out
this link:
Get the "Docs and Demos" download off the wxPython web site. It includes the wxWidgets reference document, which are mostly written for C++ but works well enough for wxPython as well, as there are wxPython-specific comments embedded where needed. Search the wxWidgets document's index for wxClipboard. It's a nice cross-platform solution.
Robin's book, chapter 18, has five full pages on the use of wx.TheClipboard. wx.TheClipboard can handle any wx.DataObject instance.
Bob
···
At 07:31 PM 10/15/2007, Trey K wrote:
Hey all,
I was wondering how I could check the clipboard and see if it is either empty or has something copied to it other than text (such as an image or file). If I could do this through a platform-independent method, that would be great (if not, could you show me how to do it on windows, linux, and mac?)