Код: Выделить всё
// ...
char* buffer;
gsize length;
file->load_contents(buffer, length);
auto content_bytes = Glib::Bytes::create(buffer, length);
provided_content = Gdk::ContentProvider::create(columns->content_type, content_bytes);
return provided_content;
< /code>
в определении сигнала Droptarget Drop Callback, например: < /p>
// setup drag and drop target
auto drag_target = Gtk::DropTarget::create(G_TYPE_BYTES, Gdk::DragAction::MOVE);
drag_target->signal_drop().connect([this](const Glib::ValueBase& value, double x, double y) -> bool {
if (G_VALUE_HOLDS(value.gobj(), Glib::Value::value_type())) {
}
}, false);
< /code>
Но я получаю ошибку: < /p>
In template: static assertion failed due to requirement 'std::is_default_constructible()': T should be default constructibleclang(static_assert_requirement_failed)
https://gnome.pages.gitlab.gnome.org/gt ... ample.html Glib :: valueglib :: Bytes:
Подробнее здесь: https://stackoverflow.com/questions/796 ... bytes-type
Мобильная версия