[ruby-gnome2-doc-cvs] [Ruby-GNOME2 Project Website] update - tut-gtk2-dnd-native-treev

Back to archive index

ruby-****@sourc***** ruby-****@sourc*****
2012年 12月 15日 (土) 05:29:22 JST


-------------------------
REMOTE_ADDR = 184.145.81.223
REMOTE_HOST = 
        URL = http://ruby-gnome2.sourceforge.jp/hiki.cgi?tut-gtk2-dnd-native-treev
-------------------------
@@ -18,10 +18,19 @@
 # (10.3)
 == DnD Widgets With Their Own Gdk::Window
 
+
+Now that we have learned the basics of drag-and-drop mechanism exploring the widgets without their own Gdk::Window, which we also dubbed "widgets without native DnD support", it is time to look at those GTk widgets, that do support DnD by design. Since these Gtk widgets have built in drag-and-drop mechanism, they in general require very little or no additional coding. However, sometimes you are not satisfied with the default dnd behaviour, and you may need to try to implement some customized dnd functionality. Gtk widgets provide a number of methods, attributes and signals that comprise "dnd infrastructure" to help you mould the DnD behaviour to better fit your needs. In the continuation of this chapter we will investigate both of these options and mechanisms. The most prominent widgets from this category are the Gtk::TreeView, Gtk::TextViev, and Gtk::IconView.
+
+
+
+
 # (10.3.1)
 === DnD Tree View Items
+
+The Gtk::TreeView widget is one of those widgets where dragged and dropping objects are strictly the items belonging to a particular data structures and/or hierarchies and must be of a rather particular format, namely, the rows of predetermined sets of columns stored in related data models or data stores. This particularity about data structure and format is best met if dragging and dropping occurs within the same widget, i.e. you should always be able to drag one row within a list or a tree view to a new location, as long as the drop occurs in the same widget in which the drag also started. Currently this is even more true for a generic Gtk library, used by languages like Ruby, Python and alike, than is for the original GTK+ C and C++ (a.k.a. gtkmm) implementations. Namely, the original GTK+ implementation allows you to drag rows of data from one list/tree view to another, i.e. in GTK+ you are not limited to the single widget, as you are in Ruby or Python when using Gtk+.
+
+When using DnD mechanism to move around rows within single tree or list view, you are actually employing the native DnD facilities. We will look at these next.
 
-Some Gtk widgets have built in drag-and-drop mechanism, which require very little or no additional coding. Such a widget is Gtk::TreeView. However, sometimes you are not satisfied with the default dnd behaviour, and you may need to try to implement some customized dnd functionality. As you will see Gtk::TreeView provides a number of methods to help you accomplish this. We will investigate some of these issues in our example after the next one.
 
 
 # (10.3.1.1)




ruby-gnome2-cvs メーリングリストの案内
Back to archive index