PHP-GTK2 Cookbook Forum
Welcome, Guest
Please Login or Register.    Lost Password?
Re:Drag-n-drop auto scroll / auto expand? (1 viewing) (1) Guest
Go to bottom Post Reply Favoured: 0
TOPIC: Re:Drag-n-drop auto scroll / auto expand?
#1202
prggr (User)
Fresh Boarder
Posts: 11
graphgraph
User Offline Click here to see the profile of this user
Drag-n-drop auto scroll / auto expand? 1 Month, 2 Weeks ago Karma: 0  
Before I go wasting the time implementing this myself, is there a way to have GTK auto scroll on the drop destination? Also, can it automatically expand a tree view? I've got a simple list being dragged onto a tree which works fine, but it doesn't auto scroll nor auto expand the tree.. I'm pretty sure there's enough bits a pieces around for me to try to do it myself, but it seems like something that should be built-in.

Oh, also I don't seem to be able to do a multi-select drag and drop. Whenever I try, it knocks the selection down to one item and goes from there.

Thanks!
 
  The administrator has disabled public write access.
#1203
prggr (User)
Fresh Boarder
Posts: 11
graphgraph
User Offline Click here to see the profile of this user
Re:Drag-n-drop auto scroll / auto expand? 1 Month, 2 Weeks ago Karma: 0  
Hrm, well partially figured out the multi-select drag and drop.. Seems that if you shift-select a bunch of rows, then do a separate click of the mouse to drag, it just selects that one item. If you shift-click-drag as one action, it works fine. Kinda of annoying, but at least there is one solution..
 
  The administrator has disabled public write access.
#1211
kksou (Admin)
Admin
Posts: 443
graph
User Online Now Click here to see the profile of this user
Re:Drag-n-drop auto scroll / auto expand? 1 Month, 2 Weeks ago Karma: 8  
Hi,

On drop, after you've copied the dragged the content, you should still have the row and column of the place where the user dropped the content. With the row and column information,

1. Use the method
GtkTreeview::scroll_to_cell (path, [GtkTreeViewColumn column])
to do the auto scrolling.

2. Use GtkTreeView::expand_all()
or
GtkTreeView::expand_row(path)
to
expand the treeview.

Regards,
/kksou
 
  The administrator has disabled public write access.
#1223
prggr (User)
Fresh Boarder
Posts: 11
graphgraph
User Offline Click here to see the profile of this user
Re:Drag-n-drop auto scroll / auto expand? 1 Month, 1 Week ago Karma: 0  
Looks like I can hack together something with those methods. I was hoping there was just some flag I could set to make Gtk do it for me. :)
 
  The administrator has disabled public write access.
Go to top Post Reply
Powered by FireBoardget the latest posts directly to your desktop

Blog - Forum - Privacy Policy - Contact Us
Copyright © 2006-2009. kksou.com. All Rights Reserved