Re: Why is gtk_widget_get_clipboard() disabled?



On Wed, 6 Aug 2003 12:18:15 -0400 (EDT), muppet wrote:

Is there any special reason for gtk_widget_get_clipboard() being
disabled?

beyond the primary authors using mostly gtk+ 2.0, which doesn't have
GtkClipboard... um...  i think it just got overlooked when clipboard
and atom support finally found its way in.  i'll add it posthaste.  in
fact, with the default of GDK_SELECTION_CLIPBOARD, which the docs say
is the default clipboard (correct me if there's a better default).

I think "CLIPBOARD" is fine. The other alternative the API documentation
mentions is "PRIMARY", but since most widgets that have something to be
selected already take care of it automagically noone should have to code
primary selection stuff manually.

Is there another (better?) way to get a GtkClipboard? I tried
Gtk2::Clipboard -> new($atom) but although it apparently returned a
properly blessed object, GLib complained as soon as I tried to use
said object:

you probably got the inherited Glib::Object constructor, which did not
do The Right Thing, since it is actually an abstract factory-style
constructor[1]. according to the API reference, you need to use

  $cliboard = Gtk2::Clipboard->get ($atom);

I'm embarrassed that I overlooked that function. (Its prototype is way
too small to be spotted in the synopsis!)

[1] i'm not sure of the right way around this problem, other than a
FAQ answer saying use ->get instead of ->new.

Unless everybody is as blind as me, I think no additional documentation
is needed since the API documentation clearly states how to get a
GtkClipboard.

Thanks for the fix.

Bye,
-Torsten



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