GtkGrid indexes / relative position of two widgets


is it somehow possible to get the index of the position which a widget of a GtkGrid has? I have only seen functions which operate relative to a sibling.

If I have two widgets A and B and I need to decide if A's current position in the grid is before or behind B and then insert A left or right of B. I need this to implement drag and drop of widgets in the grid.


A at position 5
B at position 9

After dragging A onto B, A should be inserted right of B (at position 10)

A at position 9
B at position 5

After dragging B onto A, A should be inserted left of B (at position 4)

My current drag and drop code already works, besides the fact that I can move a widget to the most right position of the grid because I'm always inserting the widget A to the left of B, since I have no means of deciding if A was left or right of B before.

Can someone suggest a solution? Is this even possible with GtkGrid?

Also my Grid has only one row.

Best Regards

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