[gtkmm/gtkmm-3-24] Gtk::TreeView::append_column() doc: Add code example



commit aa404ebfdd60321de890d9de1eaecc97f145296b
Author: Pavlo Solntsev <p sun fun gmail com>
Date:   Thu Jan 16 07:58:05 2020 -0600

    Gtk::TreeView::append_column() doc: Add code example

 gtk/src/treeview.hg | 12 ++++++++++++
 1 file changed, 12 insertions(+)
---
diff --git a/gtk/src/treeview.hg b/gtk/src/treeview.hg
index 3428b0cd..ae085bf6 100644
--- a/gtk/src/treeview.hg
+++ b/gtk/src/treeview.hg
@@ -166,6 +166,18 @@ public:
    * manually and use TreeViewColumn::set_cell_data_func() to provide a callback
    * that converts the model value into a string representation with .
    *
+   * The returned value is useful, for example, for the connection the column renderer signal to a
+   * a slot:
+   *
+   * @code
+   *
+   *    int Ncolumns = mTreeView.append_column("Column Title", mColumns.mName);
+   *    auto renderer
+   *       = dynamic_cast<Gtk::CellRendererText*>(mTreeView.get_column_cell_renderer(Ncolumns-1));
+   *    renderer.signal_edited().connect(sigc::mem_fun(*this, &myFunc));
+   *
+   * @endcode
+   *
    * @param title The text to be used in the title header of this column.
    * @param model_column The column in the TreeModel that will be rendered by this View column.
    * @result The number of columns in the View after appending.


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]