Re: Getting string from clippboard (bug of gtk?)



On Tue, 7 Dec 1999, Koshelev Maxim wrote:

Hello,

> Can anybody write for me full sequense for getting
> string which is contained in clipboard (selection) in functions
> of gdk. I was trying to make it via GtkEntry's functions
> but: for getting something from clippboard GtkEntry must be
> realized and it must not retrieve selection contents before.

Look at UNIX version of MpCb (http://www.idata.sk/~robo/mpcb/),
which works as client/server for sharing clipboard over network between
different X11 workstations (also native Win32 version is available, which 
enables you to share clipboard between Unix and Windoze)

Here is small HowTo retrieve selection :

At first assign any signal hadler for "selection_received" to any widget,
which will get the selection.
When you want to retrieve selection, launch function
gtk_selection_convert() and when the selection is ready, signal handler
for "selection_received" get called. Bellow is sample how that signal
handler should looks like. Structure GtkSelectionData will contain all
required informations about retrieved selection.

static void FetchSelection(widget, selection_data, data)
GtkWidget *widget;
GtkSelectionData *selection_data;
gpointer data;
{
}


With best regards,
Stevo.

-- 
Stefan Ondrejicka <ondrej@idata.sk>
Beethovenova 11, 917 08 Trnava, Slovakia
http://www.idata.sk/~ondrej/



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