Re: Clipboard IO under GTK/GDK?



On Sun, 8 Oct 2000 learfox furry ao net wrote:

Is there a way to copy data to and from the clipboard using GTK/GDK?

I have some text (not from a gtk editable or entry) that I need to copy
and paste.

What should I do? (Keep in mind I don't have any experiance on Gnome if
you plan to recommend that) *G*

I'm trying to do the same thing myself!  *grin*  I'm a newbie still, so if
I get some stuff wrong, I hope someone can correct me.

Alan Cox has a small program called googlizer which does copying from the
clipboard.  Take a look at the source code for details:

    http://ftp.linux.org.uk/pub/linux/alan/googlizer.tar.gz

Basically, first have your program listen to "selection_received" events.  
Next, when you want to get the current clipboard, call
gtk_selection_convert() to get gtk+ to fire off a selection_received
signal.

However, I'm still trying to get copying to the clipboard to work.  The
Gtk tutorial mentions how to do this under "Selections", but I'm trying to
figure out how it works with pygtk.

The relevant section for the gtk+ tutorial is here:

    http://gtk.org/tutorial/gtk_tut-19.html

Good luck!





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]