Drag and drop in C# using GtkSharp (GTK#)

Viewed 115

I want to rewrite an existing app of mine to be cross-platform, and I found GtkSharp, which allows me to make an UI that works on all 3 Desktop OS, the problem is that the app I want to recode, has a drag and drop feature and I can't get it to work in GtkSharp.

private MainWindow(Builder builder) : base(builder.GetRawOwnedObject("MainWindow"))
{
builder.Autoconnect(this);
_notebook.DragDrop += DragBegin;
}

private void SideloadLayout_DragBegin(object sender, DragDropArgs a)
{
Console.WriteLine("drag drop!");
}

Works for drag and drop on windows, but not on linux, also does not pass any important data such as the file path

I made a new project file, with just a gtk fixed

[UI] private Fixed _tree = null;
Drag.DestSet(this._tree, 0, null, Gdk.DragAction.Move);

            _tree.DragDataGet += Tree_DragDataGet
            _tree.DragDataGet += Tree_DragBegin;
            _tree.DragMotion += Tree_DragMotion;
            _tree.DragDrop += Tree_DragDrop;
            _tree.DragDataReceived += Tree_DragDataReceived;
            _tree.DragEnd += (o, e) => Console.WriteLine("a");

This causes the event DragMotion to fire, but the rest does not.

0 Answers
Related