Re: GTK4: gtk_tree_view_enable_model_drag_dest () and GdkContentFormats



On 12.03.2018 19:45, Marcus Schätzle wrote:
Hi all,

I've done a port of a program to GTK4 (3.93.3); there is a part that I have not yet gotten to work and that is drag and drop inside a tree view.

I have particularly trouble understanding using the target formats inside gtk_tree_view_enable_model_drag_dest (). For the GTK 3 version I use a GtkTargetEntry structure initialised with {{ "STRING", GTK_TARGET_SAME_WIDGET, 0 }}, which has always worked fine so far.

That is surprising. Usually i'd go for "UTF8_STRING".

For GTK 4 I am supposed to use GdkContentFormats. But which mime types am I supposed to fill into gtk_content_formats_new ()?

"text/plain;charset=utf-8" is the GTK4 equivalent of "UTF8_STRING"

That's all i know.

Note that last time i checked there was a bug that prevented DnD from working correctly in some cases. For example, DnD of text didn't work for GtkTextView, but did work for GtkEntry.

Attachment: signature.asc
Description: OpenPGP digital signature



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]