ruby-****@sourc*****
ruby-****@sourc*****
2012年 12月 16日 (日) 07:46:50 JST
------------------------- REMOTE_ADDR = 184.145.81.223 REMOTE_HOST = URL = http://ruby-gnome2.sourceforge.jp/hiki.cgi?tut-gtk2-dnd-native-treev ------------------------- @@ -40,7 +40,7 @@ {{image_right("treeview-builtin-dnd-s1.png")}} -Next 'treeview-built-in-dnd.rb' example program will show that only with a line of code you can get the complete drag-and-drop behaviour for free. All you need is to set up the reorderable attribute to true, by using the 'Gtk::TreeView#reorderable=' method. The drag objects here are the tree view rows, regardless whether they are leaf or node items with children. When you left-click, hold the mouse button down and drag the mouse simultaneously the cursor changes to the 'move-icon' and the row you are dragging appears underneath it. If you look carefully, when dragging, you will notice that a potential drop position is shown, namely, the items over which you are dragging the row get highlighted, and the when you are in-between i.e., above or below rows, a line appears. If you are dropping the dragged row onto a highlighted row it will become it's child, but if you drop it when the line indicator is shown, the dragged item will be placed at that position. +Next 'treeview-built-in-dnd.rb' example program will show that only with a line of code you can get the complete drag-and-drop behaviour for free. All you need is to set up the reorderable attribute to true, by using the 'Gtk::TreeView#reorderable=' method. The drag objects here are the tree view rows, regardless whether they are leaf or node items with children. When you left-click, hold the mouse button down and drag the mouse simultaneously the cursor changes to the 'move-icon' and the row you are dragging appears underneath it. If you look carefully, when dragging, you will notice that a potential drop position is shown, namely, the items over which you are dragging the row get highlighted, and when you are in-between i.e., above or below rows, a line appears. If you are dropping the dragged row onto a highlighted row it will become it's child, but if you drop it when the line indicator is shown, the dragged item will be placed at that position.