Re: Storing cut/copy URIs into Gtk::Clipboard
- From: Murray Cumming <murrayc murrayc com>
- To: Jiergir Ogoerg <f35f22fan gmail com>
- Cc: gtkmm-list gnome org
- Subject: Re: Storing cut/copy URIs into Gtk::Clipboard
- Date: Thu, 25 Jul 2013 09:18:38 +0200
On Wed, 2013-07-24 at 13:40 +0300, Jiergir Ogoerg wrote:
Hi,
The question is about the C++ (mm) backend.
Gtk::Clipboard has 2 options: (1) store data which is available also
after the app quits until someone cleans up the clipboard, or (2)
provide a function to be called to fill in the clipboard on request.
Unless this is for very small amounts of data, I think you should want
to always provide a function, and call set_can_store() if you want that
function to be called when the application quits. Otherwise, you'd be
copying large amounts of data when calling the set_*() convenience
methods.
I need to use the 1st option since the URIs must stay in clipboard
after the app exits, but there are only methods for text and images:
set_text() or set_image(), then set_can_store() then store().
So how do I store() as URIs?
Use case: I (need to) put the string as URI with a "cut\n" or "copy\n"
in front of it so that nautilus provides a "paste" option in the
right-click menu.
gtk_clipboard_set_text() just copies the text and uses
gtk_clipboard_set_with_data() (Gtk::Clipboard::set() in gtkmm) to
provide that copied data in future.
--
Murray Cumming
murrayc murrayc com
www.murrayc.com
www.openismus.com
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]