3

I am writing a application based on gtk::Clipboard in using the gtk-rs crate. I have already initialized a Clipboard like this:

let clipboard = gtk::Clipboard::get(&gdk::SELECTION_PRIMARY);

It is able to print the selected text by using clipboard.wait_for_text() in loop.

However, I only need the text when the selection changes. How can I connect a handling function to the owner-change event emitted from clipboard?

In Python, it could be implemented like this

clipboard = Gtk.Clipboard.get(Gdk.SELECTION_PRIMARY)
clipboard.connect("owner-change", foo)
Shepmaster
  • 388,571
  • 95
  • 1,107
  • 1,366
H.D. Lin
  • 33
  • 3

1 Answers1

1

clipboard.rs contains the following comment:

//pub fn connect_owner_change<Unsupported or ignored types>(&self, f: F) -> SignalHandlerId {
//    Ignored event: Gdk.EventOwnerChange
//}

so this feature is likely not (yet) supported.

Shepmaster
  • 388,571
  • 95
  • 1,107
  • 1,366
Laney
  • 1,571
  • 9
  • 7