[gtk-osx-users] Pasting images from clipboard



Is pasting images from the clipboard supported in GTK 2.x for OS X?

In my app, the same code doesn't work on OS X but works OK on all other platforms (Windows, Linux, BSD, ...).


Actual code goes like this:


- paste is initialized by call to:

    GtkClipboard *clipboard = gtk_widget_get_clipboard (g_text.m_pWidget, GDK_SELECTION_CLIPBOARD);
    gtk_clipboard_request_targets(clipboard, OnPasteClipboardTargetsReceivedFunc, NULL);


- inside OnPasteClipboardTargetsReceivedFunc callback, I do actual pasting with:

    if(gtk_targets_include_image(atoms, n_atoms, FALSE)){

        GtkPixbuf *pixbuf = gtk_clipboard_wait_for_image(clipboard);

        if(!pixbuf){

            gtkMessageBox(_("Failed to open image from the clipboard!"));

        }

   }


This GTK API call fails consistently all the time (returning NULL) on OS X (triggering error message box below).

Is this a known issue?


Note that pasting works OK for other types of content (text, RTF), but naturally I use different calls to fetch those.

The app is bundled with all image loaders, inserting image from file works OK, only clipboard operation is problematic.


Regards,

  Miroslav



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]