Create  Edit  FrontPage  Index  Search  Changes  History  RSS  Back  Login

tut-gtk2-treev Diff - Ruby-GNOME2 Project Website

  • Added parts are displayed like this.
  • Deleted parts are displayed like this.

= The Tree View Widget
{{link "tut-gtk2-txtw-tyu", "tut-gtk2-treev", "tut-gtk", "tut-gtk2-treev-parts"}}

:Contents of this chapter:

  * 8 ((<The Tree View Widget|tut-gtk2-treev>)) (this page)
    * 1 8.1 ((<Parts of a Tree View|tut-gtk2-treev-parts>))
      * 1.1 8.1.1 ((<Gtk::TreeModel|tut-gtk2-treev-parts#Gtk::TreeModel>))
      * 1.2 8.1.2 ((<Gtk::TreeViewColumn and Gtk::CellRenderer|tut-gtk2-treev-parts#Gtk::TreeViewColumn and Gtk::CellRenderer>))
      * 1.3 8.1.3 ((<Using Gtk::ListStore|tut-gtk2-treev-parts#Using Gtk::ListStore>))
      * 1.4 8.1.4 ((<Renderers and Columns|tut-gtk2-treev-parts#Renderers and Columns>))
        * 8.1.4.1 ((<Don't confuse model columns with a view columns|tut-gtk2-treev-parts#A tree model column should not be confused with a tree view column>))
        * 8.1.4.2 ((<TreeViewColumn and CellRenderer|tut-gtk2-treev-parts#Gtk::TreeViewColumn and Gtk::CellRenderer>))

      * 1.5 8.1.5 ((<Creating the Gtk::ListStore|tut-gtk2-treev-parts#Creating the Gtk::ListStore>))
      * 1.6 8.1.6 ((<Sorting tree view|tut-gtk2-treev-parts#Sorting Tree View>))
    * 2 8.2 ((<Using Gtk::TreeStore|tut-gtk2-treev-trees>))
      * 2.1 8.2.1 ((<Data Organization Within a Tree Store|tut-gtk2-treev-trees#Data Organization Within a Tree Store>))
        * 2.1.1 8.2.1.1 ((<Building a Multilayered Tree Store|tut-gtk2-treev-trees#Building a Multilayered Tree Store>))
      * 2.2 8.2.2 ((<Cell Data Function|tut-gtk2-treev-trees#Cell Data Function>))
      * 2.3 8.2.3 ((<Multidimensional Tree Store|tut-gtk2-treev-trees#Multidimensional Tree Store>))
        * 2.3.1 8.2.3.1 ((<Tedious Job Of Loading Multidimensional Tree Store|tut-gtk2-treev-trees#Tedious Job Of Loading Multidimensional Tree Store>))
      * 2.4 8.2.4 ((<Multi-item Super Columns|tut-gtk2-treev-trees#Multi-item Super Columns>))
    * 3 8.3 ((<Referencing Rows|tut-gtk2-treev-rr>))
      * 3.1 8.3.1 ((<Tree Path|tut-gtk2-treev-rr#Tree Path>))
      * 3.2 8.3.2 ((<Tree Iterators|tut-gtk2-treev-rr#Tree Iterators>))
      * 3.3 8.3.3 ((<Tree Row References|tut-gtk2-treev-rr#Tree Row References>))
    * 4 8.4 ((<Adding Rows and Handling Selections|tut-gtk2-treev-addrnhs>))
      * 4.1 8.4.1 ((<Single Selections|tut-gtk2-treev-addrnhs#Single Selections>))
      * 4.2 8.4.2 ((<Multiple Selections|tut-gtk2-treev-addrnhs#Multiple Selections>))
      * 4.3 8.4.3 ((<Adding New Rows|tut-gtk2-treev-addrnhs#Adding New Rows>))
      * 4.4 8.4.4 ((<Combo Box|tut-gtk2-treev-addrnhs#Combo Box>))
      * 4.5 8.4.5 ((<Removing Multiple Rows|tut-gtk2-treev-addrnhs#Removing Multiple Rows>))
    * 5 8.5 ((<Editable Text Renderers|tut-gtk2-treev-etr>))
    * 6 8.6 ((<Cell Data Functions|tut-gtk2-treev-cdf>))  [II (redundant/see: 2.2 above)]
    * 7 8.7 ((<Cell Renderers|tut-gtk2-treev-crs>))
      * 7.1 8.7.1 ((<Toggle Button Renderers|tut-gtk2-treev-crs#Toggle Button Renderers>))
        * 7.1.1 8.7.1.1 ((<Toggle Button Renderers May Effect Other Related Values In Tree View|tut-gtk2-treev-crs#Toggle Button Renderers May Effect Other Related Values In Tree View>))
        * 7.1.2 8.7.1.2 ((<Data Dependencies Between Cells In Different Columns And Rows In Tree View|tut-gtk2-treev-crs#Data Dependencies Between Cells In Different Columns And Rows In Tree View>))
      * 7.2 8.7.2 ((<Pixbuf Renderers|tut-gtk2-treev-pxbr>))
      * 7.3 8.7.3 ((<Spin Button Renderers|tut-gtk2-treev-spbttr>)) (!,f){{image_right("dialog-warning-s2.png")}}Renderers|tut-gtk2-treev-spbttr>))
      * 7.4 8.7.4 ((<Combo Box Renderers|tut-gtk2-treev-cbbr>)) (!,f)Renderers|tut-gtk2-treev-cbbr>))
        * 7.4.1 8.7.4.1 ((<Progress Bar Renderers|tut-gtk2-treev-cbbr#Progress Bar Renderers>))
      * 7.5 8.7.5 ((<Keyboard Accelerator Renderers|tut-gtk2-treev-kbda>))


This chapter will show you how to use the Gtk::ScrolledWindow widget in combination with another powerful widget known as Gtk::TreeView. The tree view widget can be used to display data lists or trees spanning many columns. For example applications such as file browsers or project builders and IDEs can be implemented using Gtk::TreeView widget.

Gtk::TreeView is a powerful and complex feature reach widget that may be intimidating to learn. However once you get to know it enough you will be able to apply it in many applications.

:In this chapter you will learn:

    * What objects are used to create a Gtk::TreeView, and how its MVC (model-view-controller) design makes it unique.
    * How to create lists and tree structures with the Gtk::TreeView widget.
    * When to use Gtk::TreePath, Gtk::TreeIter, and Gtk::TreeRowReference to reference rows within a Gtk::TreeView.
    * How to create editable tree view cells or customize individual cells with cell renderer functions.
    * The widgets you can embed within a cell, including toggle buttons, pixbufs, spin buttons, combo boxes, progress bars, and keyboard accelerator strings.


Following are the major classes and interfaces directly related to our topic

:Related classes and interfaces:
    * Gtk::TreeModel (interface)
    * Gtk::ListStore
    * Gtk::TreeStore
    * Gtk::TreeIter
    * Gtk::TreeView
    * Gtk::TreeViewColumn
    * Gtk::CellRenderer