I need to use Gtk.Clipboard.set_with_data in Gtk3 to be able to pass through the clipboard files between Nautilus 40 and Desktop Icons NG, but although it does exist in C and Vala, it isn’t available in the documentation of the Javascript bindings (DevDocs ). Is it a bug, or that method can’t be used from Javascript? What alternative do I have in that case?
It’s marked as non-introspectable. I can’t tell for sure whether that annotation is correct in this case, but I suspect it is given that the old selection API is known to be awkward for introspection.
The closure passed to set_with_data() can be called multiple times, which means its scope cannot really be async; and it does not have a destroy notification, which means it cannot be notified either. Also, it has the same data pointer for two closures, which is unsupported.
The entire GtkClipboard API is really an old school, Xlib-like API, written long before introspection was a thing. It entirely relies on something calling it from C.