-
Notifications
You must be signed in to change notification settings - Fork 80
add basic GtkClipboard support #176
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
(UInt16,), selection)) | ||
GtkClipboardLeaf() = GtkClipboardLeaf(Gtk.GdkAtoms.CLIPBOARD) | ||
clipboard_set_text(clip::GtkClipboard,text::String) = ccall((:gtk_clipboard_set_text,libgtk), Void, | ||
(Ptr{GObject}, Ptr{Uint8},Cint), clip, text, length(text)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sizeof(text)
, not length
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe this will be exposed automatically as G_.text(clipboard, text)
once the autogen script is rerun.
I couldn't find the value of the CLIPBOARD one anywhere so I generated the list by calling 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 |
fixed Uint16
cfbde73
to
1a89cac
Compare
@@ -134,6 +135,7 @@ export | |||
GtkTextMarkLeaf, | |||
GtkTextTagLeaf, | |||
GtkTextViewLeaf, | |||
GtkClipboardLeaf, | |||
GtkToolButtonLeaf, | |||
GtkToolItemLeaf, | |||
GtkToolbarLeaf, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please make the corresponding updates to short_leaf_exports.jl
and short_exports.jl
Does this have any advantages over |
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 amain_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.