[wxPython] further clipboard trials and tribulations

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[wxPython] further clipboard trials and tribulations

Gregory Landrum

[NT and wxPython 2.1.11]

So when I copy something out of Excel, I end up with an object
on the clipboard which can be represented lots and lots of
different ways.  Two of these ways are Text and Bitmap.
Unfortunately, I don't seem to be able to read the bitmap
out of the clipboard (the text works just fine).
The following code snippet:
    if wxTheClipboard.IsSupported(wxDataFormat(wxDF_BITMAP)):
      success = wxTheClipboard.GetData(self.imgObj)
      if not success:
        print 'Well, I thought I could do it... but I can not.'
      else:
        result = self.imgObj.GetBitmap()
    if wxTheClipboard.IsSupported(wxDataFormat(wxDF_TEXT)):
      success = wxTheClipboard.GetData(self.textObj)
      if not success:
        print 'Well, I thought I could do it... but I can not.'
      else:
        result = self.textObj.GetText()
successfully pulls the text from an Excel-produced clipboard and can
pull bitmaps when other apps place things on the clipboard, but fails
(result = 0) when it tries to get an Excel bitmap.

Any clues?
thanks
-greg

----
Greg Landrum, Ph.D.              [hidden email]
Sr. Research Scientist      Dupont Pharmaceutical Research Lab
  These are my views, not necessarily those of my employer.

_______________________________________________
wxPython-users maillist  -  [hidden email]
http://starship.python.net/mailman/listinfo/wxpython-users