Copy/Paste via EventBox (and an image)

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.