Copy-Paste operations



How do I get (and set) the copypaste selection using gtk?

This is some information that I've found myself
so far I havn't got it working...

http://developer.gnome.org/doc/API/gtk/gtk-selections.html
http://developer.gnome.org/doc/API/2.0/gtk/gtk-clipboards.html

Using this 

...
   GtkClipboard *clipb;

   clipb = gtk_clipboard_get(GDK_NONE); /* GDK_SELECTION_PRIMARY */
   g_warning("text %s", gtk_clipboard_wait_for_text(clipb));
...

I get

[root freax src]# make
gcc -DDEBUG -DHAVE_CONFIG_H -I. -I. -I.. -I../intl     
-I/usr/lib/glib/include -I/usr/X11R6/include    -g -O2 -Wall -c callbacks.c
In file included from callbacks.c:11:
netcode.c: In function `get_string':
netcode.c:29: warning: function returns address of local variable
callbacks.c: In function `on_button_set_clicked':
callbacks.c:21: `GtkClipboard' undeclared (first use in this function)
callbacks.c:21: (Each undeclared identifier is reported only once
callbacks.c:21: for each function it appears in.)
callbacks.c:21: `clip' undeclared (first use in this function)
callbacks.c:21: warning: statement with no effect
callbacks.c:42: `clipb' undeclared (first use in this function)
callbacks.c:42: warning: implicit declaration of function
`gtk_clipboard_get'
callbacks.c:43: warning: implicit declaration of function
`gtk_clipboard_wait_for_text'
callbacks.c:43: warning: format argument is not a pointer (arg 4)
callbacks.c:20: warning: unused variable `selection'
make: *** [callbacks.o] Error 1
[root freax src]# 


Can sombody provide me with some examples maybe?

-- 
Philip van Hoof aka freax (http://www.freax.eu.org)
irc: irc.openprojects.net mailto:freax @ pandora.be





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