I'm running Ubuntu 10.04 here and OpenOffice 3.2.0...
I have a wx.Bitmap sitting around that I paste to the clipboard as
follows:
def OnCopyToClipboard(self,event):
d = wx.BitmapDataObject(self.capBmp)
if wx.TheClipboard.Open():
wx.TheClipboard.SetData(d)
wx.TheClipboard.Flush()
wx.TheClipboard.Close()
self.GetLogTextCtrl().Log("Image copied to cliboard.\n")
else:
self.GetLogTextCtrl().LogError("Couldn't open clipboard!
\n")
When this is executed, if I use GIMP I can execute "Paste" and the
bitmap shows up correctly. However, while OpenOffice seems to think
there's something on the clipboard, neither OO Write nor Draw actually
do anything if I perform the same "Paste" action.
If I paste into GIMP, hit copy in GIMP, and then paste into OO all is
well, but I'd like to avoid this circuitous route if possible.
Any idea what would make OO unhappy?
I should probably try this on Windows... historically on Windows I've
had somewhat similar problems where graphics items refuse to paste
into some specific program, but a trip through Word fixes things,
presumably by making more formats available on the clipboard than what
there was originally.
I expect that this is the same problem. OO is no supporting the data format that wx uses for putting bitmaps on the clipboard but Gimp is.
···
On 5/16/10 4:56 PM, Joel Koltner wrote:
When this is executed, if I use GIMP I can execute "Paste" and the
bitmap shows up correctly. However, while OpenOffice seems to think
there's something on the clipboard, neither OO Write nor Draw actually
do anything if I perform the same "Paste" action.
If I paste into GIMP, hit copy in GIMP, and then paste into OO all is
well, but I'd like to avoid this circuitous route if possible.
Any idea what would make OO unhappy?
I should probably try this on Windows... historically on Windows I've
had somewhat similar problems where graphics items refuse to paste
into some specific program, but a trip through Word fixes things,
presumably by making more formats available on the clipboard than what
there was originally.
I tested it on Windows, and "all is well" there (after running the
code posted above, you can paste directly into OpenOffice, Paint, or
anything else I tried).
So I guess I will just chalk this up to the clipboard on *NIX being
(apparently) a little less standardized than I might like, and
OpenOffice not agreeing with wxWidgets on some bit of protocol when it
comes to bitmaps. (...I remember the days when all bets were off for
copying/pasting anything other than text in *NIX -- there was no
standard for passing arbitrary objects between programs...)