Install ardour as a binary, a script and a set of shared
[ardour.git] / libs / gtkmm2 / gtk / gtkmm / treeview.h
1 // -*- c++ -*-
2 // Generated by gtkmmproc -- DO NOT MODIFY!
3 #ifndef _GTKMM_TREEVIEW_H
4 #define _GTKMM_TREEVIEW_H
5
6 #include <glibmm.h>
7
8 /* $Id$ */
9
10 /* Copyright(C) 2002 The gtkmm Development Team
11  *
12  * This library is free software; you can redistribute it and/or
13  * modify it under the terms of the GNU Library General Public
14  * License as published by the Free Software Foundation; either
15  * version 2 of the License, or(at your option) any later version.
16  *
17  * This library is distributed in the hope that it will be useful,
18  * but WITHOUT ANY WARRANTY; without even the implied warranty of
19  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
20  * Library General Public License for more details.
21  *
22  * You should have received a copy of the GNU Library General Public
23  * License along with this library; if not, write to the Free
24  * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
25  */
26
27 #include <glibmm/listhandle.h>
28 #include <gtkmm/container.h>
29 #include <gtkmm/adjustment.h>
30 #include <gdkmm/pixmap.h>
31 #include <gtkmm/treeviewcolumn.h>
32 #include <gtkmm/treeselection.h>
33 #include <gtkmm/treemodelcolumn.h>
34 #include <gtkmm/cellrenderer.h>
35 #include <gtkmm/targetentry.h>
36
37
38 #ifndef DOXYGEN_SHOULD_SKIP_THIS
39 typedef struct _GtkTreeView GtkTreeView;
40 typedef struct _GtkTreeViewClass GtkTreeViewClass;
41 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
42
43
44 namespace Gtk
45 { class TreeView_Class; } // namespace Gtk
46 namespace Gtk
47 {
48
49
50 /** @addtogroup gtkmmEnums Enums and Flags */
51
52 /**
53  * @ingroup gtkmmEnums
54  */
55 enum TreeViewDropPosition
56 {
57   TREE_VIEW_DROP_BEFORE,
58   TREE_VIEW_DROP_AFTER,
59   TREE_VIEW_DROP_INTO_OR_BEFORE,
60   TREE_VIEW_DROP_INTO_OR_AFTER
61 };
62
63 } // namespace Gtk
64
65
66 #ifndef DOXYGEN_SHOULD_SKIP_THIS
67 namespace Glib
68 {
69
70 template <>
71 class Value<Gtk::TreeViewDropPosition> : public Glib::Value_Enum<Gtk::TreeViewDropPosition>
72 {
73 public:
74   static GType value_type() G_GNUC_CONST;
75 };
76
77 } // namespace Glib
78 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
79
80
81 namespace Gtk
82 {
83
84
85 #ifndef DOXYGEN_SHOULD_SKIP_THIS
86
87 class TreeView;
88
89 namespace TreeView_Private
90 {
91 /* This helper function is not a member of TreeView just for the reason that
92  * there are compilers that have problems compiling it otherwise. E.g. in gcc
93  * 2.95.3 a compiler bug prevents member functions from refering to specialized
94  * member function templates and that's what we do here: In function
95  * _connect_auto_store_editable_signal_handler we build a slot from
96  * TreeView::_auto_store_on_cellrenderer_*_edited. (The latter must be member
97  * functions of TreeView since we connect them to signals and we want the
98  * connections to vanish when the TreeView dies, of course.)
99  */
100   template <class ColumnType> inline
101   void _connect_auto_store_editable_signal_handler(Gtk::TreeView* this_p, Gtk::CellRenderer* pCellRenderer, const Gtk::TreeModelColumn<ColumnType>& model_column);
102
103   template<class ColumnType> inline
104   void _auto_store_on_cellrenderer_text_edited_string(const Glib::ustring& path_string, const Glib::ustring& new_text, int model_column, Gtk::TreeView*);
105
106   template <class ColumnType> inline
107   void _auto_store_on_cellrenderer_text_edited_numerical(const Glib::ustring& path_string, const Glib::ustring& new_text, int model_column, Gtk::TreeView*); 
108   
109   template <class ColumnType> inline
110   void _auto_cell_data_func(Gtk::CellRenderer* cell, const Gtk::TreeModel::iterator& iter, int model_column, const Glib::ustring& format);
111 }
112
113 #endif //DOXYGEN_SHOULD_SKIP_THIS
114
115
116 //class TreeViewColumn;
117 class TreeModel;
118
119 /** @defgroup TreeView TreeView Classes
120  * These classes are used with the Gtk::TreeView widget.
121  */
122
123 /** The TreeView widget displays the model (Gtk::TreeModel) data and allows the user to interact with it.
124  * The View can show all of the model's columns, or just some, and it can show them in various ways.
125  * You must provide the TreeModel in the constructor, or with set_model().
126  *
127  * Add View columns with append_column(), append_column_editable(), insert_column(), or insert_column_editable().
128  *
129  * You can manipulate the selection by obtaining the @link Gtk::TreeSelection Gtk::TreeView::Selection@endlink from get_selection().
130  *
131  * @ingroup Widgets
132  * @ingroup Containers
133  * @ingroup TreeView
134  */
135
136 class TreeView : public Container
137 {
138   public:
139 #ifndef DOXYGEN_SHOULD_SKIP_THIS
140   typedef TreeView CppObjectType;
141   typedef TreeView_Class CppClassType;
142   typedef GtkTreeView BaseObjectType;
143   typedef GtkTreeViewClass BaseClassType;
144 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
145
146   virtual ~TreeView();
147
148 #ifndef DOXYGEN_SHOULD_SKIP_THIS
149
150 private:
151   friend class TreeView_Class;
152   static CppClassType treeview_class_;
153
154   // noncopyable
155   TreeView(const TreeView&);
156   TreeView& operator=(const TreeView&);
157
158 protected:
159   explicit TreeView(const Glib::ConstructParams& construct_params);
160   explicit TreeView(GtkTreeView* castitem);
161
162 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
163
164 public:
165 #ifndef DOXYGEN_SHOULD_SKIP_THIS
166   static GType get_type()      G_GNUC_CONST;
167   static GType get_base_type() G_GNUC_CONST;
168 #endif
169
170   ///Provides access to the underlying C GtkObject.
171   GtkTreeView*       gobj()       { return reinterpret_cast<GtkTreeView*>(gobject_); }
172
173   ///Provides access to the underlying C GtkObject.
174   const GtkTreeView* gobj() const { return reinterpret_cast<GtkTreeView*>(gobject_); }
175
176
177 public:
178   //C++ methods used to invoke GTK+ virtual functions:
179
180 protected:
181   //GTK+ Virtual Functions (override these to change behaviour):
182
183   //Default Signal Handlers::
184   virtual void on_set_scroll_adjustments(Adjustment* hadjustment, Adjustment* vadjustment);
185   virtual void on_row_activated(const TreeModel::Path& path, TreeViewColumn* column);
186   virtual bool on_test_expand_row(const TreeModel::iterator& iter, const TreeModel::Path& path);
187   virtual bool on_test_collapse_row(const TreeModel::iterator& iter, const TreeModel::Path& path);
188   virtual void on_row_expanded(const TreeModel::iterator& iter, const TreeModel::Path& path);
189   virtual void on_row_collapsed(const TreeModel::iterator& iter, const TreeModel::Path& path);
190   virtual void on_cursor_changed();
191   virtual void on_columns_changed();
192
193
194 private:
195
196   
197 public:
198   /**  A visible column in a Gtk::TreeView widget.
199    */
200   typedef TreeViewColumn Column;
201   
202   /** A selection object for Gtk::TreeView.
203    */
204   typedef TreeSelection Selection;
205   /**
206      Default constructor
207    */
208   TreeView();
209   /**
210      Constructor that binds to a TreeModel
211    */
212   explicit TreeView(const Glib::RefPtr<TreeModel>& model);
213
214   
215   /** Returns the model the the Gtk::TreeView is based on.  Returns <tt>0</tt> if the
216    * model is unset.
217    * @return A Gtk::TreeModel, or <tt>0</tt> if none is currently being used.
218    */
219   Glib::RefPtr<TreeModel> get_model();
220   
221   /** Returns the model the the Gtk::TreeView is based on.  Returns <tt>0</tt> if the
222    * model is unset.
223    * @return A Gtk::TreeModel, or <tt>0</tt> if none is currently being used.
224    */
225   Glib::RefPtr<const TreeModel> get_model() const;
226   
227   /** Sets the model for a Gtk::TreeView.  If the @a tree_view  already has a model
228    * set, it will remove it before setting the new model.  If @a model  is <tt>0</tt>, 
229    * then it will unset the old model.
230    * @param model The model.
231    */
232   void set_model(const Glib::RefPtr<TreeModel>& model);
233   
234   /** Gets the Gtk::TreeSelection associated with @a tree_view .
235    * @return A Gtk::TreeSelection object.
236    */
237   Glib::RefPtr<TreeSelection> get_selection();
238   
239   /** Gets the Gtk::TreeSelection associated with @a tree_view .
240    * @return A Gtk::TreeSelection object.
241    */
242   Glib::RefPtr<const TreeSelection> get_selection() const;
243   
244   /** Gets the Gtk::Adjustment currently being used for the horizontal aspect.
245    * @return A Gtk::Adjustment object, or <tt>0</tt> if none is currently being
246    * used.
247    */
248   Adjustment* get_hadjustment();
249   
250   /** Gets the Gtk::Adjustment currently being used for the horizontal aspect.
251    * @return A Gtk::Adjustment object, or <tt>0</tt> if none is currently being
252    * used.
253    */
254   const Adjustment* get_hadjustment() const;
255   
256   /** Sets the Gtk::Adjustment for the current horizontal aspect. See also unset_hadjustment().
257    * @param adjustment The Gtk::Adjustment to set.
258    */
259   void set_hadjustment(Adjustment& adjustment);
260   
261   /** This method removes the hadjustment.
262    * @see set_hadjustment().
263    */
264   void unset_hadjustment();
265   
266   
267   /** Gets the Gtk::Adjustment currently being used for the vertical aspect.
268    * @return A Gtk::Adjustment object, or <tt>0</tt> if none is currently being
269    * used.
270    */
271   Adjustment* get_vadjustment();
272   
273   /** Gets the Gtk::Adjustment currently being used for the vertical aspect.
274    * @return A Gtk::Adjustment object, or <tt>0</tt> if none is currently being
275    * used.
276    */
277   const Adjustment* get_vadjustment() const;
278   
279   /** Sets the Gtk::Adjustment for the current vertical aspect. See also unset_vadjustment().
280    * @param adjustment The Gtk::Adjustment to set.
281    */
282   void set_vadjustment(Adjustment& adjustment);
283   
284   /** This method removes the vadjustment.
285    * @see set_vadjustment().
286    */
287   void unset_vadjustment();
288   
289   
290   /** Returns <tt>true</tt> if the headers on the @a tree_view  are visible.
291    * @return Whether the headers are visible or not.
292    */
293   bool get_headers_visible() const;
294   
295   /** Sets the the visibility state of the headers.
296    * @param headers_visible <tt>true</tt> if the headers are visible.
297    */
298   void set_headers_visible(bool headers_visible);
299   
300   /** Resizes all columns to their optimal width. Only works after the
301    * treeview has been realized.
302    */
303   void columns_autosize();
304   
305   /** Allow the column title buttons to be clicked.
306    * @param setting <tt>true</tt> if the columns are clickable.
307    */
308   void set_headers_clickable(bool setting = true);
309   
310   /** This function tells GTK+ that the user interface for your
311    * application requires users to read across tree rows and associate
312    * cells with one another. By default, GTK+ will then render the tree
313    * with alternating row colors. Do <em>not</em> use it
314    * just because you prefer the appearance of the ruled tree; that's a
315    * question for the theme. Some themes will draw tree rows in
316    * alternating colors even when rules are turned off, and users who
317    * prefer that appearance all the time can choose those themes. You
318    * should call this function only as a <em>semantic</em>
319    * hint to the theme engine that your tree makes alternating colors
320    * useful from a functional standpoint (since it has lots of columns,
321    * generally).
322    * @param setting <tt>true</tt> if the tree requires reading across rows.
323    */
324   void set_rules_hint(bool setting = true);
325   
326   /** Gets the setting set by set_rules_hint().
327    * @return <tt>true</tt> if rules are useful for the user of this tree.
328    */
329   bool get_rules_hint() const;
330
331   
332   /** Appends @a column  to the list of columns. If @a tree_view  has "fixed_height"
333    * mode enabled, then @a column  must have its "sizing" property set to be
334    * GTK_TREE_VIEW_COLUMN_FIXED.
335    * @param column The Gtk::TreeViewColumn to add.
336    * @return The number of columns in @a tree_view  after appending.
337    */
338   int append_column(TreeViewColumn& column);
339
340   /** Appends a View column with the appropriate CellRenderer for the Model column.
341    *
342    * The CellRenderer can only be created automatically for some basic
343    * column types, such as Glib::ustring, int, double, bool, and Gdk::Pixbuf. 
344    * If the type is not supported then the following warning will be shown:
345    * GLib-GObject-WARNING **: unable to set property `text' of type
346    * `gchararray' from value of type `glibmm__CustomBoxed_t'.
347    *
348    * If the default formatting is not sufficient, or the numeric type is 
349    * not supported, then you could use append_column_numeric(). Or you 
350    * could create the TreeView::Column and/or CellRenderer
351    * manually and use TreeViewColumn::set_cell_data_func() to provide a callback 
352    * that converts the model value into a string representation with .
353    *
354    * @param title The text to be used in the title header of this column.
355    * @param model_column The column in the TreeModel that will be rendered by this View column.
356    * @result The number of columns in the View after appending.
357    */
358   template <class ColumnType> inline
359   int append_column(const Glib::ustring& title, const TreeModelColumn<ColumnType>& model_column);
360
361   /** Like append_column(), but only for numeric types, which will be displayed in the specified format.
362    * This convenience template uses TreeView::Column::set_cell_data_func(), so the numeric formatting will 
363    * be deactivated if you specify your own cell_data callback by calling set_cell_data_func() again.
364    *
365    * @param title The text to be used in the title header of this column.
366    * @param model_column The column in the TreeModel that will be rendered by this View column.
367    * @param format A printf-style format, such as "%d", used to create a text representation of the number.
368    * @result The number of columns in the View after appending.
369    */
370   template <class ColumnType> inline
371   int append_column_numeric(const Glib::ustring& title, const TreeModelColumn<ColumnType>& model_column, const Glib::ustring& format);
372   
373   //TODO: danielk suggested use of Glib::Value to simplify/improve this.
374   /** Appends a View column with the appropriate CellRenderer for the Model
375    * column.  The compiler will attempt to instantiate appropriate template
376    * code to automatically store user changes in the model.  To intercept the
377    * user's change and implement non-default logic, or if the compiler can't
378    * instantiate appropriate code for your model type, you could use
379    * append_column() and connect a signal handler to the CellRenderer.
380    *
381    * @see append_column_numeric_editable().
382    *
383    * @param title The text to be used in the title header of this column.
384    * @param model_column The column in the TreeModel that will be rendered by this View column.
385    * @result The number of columns in the View after appending.
386    */
387   template <class ColumnType> inline
388   int append_column_editable(const Glib::ustring& title, const TreeModelColumn<ColumnType>& model_column);
389
390   /** Like append_column_editable(), but only for numeric types, which will be displayed in the specified format.
391    * This convenience template uses TreeView::Column::set_cell_data_func(), so the numeric formatting will 
392    * be deactivated if you specify your own cell_data callback by calling set_cell_data_func() again.
393    *
394    * Note that the user's input will be interpreted as decimal (base 10), regardless of the @a format.
395    *
396    * @param title The text to be used in the title header of this column.
397    * @param model_column The column in the TreeModel that will be rendered by this View column.
398    * @param format A printf-style format, such as "%d", used to create a text representation of the number.
399    * @result The number of columns in the View after appending.
400    */
401   template <class ColumnType> inline
402   int append_column_numeric_editable(const Glib::ustring& title, const TreeModelColumn<ColumnType>& model_column, const Glib::ustring& format);
403
404   
405   /// Creates a View column containing the CellRenderer, and appends it.
406   int append_column(const Glib::ustring& title, CellRenderer& cell);
407
408   
409   /** Removes @a column  from @a tree_view .
410    * @param column The Gtk::TreeViewColumn to remove.
411    * @return The number of columns in @a tree_view  after removing.
412    */
413   int remove_column(TreeViewColumn& column);
414
415   /// Removes all View columns.
416   void remove_all_columns();
417
418   
419   /** This inserts the @a column  into the @a tree_view  at @a position .  If @a position  is
420    * -1, then the column is inserted at the end. If @a tree_view  has
421    * "fixed_height" mode enabled, then @a column  must have its "sizing" property
422    * set to be GTK_TREE_VIEW_COLUMN_FIXED.
423    * @param column The Gtk::TreeViewColumn to be inserted.
424    * @param position The position to insert @a column  in.
425    * @return The number of columns in @a tree_view  after insertion.
426    */
427   int insert_column(TreeViewColumn& column, int position);
428
429   /** Creates a View column containing the CellRenderer, and inserts it.
430    *
431    * @param title The text to be used in the title header of this column.
432    * @param cell The CellRenderer.
433    * @param position The position at which the CellRenderer should be inserted.
434    * @result The number of columns in the View after inserting.
435    */
436   int insert_column(const Glib::ustring& title, CellRenderer& cell, int position);
437
438   
439   /** Inserts a View column with the appropriate CellRenderer for the Model column.
440    *
441    * @param title The text to be used in the title header of this column.
442    * @param model_column The column in the TreeModel that will be rendered by this View column.
443    * @param position The position at which the CellRenderer should be inserted.
444    * @result The number of columns in the View after inserting.
445    */
446   template <class ColumnType> inline
447   int insert_column(const Glib::ustring& title, const TreeModelColumn<ColumnType>& model_column, int position);
448
449   /** Inserts a View column with the appropriate CellRenderer for the Model
450    * column.  The compiler will attempt to instantiate appropriate template
451    * code to automatically store user changes in the model.  To intercept the
452    * user's change and implement non-default logic, or if the compiler can't
453    * instantiate appropriate code for your model type, you should use
454    * append_column() and connect a signal handler to the CellRenderer.
455    *
456    * @param title The text to be used in the title header of this column.
457    * @param model_column The column in the TreeModel that will be rendered by this View column.
458    * @param position The position at which the CellRenderer should be inserted.
459    * @result The number of columns in the View after inserting.
460    */
461   template <class ColumnType> inline
462   int insert_column_editable(const Glib::ustring& title, const TreeModelColumn<ColumnType>& model_column, int position);
463
464   typedef TreeViewColumn::SlotCellData SlotCellData;
465   
466   /**
467    * Inserts a new column into the TreeView with the given cell
468    * renderer and a SlotCellData to set cell renderer attributes
469    * (normally using data from the model). 
470    *
471    * @param position Position to insert, -1 for append
472    * @param title column title
473    * @param cell cell renderer for column
474    * @param slot function to set attributes of cell renderer
475    * @return number of columns in the TreeView after the insert
476    */
477   int insert_column_with_data_func(int position, const Glib::ustring& title, CellRenderer& cell, const SlotCellData& slot);
478
479   
480   /** Gets the Gtk::TreeViewColumn at the given position in the #tree_view.
481    * @param n The position of the column, counting from 0.
482    * @return The Gtk::TreeViewColumn, or <tt>0</tt> if the position is outside the
483    * range of columns.
484    */
485   TreeViewColumn* get_column(int n);
486   
487   /** Gets the Gtk::TreeViewColumn at the given position in the #tree_view.
488    * @param n The position of the column, counting from 0.
489    * @return The Gtk::TreeViewColumn, or <tt>0</tt> if the position is outside the
490    * range of columns.
491    */
492   const TreeViewColumn* get_column(int n) const;
493
494   //The column index is of the view, not the model, so we do not need TreeViewColumn* get_column(TreeViewColumn& base_column).
495
496   /** Gets the CellRenderer for that column.
497     * You should dynamic_cast<> to the expected derived CellRenderer type.
498     * This assumes that the TreeViewColumn contains only one CellRenderer.
499     *
500     * @param n The position of the view column.
501     * @result The CellRenderer.
502     */
503   CellRenderer* get_column_cell_renderer(int n);
504
505  //TODO: Add TreeViewColumn* get_column_cell_renderer(TreeViewColumn& base_column); and a const one.
506
507
508   /** Gets the CellRenderer for that column.
509     * You should dynamic_cast<> to the expected derived CellRenderer type.
510     * This assumes that the TreeViewColumn contains only one CellRenderer.
511     *
512     * @param n The position of the view column.
513     * @result The CellRenderer.
514     */
515   const CellRenderer* get_column_cell_renderer(int n) const;
516
517   
518   /** Returns a list of all the Gtk::TreeViewColumn s currently in @a tree_view .
519    * @return A list of Gtk::TreeViewColumn s.
520    */
521   Glib::ListHandle<TreeViewColumn*> get_columns();
522   
523   /** Returns a list of all the Gtk::TreeViewColumn s currently in @a tree_view .
524    * @return A list of Gtk::TreeViewColumn s.
525    */
526   Glib::ListHandle<const TreeViewColumn*> get_columns() const;
527   
528   
529   /** Moves @a column  to be after to @a base_column .  See also move_column_to_start().
530    * @param column The Gtk::TreeViewColumn to be moved.
531    * @param base_column The Gtk::TreeViewColumn to be moved relative to.
532    */
533   void move_column_after(TreeViewColumn& column, TreeViewColumn& base_column);
534
535   /** This method moves column to the first position in the view.
536    *
537    * @param column The view column that will be moved
538    */
539   void move_column_to_start(TreeViewColumn& column);
540   
541   
542   /** Sets the column to draw the expander arrow at. It must be in the TreeView.  See also reset_expander_column().
543    * @param column The column to draw the expander arrow at.
544    */
545   void set_expander_column(TreeViewColumn& column);
546   
547   /** This method resets the expander arrow to the default - the first visible column.
548    * @see set_expander_column().  
549    */
550   void reset_expander_column();
551   
552   
553   /** Returns the column that is the current expander column.  This
554    * column has the expander arrow drawn next to it.
555    * @return The expander column.
556    */
557   TreeViewColumn* get_expander_column();
558   
559   /** Returns the column that is the current expander column.  This
560    * column has the expander arrow drawn next to it.
561    * @return The expander column.
562    */
563   const TreeViewColumn* get_expander_column() const;
564
565   /** For instance,
566    * bool on_column_drop(TreeView*, tree_view, TreeViewColumn* column, TreeViewColumn* prev_column, TreeViewColumn* next_column)
567    *
568    * This function is called on every column pair in turn at the beginning of a column drag to determine where a
569    * drop can take place. The arguments passed to the function are: the tree_view, the view Column being dragged,
570    * and the two view Columns determining the drop spot. If either of the view Column arguments for the drop spot
571    * are 0, then they indicate an edge.
572    */
573   typedef sigc::slot<bool, TreeView*, TreeViewColumn*,  TreeViewColumn*, TreeViewColumn*> SlotColumnDrop;
574
575   /** Sets a callback slot for determining where a column may be dropped when dragged.
576    * This function is called on every column pair in turn at the beginning of a column drag to determine where a
577    * drop can take place. The arguments passed to the function are: the tree_view, the view Column being dragged,
578    * and the two view Columns determining the drop spot. If either of the view Column arguments for the drop spot
579    * are 0, then they indicate an edge.
580    *
581    * See unset_column_drag_function().
582    *
583    * @param slot A callback function to determine which columns are reorderable.
584    */
585   void set_column_drag_function(const SlotColumnDrop& slot);
586   
587
588   /** See set_column_drag_function(). After this method has been called, the TreeView reverts to the default behavior of
589   * allowing all columns to be dropped everywhere.
590   */
591   void unset_column_drag_function();
592    
593   
594   /** Scrolls the tree view such that the top-left corner of the visible
595    * area is @a tree_x , @a tree_y , where @a tree_x  and @a tree_y  are specified
596    * in tree window coordinates.  The @a tree_view  must be realized before
597    * this function is called.  If it isn't, you probably want to be
598    * using scroll_to_cell().
599    * 
600    * If either @a tree_x  or @a tree_y  are -1, then that direction isn't scrolled.
601    * @param tree_x X coordinate of new top-left pixel of visible area, or -1.
602    * @param tree_y Y coordinate of new top-left pixel of visible area, or -1.
603    */
604   void scroll_to_point(int tree_x, int tree_y);
605
606   /** Moves the alignments of tree view to the position specified by @a column and @a path.
607    * @a row_align determines where the row is placed, and @a col_align determines where
608    * column is placed. Both are expected to be between 0.0 and 1.0. 0.0 means left/top
609    * alignment, 1.0 means right/bottom alignment, 0.5 means center.
610    *
611    * This function only works if the model is set, and @a path is a valid row on the model.
612    * If the model changes before the tree view is realized, the centered path will be
613    * modified to reflect this change.
614    *
615    * @param path The path of the row to move to.
616    * @param column The Gtk::TreeViewColumn to move horizontally to.
617    * @param row_align The vertical alignment of the row specified by @a path.
618    * @param col_align The horizontal alignment of the column specified by @a column.
619    */
620   void scroll_to_cell(const TreeModel::Path& path, TreeViewColumn& column, float row_align, float col_align);
621   
622
623   /** Moves the alignments of tree view to the position specified by @a column and @a path.
624    * The tree does the minimum amount of work to scroll the cell onto the screen. This means
625    * that the cell will be scrolled to the edge closest to it's current position. If the cell
626    * is currently visible on the screen, nothing is done.
627    *
628    * This function only works if the model is set, and @a path is a valid row on the model.
629    * If the model changes before the tree_view is realized, the centered path will be modified
630    * to reflect this change.
631    *
632    * @param path The path of the row to move to.
633    * @param column The Gtk::TreeViewColumn to move horizontally to.
634    */
635   void scroll_to_cell(const TreeModel::Path& path, TreeViewColumn& column);
636
637   /** Moves the alignments of tree view to the position specified by @a path.
638    * @a row_align determines where the row is placed, and is expected to be between 0.0
639    * and 1.0.  0.0 means top alignment, 1.0 means bottom alignment, 0.5 means center.
640    *
641    * This function only works if the model is set, and @a path is a valid row on the model.
642    * If the model changes before the tree view is realized, the centered path will be
643    * modified to reflect this change.
644    *
645    * @param path The path of the row to move to.
646    * @param row_align The vertical alignment of the row specified by @a path.
647    */
648   void scroll_to_row(const TreeModel::Path& path, float row_align);
649
650   /** Moves the alignments of tree view to the position specified by @a path.
651    * The tree does the minimum amount of work to scroll the row onto the screen. This means
652    * that the row will be scrolled to the edge closest to it's current position. If the row
653    * is currently visible on the screen, nothing is done.
654    *
655    * This function only works if the model is set, and @a path is a valid row on the model.
656    * If the model changes before the tree view is realized, the centered path will be
657    * modified to reflect this change.
658    *
659    * @param path The path of the row to move to.
660    */
661   void scroll_to_row(const TreeModel::Path& path);
662
663   /** Moves the alignments of tree view to the position specified by @a column.
664    * @a col_align determines where the column is placed, and is expected to be between 0.0
665    * and 1.0.  0.0 means left alignment, 1.0 means right alignment, 0.5 means center.
666    *
667    * This function only works if the model is set.  If the model changes before the tree
668    * view is realized, the centered path will be modified to reflect this change.
669    *
670    * @param column The Gtk::TreeViewColumn to move horizontally to.
671    * @param col_align The horizontal alignment of the column specified by @a column.
672    */
673   void scroll_to_column(TreeViewColumn& column, float col_align);
674
675   /** Moves the alignments of tree view to the position specified by @a column.
676    * The tree does the minimum amount of work to scroll the column onto the screen. This means
677    * that the column will be scrolled to the edge closest to it's current position. If the column
678    * is currently visible on the screen, nothing is done.
679    *
680    * This function only works if the model is set.  If the model changes before the
681    * tree view is realized, the centered path will be modified to reflect this change.
682    *
683    * @param column The Gtk::TreeViewColumn to move horizontally to.
684    */
685   void scroll_to_column(TreeViewColumn& column);
686
687   
688   /** Activates the cell determined by @a path  and @a column .
689    * @param path The Gtk::TreePath to be activated.
690    * @param column The Gtk::TreeViewColumn to be activated.
691    */
692   void row_activated(const TreeModel::Path& path,TreeViewColumn& column);
693   
694   /** Recursively expands all nodes in the @a tree_view .
695    */
696   void expand_all();
697   
698   /** Recursively collapses all visible, expanded nodes in @a tree_view .
699    */
700   void collapse_all();
701   
702   /** Expands the row at @a path . This will also expand all parent rows of
703    *  @a path  as necessary.
704    * 
705    * Since: 2.2
706    * @param path Path to a row.
707    */
708   void expand_to_path(const TreeModel::Path& path);
709   
710   /** Opens the row so its children are visible.
711    * @param path Path to a row.
712    * @param open_all Whether to recursively expand, or just expand immediate children.
713    * @return <tt>true</tt> if the row existed and had children.
714    */
715   bool expand_row(const TreeModel::Path& path, bool open_all);
716   
717   /** Collapses a row (hides its child rows, if they exist).
718    * @param path Path to a row in the @a tree_view .
719    * @return <tt>true</tt> if the row was collapsed.
720    */
721   bool collapse_row(const TreeModel::Path& path);
722
723   /** For example,
724    * void on_map_expanded_rows(TreeView* tree_view, const TreeModel::Path& path);
725    */
726   typedef sigc::slot<void, TreeView*, const TreeModel::Path&> SlotMapping;
727
728   /** Calls the callback slot on all expanded rows.
729    * @param slot A callback function to be called.
730    */  
731   void map_expanded_rows(const SlotMapping& slot);
732   
733
734   /** Returns <tt>true</tt> if the node pointed to by @a path  is expanded in @a tree_view .
735    * @param path A Gtk::TreePath to test expansion state.
736    * @return <tt>true</tt> if #path is expanded.
737    */
738   bool row_expanded(const TreeModel::Path& path);
739   
740   /** This function is a convenience function to allow you to reorder models that
741    * support the Gtk::DragSourceIface and the Gtk::DragDestIface.  Both
742    * Gtk::TreeStore and Gtk::ListStore support these.  If @a reorderable  is <tt>true</tt>, then
743    * the user can reorder the model by dragging and dropping rows.  The
744    * developer can listen to these changes by connecting to the model's
745    * row_inserted and row_deleted signals.
746    * 
747    * This function does not give you any degree of control over the order -- any
748    * reordering is allowed.  If more control is needed, you should probably
749    * handle drag and drop manually.
750    * @param reorderable <tt>true</tt>, if the tree can be reordered.
751    */
752   void set_reorderable(bool reorderable = true);
753   
754   /** Retrieves whether the user can reorder the tree via drag-and-drop. See
755    * set_reorderable().
756    * @return <tt>true</tt> if the tree can be reordered.
757    */
758   bool get_reorderable() const;
759
760   //TODO: Add set_cursor(path, ModelColumnBase&, start_editing)?
761   
762   /** Sets the current keyboard focus to be at @a path , and selects it.  This is
763    * useful when you want to focus the user's attention on a particular row. Focus is given to the column specified.
764    * Additionally, if @a start_editing  is
765    * <tt>true</tt>, then editing should be started in the specified cell.
766    * This function is often followed by Gtk::Widget::grab_focus( @a tree_view )
767    * in order to give keyboard focus to the widget.  Please note that editing
768    * can only happen when the widget is realized.
769    * @param path A Gtk::TreePath.
770    * @param focus_column A Gtk::TreeViewColumn.
771    * @param start_editing <tt>true</tt> if the specified cell should start being edited.
772    */
773   void set_cursor(const TreeModel::Path& path, TreeViewColumn& focus_column, bool start_editing = false);
774     
775   
776   /** Sets the current keyboard focus to be at @a path , and selects it.  This is
777    * useful when you want to focus the user's attention on a particular row.  If
778    *  @a focus_column  is not <tt>0</tt>, then focus is given to the column specified by
779    * it. If @a focus_column  and @a focus_cell  are not <tt>0</tt>, and @a focus_column 
780    * contains 2 or more editable or activatable cells, then focus is given to
781    * the cell specified by @a focus_cell . Additionally, if @a focus_column  is
782    * specified, and @a start_editing  is <tt>true</tt>, then editing should be started in
783    * the specified cell.  This function is often followed by
784    *  @a gtk_widget_grab_focus  ( @a tree_view ) in order to give keyboard focus to the
785    * widget.  Please note that editing can only happen when the widget is
786    * realized.
787    * 
788    * Since: 2.2
789    * @param path A Gtk::TreePath.
790    * @param focus_column A Gtk::TreeViewColumn, or <tt>0</tt>.
791    * @param focus_cell A Gtk::CellRenderer, or <tt>0</tt>.
792    * @param start_editing <tt>true</tt> if the specified cell should start being edited.
793    */
794   void set_cursor(const TreeModel::Path& path, TreeViewColumn& focus_column, CellRenderer& focus_cell, bool start_editing = false);
795
796  
797   /** Sets the current keyboard focus to be at path , and selects it.
798    * This is useful when you want to focus the user's attention on a particular row.
799    * This function is often followed by Gtk::widget::grab_focus(tree_view)
800    * in order to give keyboard focus to the widget.
801    *
802    *  @param path A reference to cursor path.
803    */
804   void set_cursor(const TreeModel::Path& path);
805
806   /**  Fills in path and focus_column with the current path and focus column.
807    *
808    *  @param path A reference to be filled with the current cursor path
809    *  @param focus_column A reference to be filled with the current focus column
810    */
811   void get_cursor(TreeModel::Path& path, TreeViewColumn*& focus_column);
812
813 /* Layout information */
814   
815   /** Returns the window that @a tree_view  renders to.  This is used primarily to
816    * compare to <tt>event->window</tt> to confirm that the event on
817    *  @a tree_view  is on the right window.
818    * @return A Gdk::Window, or <tt>0</tt> when @a tree_view  hasn't been realized yet.
819    */
820   Glib::RefPtr<Gdk::Window> get_bin_window();
821   
822   /** Returns the window that @a tree_view  renders to.  This is used primarily to
823    * compare to <tt>event->window</tt> to confirm that the event on
824    *  @a tree_view  is on the right window.
825    * @return A Gdk::Window, or <tt>0</tt> when @a tree_view  hasn't been realized yet.
826    */
827   Glib::RefPtr<const Gdk::Window> get_bin_window() const;
828
829   /** Finds the path at the point (x, y), relative to widget
830    * coordinates. It is primarily for things like popup menus.
831    *  
832    * @param x The x position to be identified
833    * @param y The y position to be identified
834    * @param path A reference to a TreeModel::Path to be filled in
835    * @param column A reference to a TreeViewColumn pointer to be filled in
836    * @param cell_x A reference where the X coordinate relative to the cell
837    *   can be placed
838    * @param cell_y A reference where the Y coordinate relative to the cell
839    *   can be placed
840    * @return true if a row exists at that coordinate.
841    */
842   bool get_path_at_pos(int x, int y, TreeModel::Path& path, TreeViewColumn*& column, int& cell_x, int& cell_y);
843   
844   /** Fills the bounding rectangle in tree window coordinates for the cell at the
845    * row specified by @a path  and the column specified by @a column .  If @a path  points to a path not currently displayed, the @a y  and @a height  fields
846    * of the rectangle will be filled with 0.  The sum of all cell rects does not cover the
847    * entire tree; there are extra pixels in between rows, for example. The
848    * returned rectangle is equivalent to the @a cell_area  passed to
849    * Gtk::CellRenderer::render().  This function is only valid if #tree_view is
850    * realized.
851    * @param path A Gtk::TreePath for the row.
852    * @param column A Gtk::TreeViewColumn for the column.
853    * @param rect Rectangle to fill with cell rect.
854    */
855   void get_cell_area(const TreeModel::Path& path, TreeViewColumn& column, Gdk::Rectangle&  rect);
856 //We ignore the fact that one of the arguments can be 0 - it does not seem useful.
857
858   
859   /** Fills the bounding rectangle in tree window coordinates for the cell at the
860    * row specified by @a path  and the column specified by @a column .  The returned rectangle is equivalent to the
861    *  @a background_area  passed to Gtk::CellRenderer::render().  These background
862    * areas tile to cover the entire tree window (except for the area used for
863    * header buttons). Contrast with the @a cell_area , returned by
864    * get_cell_area(), which returns only the cell itself, excluding
865    * surrounding borders and the tree expander area.
866    * @param path A Gtk::TreePath for the row.
867    * @param column A Gtk::TreeViewColumn for the column.
868    * @param rect Rectangle to fill with cell background rect.
869    */
870   void get_background_area(const TreeModel::Path& path, TreeViewColumn& column, Gdk::Rectangle& rect);
871   //We ignore the fact that one of the arguments can be 0 - it does not seem useful.
872
873   
874   /** Fills @a visible_rect  with the currently-visible region of the
875    * buffer, in tree coordinates. Convert to widget coordinates with
876    * tree_to_widget_coords(). Tree coordinates start at
877    * 0,0 for row 0 of the tree, and cover the entire scrollable area of
878    * the tree.
879    * @param visible_rect Rectangle to fill.
880    */
881   void get_visible_rect(Gdk::Rectangle&  visible_rect);
882   
883   /** Converts widget coordinates to coordinates for the
884    * tree window (the full scrollable area of the tree).
885    * @param wx Widget X coordinate.
886    * @param wy Widget Y coordinate.
887    * @param tx Return location for tree X coordinate.
888    * @param ty Return location for tree Y coordinate.
889    */
890   void widget_to_tree_coords(int wx, int wy, int& tx, int& ty);
891   
892   /** Converts tree coordinates (coordinates in full scrollable area of the tree)
893    * to widget coordinates.
894    * @param tx Tree X coordinate.
895    * @param ty Tree Y coordinate.
896    * @param wx Return location for widget X coordinate.
897    * @param wy Return location for widget Y coordinate.
898    */
899   void tree_to_widget_coords(int tx, int ty, int& wx, int& wy);
900
901 /* Drag-and-Drop support */
902   
903
904   /**
905    * Turns the TreeView into a drag source for automatic DND.
906    *
907    * @param targets Standard container of targets that the drag will support.
908    * @param start_button_mask Mask of allowed buttons to start drag.
909    * @param actions The bitmask of possible actions for a drag from this widget.
910    */
911   void enable_model_drag_source(const ArrayHandle_TargetEntry& targets,
912                                 Gdk::ModifierType start_button_mask = Gdk::MODIFIER_MASK,
913                                 Gdk::DragAction actions = Gdk::ACTION_COPY | Gdk::ACTION_MOVE);
914
915   // Uses the default "GTK_TREE_MODEL_ROW" target, which the TreeView can handle automatically.
916
917   /** Turns the TreeView into a drag source for automatic DND.
918    *
919    * @param start_button_mask Mask of allowed buttons to start drag.
920    * @param actions The bitmask of possible actions for a drag from this widget.
921    */
922   void enable_model_drag_source(Gdk::ModifierType start_button_mask = Gdk::MODIFIER_MASK,
923                                 Gdk::DragAction actions = Gdk::ACTION_COPY | Gdk::ACTION_MOVE);                                                                                              
924
925   
926   /** Turns the TreeViewinto a drop destination for automatic DND.
927    *
928    * @param targets The table of targets that the drag will support.
929    * @param actions The bitmask of possible actions for a drag from this widget.
930    */ 
931   void enable_model_drag_dest(const ArrayHandle_TargetEntry& targets, Gdk::DragAction actions = Gdk::ACTION_COPY | Gdk::ACTION_MOVE);
932
933   /** Turns the TreeView into a drop destination for automatic DND.  This uses the default
934     *  "GTK_TREE_MODEL_ROW" target, which the TreeView can handle automatically.
935     *
936     * @param actions The bitmask of possible actions for a drag from this widget.
937    */ 
938   void enable_model_drag_dest(Gdk::DragAction actions = Gdk::ACTION_COPY | Gdk::ACTION_MOVE);
939
940   /** Undoes the effect of enable_model_drag_source()
941    */
942   
943   /** Undoes the effect of enable_model_drag_source().
944    */
945   void unset_rows_drag_source();
946
947   /** Undoes the effect of enable_model_drag_source()
948    */
949   
950   /** Undoes the effect of enable_model_drag_dest().
951    */
952   void unset_rows_drag_dest();
953
954
955   /* These are useful to implement your own custom stuff. */
956
957   /** Sets the row that is highlighted for feedback.
958    *
959    * @param path The path of the row to highlight
960    * @param pos Specifies whether to drop before, after or into the row
961    */
962   
963   /** Sets the row that is highlighted for feedback.
964    * @param path The path of the row to highlight, or <tt>0</tt>.
965    * @param pos Specifies whether to drop before, after or into the row.
966    */
967   void set_drag_dest_row(const TreeModel::Path& path, TreeViewDropPosition pos);
968     
969   /** Gets information about the row that is highlighted for feedback.
970    *
971    * @param path Return location for the path of the highlighted row
972    * @param pos Return location for the drop position
973    */
974   void get_drag_dest_row(TreeModel::Path& path, TreeViewDropPosition& pos) const;
975
976   /** Determines the destination row for a given position.
977    *
978    * @param drag_x The x position to determine the destination row for
979    * @param drag_y The y position to determine the destination row for
980    * @param path Return location for the path of the highlighted row
981    * @param pos Return location for the drop position
982    */
983   bool get_dest_row_at_pos(int drag_x, int drag_y, TreeModel::Path& path, TreeViewDropPosition& pos) const;
984
985   
986   /** Creates a Gdk::Pixmap representation of the row at @a path .  This image is used
987    * for a drag icon.
988    * @param path A Gtk::TreePath in @a tree_view .
989    * @return A newly-allocated pixmap of the drag icon.
990    */
991   Glib::RefPtr<Gdk::Pixmap> create_row_drag_icon(const TreeModel::Path& path);
992
993 /* Interactive search */
994   
995   /** If @a enable_search  is set, then the user can type in text to search through
996    * the tree interactively.
997    * @param enable_search <tt>true</tt>, if the user can search interactively.
998    */
999   void set_enable_search(bool enable_search = true);
1000   
1001   /** Returns whether or not the tree allows interactive searching.
1002    * @return Whether or not to let the user search interactively.
1003    */
1004   bool get_enable_search() const;
1005   
1006   /** Gets the column searched on by the interactive search code.
1007    * @return The column the interactive search code searches in.
1008    */
1009   int get_search_column() const;
1010   
1011   /** Sets @a column  as the column where the interactive search code should
1012    * search in.  Additionally, turns on interactive searching. Note that
1013    *  @a column  refers to a column of the model.
1014    * @param column The column of the model to search in.
1015    */
1016   void set_search_column(const TreeModelColumnBase& column);
1017   
1018   /** Sets @a column  as the column where the interactive search code should
1019    * search in.  Additionally, turns on interactive searching. Note that
1020    *  @a column  refers to a column of the model.
1021    * @param column The column of the model to search in.
1022    */
1023   void set_search_column(int column);
1024
1025   ///void on_search_equal(const Glib::RefPtr<TreeModel>& model, int column, const Glib::ustring& key, const TreeModel::iterator& iter)
1026   typedef sigc::slot<bool, const Glib::RefPtr<TreeModel>&, int, const Glib::ustring&, const TreeModel::iterator&> SlotSearchEqual;
1027   //SlotSearchEqual get_search_equal_func();
1028   
1029   
1030   /** Sets the compare function for the interactive search capabilities.
1031    *
1032    * @param slot The compare function to use during the search
1033    */
1034   void set_search_equal_func(const SlotSearchEqual& slot);
1035   
1036
1037   /** Enables or disables the fixed height mode of @a tree_view . 
1038    * Fixed height mode speeds up Gtk::TreeView by assuming that all 
1039    * rows have the same height. 
1040    * Only enable this option if all rows are the same height and all
1041    * columns are of type Gtk::TREE_VIEW_COLUMN_FIXED.
1042    * 
1043    * Since: 2.6
1044    * @param enable <tt>true</tt> to enable fixed height mode.
1045    */
1046   void set_fixed_height_mode(bool enable = true);
1047   
1048   /** Returns whether fixed height mode is turned on for @a tree_view .
1049    * @return <tt>true</tt> if @a tree_view  is in fixed height mode
1050    * 
1051    * Since: 2.6.
1052    */
1053   bool get_fixed_height_mode() const;
1054   
1055   /** Enables of disables the hover selection mode of @a tree_view .
1056    * Hover selection makes the selected row follow the pointer.
1057    * Currently, this works only for the selection modes 
1058    * Gtk::SELECTION_SINGLE and Gtk::SELECTION_BROWSE.
1059    * 
1060    * Since: 2.6
1061    * @param hover <tt>true</tt> to enable hover selection mode.
1062    */
1063   void set_hover_selection(bool hover = true);
1064   
1065   /** Returns whether hover selection mode is turned on for @a tree_view .
1066    * @return <tt>true</tt> if @a tree_view  is in hover selection mode
1067    * 
1068    * Since: 2.6.
1069    */
1070   bool get_hover_selection() const;
1071   
1072   /** Enables of disables the hover expansion mode of @a tree_view .
1073    * Hover expansion makes rows expand or collaps if the pointer 
1074    * moves over them.
1075    * 
1076    * Since: 2.6
1077    * @param expand <tt>true</tt> to enable hover selection mode.
1078    */
1079   void set_hover_expand(bool expand = true);
1080   
1081   /** Returns whether hover expansion mode is turned on for @a tree_view .
1082    * @return <tt>true</tt> if @a tree_view  is in hover expansion mode
1083    * 
1084    * Since: 2.6.
1085    */
1086   bool get_hover_expand() const;
1087
1088   /** For instance,
1089    * void on_row_separator(const Gtk::TreeModel& model, const Gtk::TreeModel::iterator& iter);
1090    */
1091   typedef sigc::slot<bool, const Glib::RefPtr<TreeModel>&, const TreeModel::iterator&> SlotRowSeparator;
1092   
1093   void set_row_separator_func(const SlotRowSeparator& slot);
1094   
1095
1096   Glib::SignalProxy2< void,Adjustment*,Adjustment* > signal_set_scroll_adjustments();
1097
1098   
1099   Glib::SignalProxy2< void,const TreeModel::Path&,TreeViewColumn* > signal_row_activated();
1100
1101   
1102   Glib::SignalProxy2< bool,const TreeModel::iterator&,const TreeModel::Path& > signal_test_expand_row();
1103
1104   
1105   Glib::SignalProxy2< bool,const TreeModel::iterator&,const TreeModel::Path& > signal_test_collapse_row();
1106
1107   
1108   Glib::SignalProxy2< void,const TreeModel::iterator&,const TreeModel::Path& > signal_row_expanded();
1109
1110   
1111   Glib::SignalProxy2< void,const TreeModel::iterator&,const TreeModel::Path& > signal_row_collapsed();
1112
1113   
1114   Glib::SignalProxy0< void > signal_cursor_changed();
1115
1116   
1117   Glib::SignalProxy0< void > signal_columns_changed();
1118
1119
1120   //Don't wrap these. They are keybinding signals, and their API broke for GTK+ 2.2.
1121   
1122   
1123   /** The model for the tree view.
1124    *
1125    * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
1126    * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
1127    * the value of the property changes.
1128    */
1129   Glib::PropertyProxy< Glib::RefPtr<TreeModel> > property_model() ;
1130
1131 /** The model for the tree view.
1132    *
1133    * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
1134    * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
1135    * the value of the property changes.
1136    */
1137   Glib::PropertyProxy_ReadOnly< Glib::RefPtr<TreeModel> > property_model() const;
1138
1139   /** Horizontal Adjustment for the widget.
1140    *
1141    * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
1142    * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
1143    * the value of the property changes.
1144    */
1145   Glib::PropertyProxy<Adjustment*> property_hadjustment() ;
1146
1147 /** Horizontal Adjustment for the widget.
1148    *
1149    * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
1150    * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
1151    * the value of the property changes.
1152    */
1153   Glib::PropertyProxy_ReadOnly<Adjustment*> property_hadjustment() const;
1154
1155   /** Vertical Adjustment for the widget.
1156    *
1157    * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
1158    * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
1159    * the value of the property changes.
1160    */
1161   Glib::PropertyProxy<Adjustment*> property_vadjustment() ;
1162
1163 /** Vertical Adjustment for the widget.
1164    *
1165    * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
1166    * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
1167    * the value of the property changes.
1168    */
1169   Glib::PropertyProxy_ReadOnly<Adjustment*> property_vadjustment() const;
1170
1171   /** Show the column header buttons.
1172    *
1173    * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
1174    * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
1175    * the value of the property changes.
1176    */
1177   Glib::PropertyProxy<bool> property_headers_visible() ;
1178
1179 /** Show the column header buttons.
1180    *
1181    * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
1182    * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
1183    * the value of the property changes.
1184    */
1185   Glib::PropertyProxy_ReadOnly<bool> property_headers_visible() const;
1186
1187   /** Column headers respond to click events.
1188    *
1189    * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
1190    * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
1191    * the value of the property changes.
1192    */
1193   Glib::PropertyProxy<bool> property_headers_clickable() ;
1194
1195 /** Column headers respond to click events.
1196    *
1197    * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
1198    * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
1199    * the value of the property changes.
1200    */
1201   Glib::PropertyProxy_ReadOnly<bool> property_headers_clickable() const;
1202
1203   /** Set the column for the expander column.
1204    *
1205    * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
1206    * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
1207    * the value of the property changes.
1208    */
1209   Glib::PropertyProxy<TreeViewColumn*> property_expander_column() ;
1210
1211 /** Set the column for the expander column.
1212    *
1213    * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
1214    * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
1215    * the value of the property changes.
1216    */
1217   Glib::PropertyProxy_ReadOnly<TreeViewColumn*> property_expander_column() const;
1218
1219   /** View is reorderable.
1220    *
1221    * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
1222    * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
1223    * the value of the property changes.
1224    */
1225   Glib::PropertyProxy<bool> property_reorderable() ;
1226
1227 /** View is reorderable.
1228    *
1229    * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
1230    * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
1231    * the value of the property changes.
1232    */
1233   Glib::PropertyProxy_ReadOnly<bool> property_reorderable() const;
1234
1235   /** Set a hint to the theme engine to draw rows in alternating colors.
1236    *
1237    * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
1238    * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
1239    * the value of the property changes.
1240    */
1241   Glib::PropertyProxy<bool> property_rules_hint() ;
1242
1243 /** Set a hint to the theme engine to draw rows in alternating colors.
1244    *
1245    * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
1246    * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
1247    * the value of the property changes.
1248    */
1249   Glib::PropertyProxy_ReadOnly<bool> property_rules_hint() const;
1250
1251   /** View allows user to search through columns interactively.
1252    *
1253    * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
1254    * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
1255    * the value of the property changes.
1256    */
1257   Glib::PropertyProxy<bool> property_enable_search() ;
1258
1259 /** View allows user to search through columns interactively.
1260    *
1261    * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
1262    * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
1263    * the value of the property changes.
1264    */
1265   Glib::PropertyProxy_ReadOnly<bool> property_enable_search() const;
1266
1267   /** Model column to search through when searching through code.
1268    *
1269    * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
1270    * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
1271    * the value of the property changes.
1272    */
1273   Glib::PropertyProxy<int> property_search_column() ;
1274
1275 /** Model column to search through when searching through code.
1276    *
1277    * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
1278    * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
1279    * the value of the property changes.
1280    */
1281   Glib::PropertyProxy_ReadOnly<int> property_search_column() const;
1282
1283   /** Speeds up GtkTreeView by assuming that all rows have the same height.
1284    *
1285    * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
1286    * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
1287    * the value of the property changes.
1288    */
1289   Glib::PropertyProxy<bool> property_fixed_height_mode() ;
1290
1291 /** Speeds up GtkTreeView by assuming that all rows have the same height.
1292    *
1293    * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
1294    * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
1295    * the value of the property changes.
1296    */
1297   Glib::PropertyProxy_ReadOnly<bool> property_fixed_height_mode() const;
1298
1299   /** Whether the selection should follow the pointer.
1300    *
1301    * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
1302    * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
1303    * the value of the property changes.
1304    */
1305   Glib::PropertyProxy<bool> property_hover_selection() ;
1306
1307 /** Whether the selection should follow the pointer.
1308    *
1309    * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
1310    * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
1311    * the value of the property changes.
1312    */
1313   Glib::PropertyProxy_ReadOnly<bool> property_hover_selection() const;
1314
1315   /** Whether rows should be expanded/collapsed when the pointer moves over them.
1316    *
1317    * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
1318    * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
1319    * the value of the property changes.
1320    */
1321   Glib::PropertyProxy<bool> property_hover_expand() ;
1322
1323 /** Whether rows should be expanded/collapsed when the pointer moves over them.
1324    *
1325    * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
1326    * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
1327    * the value of the property changes.
1328    */
1329   Glib::PropertyProxy_ReadOnly<bool> property_hover_expand() const;
1330
1331
1332   /// Get the treeview's model, but actually get the child model if it's a TreeModelFilter.
1333   Glib::RefPtr<Gtk::TreeModel> _get_base_model();
1334   
1335 protected:
1336
1337 #ifndef DOXYGEN_SHOULD_SKIP_THIS
1338   template<class ColumnType> friend
1339   void _auto_store_on_cellrenderer_text_edited_string(const Glib::ustring& path_string, const Glib::ustring& new_text, int model_column, Gtk::TreeView*);
1340
1341   template <class ColumnType> friend
1342   void _auto_store_on_cellrenderer_text_edited_numerical(const Glib::ustring& path_string, const Glib::ustring& new_text, int model_column, Gtk::TreeView*);
1343   
1344   void _auto_store_on_cellrenderer_toggle_edited(const Glib::ustring& path_string, int model_column);
1345
1346   template<class ColumnType> friend
1347   void TreeView_Private::_connect_auto_store_editable_signal_handler(TreeView*, CellRenderer*, const TreeModelColumn<ColumnType>&);
1348
1349 #endif //DOXYGEN_SHOULD_SKIP_THIS
1350
1351
1352 };
1353
1354
1355 template <class ColumnType> inline
1356 int TreeView::append_column(const Glib::ustring& title, const TreeModelColumn<ColumnType>& model_column)
1357 {
1358   // compilation will fail if there is no appropriate TreeViewColumn
1359   // constructor for this model column type.
1360   TreeViewColumn *const pViewColumn = Gtk::manage( new TreeViewColumn(title, model_column) );
1361
1362   return append_column(*pViewColumn);
1363 }
1364
1365 //This is here because sigc::bind once did not work on all platforms, but now it does..
1366 #define GTKMM_HAVE_SIGC_BIND 1
1367
1368 #ifdef GTKMM_HAVE_SIGC_BIND
1369
1370 template <class ColumnType> inline
1371 int TreeView::append_column_numeric(const Glib::ustring& title, const TreeModelColumn<ColumnType>& model_column, const Glib::ustring& format)
1372 {
1373   TreeViewColumn* const pViewColumn = Gtk::manage( new TreeViewColumn(title) );
1374     
1375   //Use a CellRendererText:
1376   //We don't use TreeView::Column::append_column(model_column) to generate an appropriate CellRenderer, 
1377   //because that uses set_renderer(), which renders the model value using the automatic glib "transformations" (number-string conversions). As well as being unnecessary here, those automatic conversions can't handle all numeric types.
1378   CellRenderer* pCellRenderer = manage( new CellRendererText() );
1379   pViewColumn->pack_start(*pCellRenderer);
1380   
1381
1382   //Some compilers don't like us to give the pointer to a template function directly to sigc::ptr_fun():
1383   typedef void (*type_fptr)(Gtk::CellRenderer* cell, const Gtk::TreeModel::iterator& iter, int model_column, const Glib::ustring& format);
1384   type_fptr fptr = TreeView_Private::_auto_cell_data_func<ColumnType>;
1385
1386   //Connect a cell_data callback, to show the number's text representation in the specified format:
1387   //We use sigc::bind<-1> twice here, instead of sigc::bind() once, because some compilers need the extra hint.
1388   Gtk::TreeViewColumn::SlotCellData slot = sigc::bind<-1>(
1389     sigc::bind<-1>( sigc::ptr_fun(fptr), format),
1390     model_column.index()
1391   );
1392     
1393   pViewColumn->set_cell_data_func(*pCellRenderer, slot);
1394
1395   return append_column(*pViewColumn);
1396 }
1397
1398 #endif //GTKMM_HAVE_SIGC_BIND
1399
1400 template <class ColumnType> inline
1401 int TreeView::append_column_numeric_editable(const Glib::ustring& title, const TreeModelColumn<ColumnType>& model_column, const Glib::ustring& format)
1402 {
1403   int cols_count = append_column_numeric(title, model_column, format);
1404   
1405   //connect signal handlers for auto-storing of edited cell data
1406   //Note: This will only work for base-10 (decimal) formatted numbers:
1407   CellRenderer *const cell = get_column_cell_renderer(cols_count - 1);
1408   if(cell)
1409   {
1410     TreeView_Private::_connect_auto_store_editable_signal_handler<ColumnType>(this, cell, model_column);
1411   }
1412    
1413   return cols_count;
1414 }
1415
1416 template <class ColumnType> inline
1417 int TreeView::append_column_editable(const Glib::ustring& title, const TreeModelColumn<ColumnType>& model_column)
1418 {
1419   g_assert(model_column.type() != 0);
1420
1421   // compilation will fail if there is no appropriate TreeViewColumn
1422   // constructor for this model column type.
1423   TreeViewColumn *const pViewColumn = Gtk::manage( new TreeViewColumn(title, model_column) );
1424
1425   //connect signal handlers for auto-storing of edited cell data
1426   CellRenderer* pCellRender = pViewColumn->get_first_cell_renderer();
1427   TreeView_Private::_connect_auto_store_editable_signal_handler<ColumnType>(this, pCellRender, model_column);
1428
1429   return append_column(*pViewColumn);
1430 }
1431
1432 template <class ColumnType> inline
1433 int TreeView::insert_column(const Glib::ustring& title, const TreeModelColumn<ColumnType>& model_column, int position)
1434 {
1435   // compilation will fail if there is no appropriate TreeViewColumn
1436   // constructor for this model column type.
1437   TreeViewColumn *const pViewColumn = Gtk::manage( new TreeViewColumn(title, model_column) );
1438
1439   return insert_column(*pViewColumn, position);
1440 }
1441
1442 template <class ColumnType> inline
1443 int TreeView::insert_column_editable(const Glib::ustring& title, const TreeModelColumn<ColumnType>& model_column, int position)
1444 {
1445   // compilation will fail if there is no appropriate TreeViewColumn
1446   // constructor for this model column type.
1447   TreeViewColumn *const pViewColumn = Gtk::manage( new TreeViewColumn(title, model_column) );
1448
1449    //connect signal handlers for auto-storing of edited cell data
1450   CellRenderer* pCellRender = pViewColumn->get_first_cell_renderer();
1451   TreeView_Private::_connect_auto_store_editable_signal_handler(this, pCellRender, model_column);
1452
1453   return insert_column(*pViewColumn, position);
1454 }
1455
1456
1457 #ifndef DOXYGEN_SHOULD_SKIP_THIS
1458 namespace TreeView_Private
1459 {
1460
1461 //Template specializations, for different model column types:
1462 //TODO: Move these specializations into the .ccg file - I tried, but the int specialization was not used by the compiler. murrayc.
1463
1464 #ifdef GTKMM_HAVE_SIGC_BIND
1465
1466 //bool specialization:
1467 template<> inline
1468 void _connect_auto_store_editable_signal_handler(Gtk::TreeView* this_p, Gtk::CellRenderer* pCellRenderer,  const Gtk::TreeModelColumn<bool>& model_column)
1469 {
1470   Gtk::CellRendererToggle* pCellToggle = dynamic_cast<Gtk::CellRendererToggle*>(pCellRenderer);
1471   if(pCellToggle)
1472   {
1473     //Set the appropriate property,
1474     pCellToggle->property_activatable() = true;
1475   
1476     //Connect to the appropriate signal, sending the model_column too,
1477     pCellToggle->signal_toggled().connect(
1478       sigc::bind<-1>( sigc::mem_fun(*this_p, &Gtk::TreeView::_auto_store_on_cellrenderer_toggle_edited), model_column.index()) );
1479     //We use bind<1> instead of bind because some compilers need the extra hint.
1480   }
1481 }
1482
1483 //int specialization:
1484 template<> inline
1485 void _connect_auto_store_editable_signal_handler(Gtk::TreeView* this_p, Gtk::CellRenderer* pCellRenderer,  const Gtk::TreeModelColumn<int>& model_column)
1486 {
1487   Gtk::CellRendererText* pCellText = dynamic_cast<Gtk::CellRendererText*>(pCellRenderer);
1488   if(pCellText)
1489   {
1490     //Set the appropriate property,
1491     pCellText->property_editable() = true;
1492
1493     //Some compilers don't like us to give the pointer to a template function directly to sigc::ptr_fun():
1494     typedef void (*type_fptr)(const Glib::ustring& path_string, const Glib::ustring& new_text, int model_column, Gtk::TreeView* this_p);
1495     type_fptr fptr = _auto_store_on_cellrenderer_text_edited_numerical<int>;
1496
1497     //Connect to the appropriate signal, sending the model_column too,
1498     //We use bind<-1> twice here, instead of using bind() once, because some compilers need the extra hint.
1499     pCellText->signal_edited().connect(
1500       sigc::bind<-1>(
1501         sigc::bind<-1>( sigc::ptr_fun(fptr), this_p),
1502         model_column.index()
1503       )
1504     );
1505
1506   }
1507 }
1508
1509 //unsigned int specialization:
1510 template<> inline
1511 void _connect_auto_store_editable_signal_handler(Gtk::TreeView* this_p, Gtk::CellRenderer* pCellRenderer,  const Gtk::TreeModelColumn<unsigned int>& model_column)
1512 {
1513   Gtk::CellRendererText* pCellText = dynamic_cast<Gtk::CellRendererText*>(pCellRenderer);
1514   if(pCellText)
1515   {
1516     //Set the appropriate property,
1517     pCellText->property_editable() = true;
1518
1519     //Some compilers don't like us to give the pointer to a template function directly to sigc::ptr_fun():
1520     typedef void (*type_fptr)(const Glib::ustring& path_string, const Glib::ustring& new_text, int model_column, Gtk::TreeView* this_p);
1521     type_fptr fptr = _auto_store_on_cellrenderer_text_edited_numerical<unsigned int>;
1522
1523     //Connect to the appropriate signal, sending the model_column too,
1524     //We use bind<-1> twice here, instead of using bind() once, because some compilers need the extra hint.
1525     pCellText->signal_edited().connect(
1526       sigc::bind<-1>(
1527         sigc::bind<-1>( sigc::ptr_fun(fptr), this_p),
1528         model_column.index()
1529       )
1530     );
1531     
1532   }
1533 }
1534
1535 //long specialization:
1536 template<> inline
1537 void _connect_auto_store_editable_signal_handler(Gtk::TreeView* this_p, Gtk::CellRenderer* pCellRenderer,  const Gtk::TreeModelColumn<long>& model_column)
1538 {
1539   Gtk::CellRendererText* pCellText = dynamic_cast<Gtk::CellRendererText*>(pCellRenderer);
1540   if(pCellText)
1541   {
1542     //Set the appropriate property,
1543     pCellText->property_editable() = true;
1544      
1545     //Some compilers don't like us to give the pointer to a template function directly to sigc::ptr_fun():
1546     typedef void (*type_fptr)(const Glib::ustring& path_string, const Glib::ustring& new_text, int model_column, Gtk::TreeView* this_p);
1547     type_fptr fptr = _auto_store_on_cellrenderer_text_edited_numerical<long>;
1548
1549     //Connect to the appropriate signal, sending the model_column too,
1550     //We use bind<-1> twice here, instead of using bind() once, because some compilers need the extra hint.
1551     pCellText->signal_edited().connect(
1552       sigc::bind<-1>(
1553         sigc::bind<-1>( sigc::ptr_fun(fptr), this_p),
1554         model_column.index()
1555       )
1556     );
1557     
1558   }
1559 }
1560
1561 //unsigned long specialization:
1562 template<> inline
1563 void _connect_auto_store_editable_signal_handler(Gtk::TreeView* this_p, Gtk::CellRenderer* pCellRenderer,  const Gtk::TreeModelColumn<unsigned long>& model_column)
1564 {
1565   Gtk::CellRendererText* pCellText = dynamic_cast<Gtk::CellRendererText*>(pCellRenderer);
1566   if(pCellText)
1567   {
1568     //Set the appropriate property,
1569     pCellText->property_editable() = true;
1570   
1571     //Some compilers don't like us to give the pointer to a template function directly to sigc::ptr_fun():
1572     typedef void (*type_fptr)(const Glib::ustring& path_string, const Glib::ustring& new_text, int model_column, Gtk::TreeView* this_p);
1573     type_fptr fptr = _auto_store_on_cellrenderer_text_edited_numerical<unsigned long>;
1574
1575     //Connect to the appropriate signal, sending the model_column too,
1576     //We use bind<-1> twice here, instead of using bind() once, because some compilers need the extra hint.
1577     pCellText->signal_edited().connect(
1578       sigc::bind<-1>(
1579         sigc::bind<-1>( sigc::ptr_fun(fptr), this_p),
1580         model_column.index()
1581       )
1582     );
1583     
1584   }
1585 }
1586
1587 //float specialization:
1588 template<> inline
1589 void _connect_auto_store_editable_signal_handler(Gtk::TreeView* this_p, Gtk::CellRenderer* pCellRenderer,  const Gtk::TreeModelColumn<float>& model_column)
1590 {
1591   Gtk::CellRendererText* pCellText = dynamic_cast<Gtk::CellRendererText*>(pCellRenderer);
1592   if(pCellText)
1593   {
1594     //Set the appropriate property,
1595     pCellText->property_editable() = true;
1596
1597     //Some compilers don't like us to give the pointer to a template function directly to sigc::ptr_fun():
1598     typedef void (*type_fptr)(const Glib::ustring& path_string, const Glib::ustring& new_text, int model_column, Gtk::TreeView* this_p);
1599     type_fptr fptr = _auto_store_on_cellrenderer_text_edited_numerical<float>;
1600
1601     //Connect to the appropriate signal, sending the model_column too,
1602     //We use bind<-1> twice here, instead of using bind() once, because some compilers need the extra hint.
1603     pCellText->signal_edited().connect(
1604       sigc::bind<-1>(
1605         sigc::bind<-1>( sigc::ptr_fun(fptr), this_p),
1606         model_column.index()
1607       )
1608     );
1609   }
1610 }
1611
1612 //double specialization:
1613 template<> inline
1614 void _connect_auto_store_editable_signal_handler(Gtk::TreeView* this_p, Gtk::CellRenderer* pCellRenderer,  const Gtk::TreeModelColumn<double>& model_column)
1615 {
1616   Gtk::CellRendererText* pCellText = dynamic_cast<Gtk::CellRendererText*>(pCellRenderer);
1617   if(pCellText)
1618   {
1619     //Set the appropriate property,
1620     pCellText->property_editable() = true;
1621
1622     //Some compilers don't like us to give the pointer to a template function directly to sigc::ptr_fun():
1623     typedef void (*type_fptr)(const Glib::ustring& path_string, const Glib::ustring& new_text, int model_column, Gtk::TreeView* this_p);
1624     type_fptr fptr = _auto_store_on_cellrenderer_text_edited_numerical<double>;
1625
1626     //Connect to the appropriate signal, sending the model_column too,
1627     //We use bind<-1> twice here, instead of using bind() once, because some compilers need the extra hint.
1628     pCellText->signal_edited().connect(
1629       sigc::bind<-1>(
1630         sigc::bind<-1>( sigc::ptr_fun(fptr), this_p),
1631         model_column.index()
1632       )
1633     );
1634   }
1635 }
1636
1637 #endif //GTKMM_HAVE_SIGC_BIND
1638
1639 } // namespace TreeView_Private
1640 #endif //DOXYGEN_SHOULD_SKIP_THIS
1641
1642
1643 #ifndef DOXYGEN_SHOULD_SKIP_THIS
1644 namespace TreeView_Private
1645 {
1646
1647 #ifdef GTKMM_HAVE_SIGC_BIND
1648
1649 template <class ColumnType> inline
1650 void _connect_auto_store_editable_signal_handler(Gtk::TreeView* this_p, Gtk::CellRenderer* pCellRenderer,  const Gtk::TreeModelColumn<ColumnType>& model_column)
1651 {
1652   g_assert(model_column.type() != 0);
1653
1654   //The different CellRenderers have different "edited" signals,
1655   //and numerical values need to convert the text value to a number,
1656   //so there are specializations for this tempate.
1657
1658   Gtk::CellRendererText* pCellText = dynamic_cast<Gtk::CellRendererText*>(pCellRenderer);
1659
1660   //Set the appropriate property,
1661   //and connect to the appropriate signal, sending the model_column too,
1662   if(pCellText)
1663   {
1664     pCellText->property_editable() = true;
1665    
1666     //Some compilers (IRIX MipsPro) don't like us to give the pointer to a template function directly to sigc::ptr_fun():
1667     typedef void (*type_func)(const Glib::ustring&, const Glib::ustring&, int, Gtk::TreeView*);
1668     type_func func = &(_auto_store_on_cellrenderer_text_edited_string<ColumnType>);
1669     sigc::slot<void, const Glib::ustring&, const Glib::ustring&, int, Gtk::TreeView*> theslot  =
1670       sigc::ptr_fun(func);
1671
1672     //We use bind<-1> twice here, instead of using bind() once, because some compilers need the extra hint.
1673     pCellText->signal_edited().connect(
1674       sigc::bind<-1>(
1675         sigc::bind<-1>( theslot, this_p),
1676         model_column.index()
1677       )
1678     );
1679
1680     
1681   }
1682 }
1683
1684 #endif //GTKMM_HAVE_SIGC_BIND
1685
1686 template <class ColumnType> inline
1687 void _auto_store_on_cellrenderer_text_edited_string(const Glib::ustring& path_string, const Glib::ustring& new_text, int model_column, Gtk::TreeView* this_p)
1688 {
1689   Gtk::TreePath path(path_string);
1690
1691   //Get the row from the path:
1692   Glib::RefPtr<TreeModel> refModel = this_p->_get_base_model();
1693   Gtk::TreeModel::iterator iter = refModel->get_iter(path);
1694   if(iter)
1695   {
1696       //Store the user's new text in the model:
1697       Gtk::TreeRow row = *iter;
1698       row.set_value(model_column, (ColumnType)new_text);
1699   }
1700 }
1701
1702 template <class ColumnType> inline
1703 void _auto_store_on_cellrenderer_text_edited_numerical(const Glib::ustring& path_string, const Glib::ustring& new_text, int model_column, Gtk::TreeView* this_p)
1704 {
1705   //This is used on numerical model columns:
1706
1707   Gtk::TreePath path(path_string);
1708
1709   //Get the row from the path:
1710   Glib::RefPtr<TreeModel> refModel = this_p->_get_base_model();
1711   Gtk::TreeModel::iterator iter = refModel->get_iter(path);
1712   if(iter)
1713   { 
1714     //std::istringstream astream(new_text); //Put it in a stream.
1715     //ColumnType new_value = ColumnType();
1716     //new_value << astream; //Get it out of the stream as the numerical type.
1717     
1718     //Convert the text to a number, using the same logic used by GtkCellRendererText when it stores numbers.
1719     char* pchEnd = 0;
1720     ColumnType new_value = static_cast<ColumnType>( strtod(new_text.c_str(), &pchEnd) );
1721
1722     //Store the user's new text in the model:
1723     Gtk::TreeRow row = *iter;
1724     row.set_value(model_column, (ColumnType)new_value);
1725   }
1726 }
1727
1728 template <class ColumnType> inline
1729 void _auto_cell_data_func(Gtk::CellRenderer* cell, const Gtk::TreeModel::iterator& iter, int model_column, const Glib::ustring& format)
1730 {
1731   Gtk::CellRendererText* pTextRenderer = dynamic_cast<Gtk::CellRendererText*>(cell);
1732   if(!pTextRenderer)
1733   {
1734     g_warning("gtkmm: TextView: append_column_numeric() was used with a non-numeric type.");
1735   }
1736   else
1737   {
1738     if(iter)
1739     {
1740       //Get the value from the model.
1741       Gtk::TreeModel::Row row = *iter;
1742       ColumnType value = ColumnType();
1743       row.get_value(model_column, value);
1744       
1745       //Convert it to a string representation:
1746       char buff[20];
1747       int used = g_snprintf(buff, sizeof(buff), format.c_str(), value); //value must be a numeric type.
1748       if(used > 0)
1749       {
1750         //Show the text representation in the view:
1751         pTextRenderer->property_text() = buff;
1752       }
1753     }
1754   }
1755 }
1756
1757 } // namespace TreeView_Private
1758 #endif //DOXYGEN_SHOULD_SKIP_THIS
1759
1760
1761 } // namespace Gtk
1762
1763
1764 namespace Glib
1765 {
1766   /** @relates Gtk::TreeView
1767    * @param object The C instance
1768    * @param take_copy False if the result should take ownership of the C instance. True if it should take a new copy or ref.
1769    * @result A C++ instance that wraps this C instance.
1770    */
1771   Gtk::TreeView* wrap(GtkTreeView* object, bool take_copy = false);
1772 }
1773 #endif /* _GTKMM_TREEVIEW_H */
1774