FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

How to enable drag and drop in a TreeView

 
Post new topic   Reply to topic     Forum Index -> gtkD
View previous topic :: View next topic  
Author Message
skirino



Joined: 17 Jun 2010
Posts: 4

PostPosted: Thu Jun 17, 2010 1:04 pm    Post subject: How to enable drag and drop in a TreeView Reply with quote

Hi,

I'm writing a simple application that uses TreeView and ListStore and now I want to add drag and drop functionality.
So I used TreeView.enableModelDragDest and TreeView.enableModelDragSource, and made a derived class of ListStore that implements functions in TreeDragDestIF and TreeDragSourceIF.
But unfortunately it doesn't work, the functions of my derived class are not called when a row is dragged.

Am I missing something important?
How should I implement drag and drop in TreeView?

Thanks in advance.
Back to top
View user's profile Send private message
Mike Wey



Joined: 07 May 2007
Posts: 428

PostPosted: Fri Jun 18, 2010 2:16 pm    Post subject: Reply with quote

Implementing interfaces is difficult in gtkD at the moment.

You can see in http://www.dsource.org/projects/gtkd/browser/trunk/src/gtk/TreeModel.d how the treemodel interface is implemented.
Back to top
View user's profile Send private message
skirino



Joined: 17 Jun 2010
Posts: 4

PostPosted: Sat Jun 19, 2010 11:13 pm    Post subject: Reply with quote

Thanks to the reply, now I understand (to some extent) the difficulty to bridge the gap between D's interfaces and GObject's interfaces.

I tried in many ways but the implementation in TreeModel.d is probably not directly applicable to my purpose (to override ListStore's methods that belong to TreeDragDestIF and TreeDragSourceIF).
In the meantime I need to learn about the type system of GObject and how vtables for interfaces are treated internally.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic     Forum Index -> gtkD All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group