GTK Selection Question



Hi,

I'm having a problem with selections.  I can't seem to get the simple
selection example in the GTK+-2.0 tutorial to work. I remember the
example (which is almost the same) in the chapter on selections from
Donna Martin's book - GTK+ Programming in 21 Days worked under GTK+-1.2.
With GTK+-2.0 neither work.

When I cut and paste the tutorial example and compile and run it,
instead of lisiting the available selection targets "TIMESTAMP, TARGETS,
MULTIPLE" it reports the error

Selection "TARGETS" was not returned as atoms!

However if I claim ownership of the selection first by calling:

gtk_selection_owner_set(window, GDK_SELECTION_PRIMARY, time);

before I call gtk_selection_convert(), and after receiving the selection
call:

gtk_selection_owner_set(NULL, GDK_SELECTION_PRIMARY, time);

It works OK.

Is this what you are supposed to do, even just when retrieving the list
of the available targets.

Any advice would be appreciated

Jeff Franks.






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