Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
104 views
in Technique[技术] by (71.8m points)

With gtk3, how do I make a write to the clipboard presistant?

I stink at reading C code.gtk

In the sample clipboard_simple.c

it states

// NOTE: If you test this without a clipboard manager running, the
// new text saved to the clipboard will disappear as soon as this
// program exits.

xclip does not have this issue, and I can't figure out why.

How do I make a (text) write to the clipboard persistent?

Many thanks,

New info:

I do believe the missing piece of the puzzle is: gtk-clipboard-store

void
gtk_clipboard_store (GtkClipboard *clipboard);

Would someone point to the structure of GtkClipboard? I think it is buried somewhere in /usr/include/gtk-3.0/gtk/gtkclipboard.h, but I can not figure it out.

Edit: if I am not mistaken, it is just a C pointer to a 64 bit integer

question from:https://stackoverflow.com/questions/65661734/with-gtk3-how-do-i-make-a-write-to-the-clipboard-presistant

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...