Gtk.jl icon indicating copy to clipboard operation
Gtk.jl copied to clipboard

add basic GtkClipboard support

Open jonathanBieler opened this issue 10 years ago • 2 comments

It's the first time I do this, I hope I didn't messed up somewhere. I didn't added short names because there's already some clipboard methods in Base, but maybe it's not a problem.

clipboard_wait_for_text crashes when it's called from the terminal because Gtk checks for a main_loops that's not defined in that context, is there a way to check that from Julia to make it safer?

I tested it only on windows 7.

jonathanBieler avatar Sep 15 '15 15:09 jonathanBieler

I couldn't find the value of the CLIPBOARD one anywhere so I generated the list by calling gdk_atom_name. Thinking about it it's probably not the best idea, these are maybe not constant.

Some are defined here though:

https://developer.gnome.org/gdk3/stable/gdk3-Selections.html#GDK-SELECTION-PRIMARY:CAPS

I can restrict them to this list. Otherwise I just saw there's gdk_atom_intern that allows to get the value at runtime, it's maybe safer.

jonathanBieler avatar Sep 15 '15 19:09 jonathanBieler

Does this have any advantages over InteractiveUtils.clipboard?

LilithHafner avatar Aug 03 '22 18:08 LilithHafner