Most of the reference documentation of gtkmm is copied from gtk+. The
documentation of Gtk::Clipboard::set_can_store() is copied from
gtk_clipboard_set_can_store(). It says /This value is reset when the
clipboard owner changes/. That's cryptic. It means that your first call
to Gtk::Clipboard::get() cancels the effect of set_can_store(). (Perhaps
all calls to get() cancel the effect of set_can_store(), I'm not sure.)
It would be possible to add some less cryptic documentation to
Gtk::Clipboard::set_can_store(), but it would be much better to have it
added to the description of gtk_clipboard_set_can_store() in gtk+, and
then copied to gtkmm.
Changing the unintuitive dependency between set() and set_can_store()
might not be feasible. All running applications share the same
clipboard. That imposes some restrictions on what can be done. If it's
possible to change the dependency, it must be done in gtk+.
Kjell
2013-07-26 13:19, Jiergir Ogoerg skrev:
While trying to provide you an example I found out by accident what's
the problem: you must call clipboard->set_can_store() _after_
clipboard->set(targets, get_slot, clear_slot), which is not mentioned
in the documentation and to me is a bug.
Now that I changed from:
Glib::RefPtr<Gtk::Clipboard> clipboard = Gtk::Clipboard::get();
clipboard->set_can_store();
clipboard->set(targets, slot_get, slot_clear);
to:
Glib::RefPtr<Gtk::Clipboard> clipboard = Gtk::Clipboard::get();
clipboard->set(targets, slot_get, slot_clear);
clipboard->set_can_store();
it works. Please either mention this in the gtkmm documentation, or
(which is more appropriate) make the clipboard saving data not depend
on this obscure and counter intuitive requirement.
_______________________________________________
gtkmm-list mailing list
[email protected]
https://mail.gnome.org/mailman/listinfo/gtkmm-list