Gtk3 - treview - drag and drop




Hello,

I have a TreeView with data model which has two logical element types - Groups and Points. I would like preserve to the only records with a "GROUP" type could be parenting. Elements of a type "POINT" must be childless.

I want to let moving the Groups, Points or the branches by drag and drop. It is seamless.

But I need make a test of the destination type when the element is dropped, and abort the drag and drop action, if destinaton element is not a type "GROUP". How to achieve this?

The ideal would be if carried out evaluated targets before drop, and dissable dropping on not a GROUP type rows.

but it will suffice, if the drag and drop action will be evaluated after drop event (before insert rows into data model) and eventually will be D'N'D canceled.

As a suitable place for such a test I try to connect handler to signal "drag-drop" on the GtkTreeView. Interrupting the D'N'D action I can make by a return code, but how do I find the target iter from this place? What better place for this?

Michal


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