Hi All,
I need help with this call:
https://developer.gnome.org/gtk3/stable/gtk3-Clipboards.html#gtk-clipboard-s...
The following sample states:
https://github.com/bstpierre/gtk-examples/blob/master/c/clipboard_simple.c
// 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.
https://sourceforge.net/p/xclip/code/HEAD/tree/trunk/xclip.c
How do I make my text write to the clipboard persistent?
Many thanks, -T
On 1/12/21 1:33 AM, ToddAndMargo via users wrote:
I need help with this call:
https://developer.gnome.org/gtk3/stable/gtk3-Clipboards.html#gtk-clipboard-s...
The following sample states:
https://github.com/bstpierre/gtk-examples/blob/master/c/clipboard_simple.c
// 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.
https://sourceforge.net/p/xclip/code/HEAD/tree/trunk/xclip.c
How do I make my text write to the clipboard persistent?
Does your program have that problem? Are you running Gnome? My understanding is that Gnome automatically grabs any clipboard contents so that they do persist after the program exits. So effectively, you always have a clipboard manager running as mentioned in the doc.
On 1/12/21 1:43 AM, Samuel Sieb wrote:
On 1/12/21 1:33 AM, ToddAndMargo via users wrote:
I need help with this call:
https://developer.gnome.org/gtk3/stable/gtk3-Clipboards.html#gtk-clipboard-s...
The following sample states:
https://github.com/bstpierre/gtk-examples/blob/master/c/clipboard_simple.c
// 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.
https://sourceforge.net/p/xclip/code/HEAD/tree/trunk/xclip.c
How do I make my text write to the clipboard persistent?
Does your program have that problem? Are you running Gnome? My understanding is that Gnome automatically grabs any clipboard contents so that they do persist after the program exits. So effectively, you always have a clipboard manager running as mentioned in the doc.
I am not top that point yet. Another programmer I have been collaborating with has and he does have the problem.
On 1/12/21 3:52 AM, ToddAndMargo via users wrote:
On 1/12/21 1:43 AM, Samuel Sieb wrote:
On 1/12/21 1:33 AM, ToddAndMargo via users wrote:
I need help with this call:
https://developer.gnome.org/gtk3/stable/gtk3-Clipboards.html#gtk-clipboard-s...
The following sample states:
https://github.com/bstpierre/gtk-examples/blob/master/c/clipboard_simple.c
// 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.
https://sourceforge.net/p/xclip/code/HEAD/tree/trunk/xclip.c
How do I make my text write to the clipboard persistent?
Does your program have that problem? Are you running Gnome? My understanding is that Gnome automatically grabs any clipboard contents so that they do persist after the program exits. So effectively, you always have a clipboard manager running as mentioned in the doc.
I am not top that point yet. Another programmer I have been collaborating with has and he does have the problem.
See if it works, but there's also https://developer.gnome.org/gtk3/stable/gtk3-Clipboards.html#gtk-clipboard-s... which might be relevant.
On 1/12/21 11:29 AM, Samuel Sieb wrote:
On 1/12/21 3:52 AM, ToddAndMargo via users wrote:
On 1/12/21 1:43 AM, Samuel Sieb wrote:
On 1/12/21 1:33 AM, ToddAndMargo via users wrote:
I need help with this call:
https://developer.gnome.org/gtk3/stable/gtk3-Clipboards.html#gtk-clipboard-s...
The following sample states:
https://github.com/bstpierre/gtk-examples/blob/master/c/clipboard_simple.c
// 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.
https://sourceforge.net/p/xclip/code/HEAD/tree/trunk/xclip.c
How do I make my text write to the clipboard persistent?
Does your program have that problem? Are you running Gnome? My understanding is that Gnome automatically grabs any clipboard contents so that they do persist after the program exits. So effectively, you always have a clipboard manager running as mentioned in the doc.
I am not top that point yet. Another programmer I have been collaborating with has and he does have the problem.
See if it works, but there's also https://developer.gnome.org/gtk3/stable/gtk3-Clipboards.html#gtk-clipboard-s... which might be relevant.
DUDE!!!! THANK YOU!
On 1/12/21 11:29 AM, Samuel Sieb wrote:
See if it works, but there's also https://developer.gnome.org/gtk3/stable/gtk3-Clipboards.html#gtk-clipboard-s... which might be relevant.
Hi Sam,
By any chance, do yo know were I can find the structure for GtkClipboard?
https://developer.gnome.org/gtk3/stable/gtk3-Clipboards.html#gtk-clipboard-s...
void gtk_clipboard_store (GtkClipboard *clipboard);
Stores the current clipboard data somewhere so that it will stay around after the application has quit.
Parameters
clipboard a GtkClipboard
I think it is somewhere in
/usr/include/gtk-3.0/gtk/gtkclipboard.h
but I can not find it.
:'(
-T
On 1/12/21 11:59 AM, ToddAndMargo via users wrote:
On 1/12/21 11:29 AM, Samuel Sieb wrote:
See if it works, but there's also https://developer.gnome.org/gtk3/stable/gtk3-Clipboards.html#gtk-clipboard-s... which might be relevant.
By any chance, do yo know were I can find the structure for GtkClipboard?
I think it is somewhere in
/usr/include/gtk-3.0/gtk/gtkclipboard.h
but I can not find it.
I expect it's something internal that you aren't supposed to touch. https://developer.gnome.org/gtk3/stable/gtk3-Clipboards.html#GtkClipboard-st...
Why do you need to access it?
Also, this is very off-topic for the Fedora list, so any further replies should probably be direct to me.
On 1/12/21 12:13 PM, Samuel Sieb wrote:
On 1/12/21 11:59 AM, ToddAndMargo via users wrote:
On 1/12/21 11:29 AM, Samuel Sieb wrote:
See if it works, but there's also https://developer.gnome.org/gtk3/stable/gtk3-Clipboards.html#gtk-clipboard-s... which might be relevant.
By any chance, do yo know were I can find the structure for GtkClipboard?
I think it is somewhere in
/usr/include/gtk-3.0/gtk/gtkclipboard.h
but I can not find it.
I expect it's something internal that you aren't supposed to touch. https://developer.gnome.org/gtk3/stable/gtk3-Clipboards.html#GtkClipboard-st...
That should help me chase it down. Thank you!
Why do you need to access it?
I need to create OOP (Object Orientated Program) class emulating it so I can create a pointer to an OOP object of type GtkClipboard so I can use the GTK clipboard functions. (I got that in in all one sentence! Ha!)
Also, this is very off-topic for the Fedora list, so any further replies should probably be direct to me.
Ya, no fooling. I posted here as a last ditch attempt to get the information. Even Stack Overflow did not know!
https://stackoverflow.com/questions/65661734/with-gtk3-how-do-i-make-a-write...
I have been trying to get this down for over a year.
Sam, you do know you are a genius, don't you? Wait? I did not just post a complement???? Now I have to wash my mouth out with soap! DANG!!!
:-)
-T
On 12Jan2021 11:59, ToddAndMargo ToddAndMargo@zoho.com wrote:
On 1/12/21 11:29 AM, Samuel Sieb wrote:
See if it works, but there's also https://developer.gnome.org/gtk3/stable/gtk3-Clipboards.html#gtk-clipboard-s... which might be relevant.
Hi Sam, By any chance, do yo know were I can find the structure for GtkClipboard?
Well, I went digging through the gtk source. There ain't no gtk_clipboard_store any more, and a grep on the type said this:
[~/src/gtk(git:master)]fleet2*> agf GtkClipboard NEWS.pre-3.0 5465:* GtkClipboard 5525:* GtkClipboard 6751:* Add types for GtkRowReference, GtkClipboard [Jonathan Blandford, James Henstridge, Owen]
docs/reference/gtk/migrating-3to4.md 427:### Replace GtkClipboard with GdkClipboard 429:The `GtkClipboard` API has been removed, and replaced by #GdkClipboard. 485:The convenience API for specific target types in `GtkClipboard` has been 488:| GtkClipboard | GType |
So I'd say you've got a version 4 Gtk kit.
You say you need help with the gtk3 clipboard - maybe your dev stuff isn't version 3?
Here's the relevant bit:
https://gitlab.gnome.org/GNOME/gtk/-/blob/master/docs/reference/gtk/migratin...
The architectural issue you're dealing with (aside from the API change) is that a clipboard needs to be stored somewhere.
The basic X11 clipboard stuff stores it on the server in some global properties (there are 2 flavours of that, too, one with a primary and secondary clipboard and anthor with a ring of 10 buffers). For added fun, the clipboard is owned by a particular X11 client - when the client goes, so does the value, in part for cleanup and in part because in principle the client is involved in returning the contents, as you're supposed to be able to indicate what kind of contents you need (a float, some text, some rich text, maybe an image) - the clipboard's a reference and the client supplies it on demand.
From earlier comments in this thread I gather Gtk supports a special client which is a clipboard manager, which stored stuff for people. Possibly persistently (means, to me, over a logout/login or alternatively just beyond the life of the client the clip came from).
Anyway, the above suggests the API have changed. See the web page above for the stuff you're meant to use now.
Cheers, Cameron Simpson cs@cskk.id.au
On 1/12/21 1:27 PM, Cameron Simpson wrote:
On 12Jan2021 11:59, ToddAndMargo ToddAndMargo@zoho.com wrote:
On 1/12/21 11:29 AM, Samuel Sieb wrote:
See if it works, but there's also https://developer.gnome.org/gtk3/stable/gtk3-Clipboards.html#gtk-clipboard-s... which might be relevant.
Hi Sam, By any chance, do yo know were I can find the structure for GtkClipboard?
Well, I went digging through the gtk source. There ain't no gtk_clipboard_store any more, and a grep on the type said this:
[~/src/gtk(git:master)]fleet2*> agf GtkClipboard NEWS.pre-3.0 5465:* GtkClipboard 5525:* GtkClipboard 6751:* Add types for GtkRowReference, GtkClipboard [Jonathan Blandford, James Henstridge, Owen] docs/reference/gtk/migrating-3to4.md 427:### Replace GtkClipboard with GdkClipboard 429:The `GtkClipboard` API has been removed, and replaced by #GdkClipboard. 485:The convenience API for specific target types in `GtkClipboard` has been 488:| GtkClipboard | GType |
So I'd say you've got a version 4 Gtk kit.
You say you need help with the gtk3 clipboard - maybe your dev stuff isn't version 3?
Here's the relevant bit:
https://gitlab.gnome.org/GNOME/gtk/-/blob/master/docs/reference/gtk/migrating-3to4.md#replace-gtkclipboard-with-gdkclipboard
The architectural issue you're dealing with (aside from the API change) is that a clipboard needs to be stored somewhere.
The basic X11 clipboard stuff stores it on the server in some global properties (there are 2 flavours of that, too, one with a primary and secondary clipboard and anthor with a ring of 10 buffers). For added fun, the clipboard is owned by a particular X11 client - when the client goes, so does the value, in part for cleanup and in part because in principle the client is involved in returning the contents, as you're supposed to be able to indicate what kind of contents you need (a float, some text, some rich text, maybe an image) - the clipboard's a reference and the client supplies it on demand.
From earlier comments in this thread I gather Gtk supports a special client which is a clipboard manager, which stored stuff for people. Possibly persistently (means, to me, over a logout/login or alternatively just beyond the life of the client the clip came from).
Anyway, the above suggests the API have changed. See the web page above for the stuff you're meant to use now.
Cheers, Cameron Simpson cs@cskk.id.au
I willcheck out those links.
No "4", yet
$ ls /usr/lib64/libgtk-* /usr/lib64/libgtk-1.2.so.0 /usr/lib64/libgtk-vnc-2.0.so.0 /usr/lib64/libgtk-1.2.so.0.9.1 /usr/lib64/libgtk-vnc-2.0.so.0.0.2 /usr/lib64/libgtk-3.so /usr/lib64/libgtk-x11-2.0.so /usr/lib64/libgtk-3.so.0 /usr/lib64/libgtk-x11-2.0.so.0 /usr/lib64/libgtk-3.so.0.2404.20 /usr/lib64/libgtk-x11-2.0.so.0.2400.33