Hacking at gnome-screenshot and battling with gtk_clipboard_store ()



Hi

I'm trying to make gnome-screenshot store the screenshot to the
clipboard after the application is closed using gtk_clipboard_store():

  else if (response_id == SCREENSHOT_RESPONSE_COPY)
    {
      GtkClipboard *clipboard;
      GdkPixbuf    *screenshot;

      clipboard = gtk_clipboard_get_for_display
(gtk_widget_get_display (GTK_WIDGET (d)),
                                                 GDK_SELECTION_CLIPBOARD);
      screenshot = screenshot_dialog_get_screenshot (dialog);
      gtk_clipboard_set_image (clipboard, screenshot);

      /* Added Code */
      gtk_clipboard_store(clipboard);

    }

But it doesn't work. I searched for a answer but with no luck, references:

http://mail.gnome.org/archives/gnome-devel-list/2005-August/msg00002.html
http://mail.gnome.org/archives/gtk-app-devel-list/2006-October/msg00149.html
http://mail.gnome.org/archives/gtk-app-devel-list/2005-March/msg00224.html

The last url linked to
http://ubuntuguide.org/#keepclipboardinmemorygnome but the url is not
valid any more. I'm using Ubuntu 8.10 and I downloaded the source
using apt-get source gnome-utils and downloaded all the needed
packages from the Ubuntu repositories as well.

My question to you are:

1. Am I doing something wrong, regarding the code?
2. Or Should I have a application on my computer to store the
clipboard, and if so what application do I need?
3. Or is this a bug on Ubuntu or a problem with GTK?

Any response would be appreciated,

---
Ludolph Neethling


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