Forum: Ruby-Gnome 2 Copy/Paste via EventBox (and an image)

Posted by Marc Heiler (shevegen)
on 2011-08-20 12:22
Let's say I have an image. I put this into an EventBox.

  image = Gtk::Image.new
  eventbox = Gtk::EventBox.new
  eventbox.add image

Now when I want to click on this image, I want to assign the clipboard
to the string:

"This is a test"

And then I want to be able to paste this to other widgets and also into
a console. As if I would have selected this text with my mouse button
(on Linux)

How is this doable?

I am playing around with .get_clipboard(Gdk::Selection::CLIPBOARD) right
now but somehow I can't paste into other widgets, yet alone into the
console.
Please log in before posting. Registration is free and takes only a minute.
Existing account (Switch to SSL-encrypted connection)
NEW: Do you have a Google/GoogleMail or Yahoo account? No registration required!
Log in with Google account | Log in with Yahoo account
No account? Register here.