Re: Storing cut/copy URIs into Gtk::Clipboard



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.


In case it matters: running Ubuntu 13.04 amd64 gtkmm-3.0 (which is 3.6 really)


On Fri, Jul 26, 2013 at 12:09 PM, Murray Cumming <murrayc murrayc com> wrote:
On Thu, 2013-07-25 at 16:00 +0300, Jiergir Ogoerg wrote:
> Thanks,
>
> but I can't find in your answer how I can store in the clipboard URIs
> to stay in the clipboard after the app quits, which is the whole point
> of this thread (to me).
>
> And yes, of course I won't store like 500MB of URIs, we're talking
> common sense: my file browser cuts/copies a list of file paths stored
> as URIs in the clipboard and
> the user should be able to paste them into nautilus after he closes my
> file browser.

I am simply suggesting that you store the URIs in the clipboard however
is appropriate, regardless of the issue of what happens when the app
closes, and then just call set_can_store() to fix that other problem.

If you've tried that and it doesn't work, maybe we can discuss that.



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