[gtkmm-documentation] Update combobox/complex and toolpalette examples



commit 5fbdf18e8634a1914cfbc316e3816d1328860b52
Author: Kjell Ahlstedt <kjell ahlstedt bredband net>
Date:   Thu Jan 5 13:09:21 2017 +0100

    Update combobox/complex and toolpalette examples
    
    to fit the restructured Gtk::TreeIter class hierarchy. Bug #134520

 examples/book/combobox/complex/examplewindow.cc |    5 +++--
 examples/book/toolpalette/examplewindow.cc      |   10 ++++++----
 2 files changed, 9 insertions(+), 6 deletions(-)
---
diff --git a/examples/book/combobox/complex/examplewindow.cc b/examples/book/combobox/complex/examplewindow.cc
index 0648ed8..9f27f78 100644
--- a/examples/book/combobox/complex/examplewindow.cc
+++ b/examples/book/combobox/complex/examplewindow.cc
@@ -29,11 +29,12 @@ ExampleWindow::ExampleWindow()
   m_Combo.set_model(m_refTreeModel);
 
   //Fill the ComboBox's Tree Model:
-  Gtk::TreeModel::Row row = *(m_refTreeModel->append());
+  Gtk::TreeModel::iterator iter = m_refTreeModel->append();
+  Gtk::TreeModel::Row row = *iter;
   row[m_Columns.m_col_id] = 1;
   row[m_Columns.m_col_name] = "Billy Bob";
   row[m_Columns.m_col_extra] = "something";
-  m_Combo.set_active(row);
+  m_Combo.set_active(iter);
   /*
   Gtk::TreeModel::Row childrow = *(m_refTreeModel->append(row.children()));
   childrow[m_Columns.m_col_id] = 11;
diff --git a/examples/book/toolpalette/examplewindow.cc b/examples/book/toolpalette/examplewindow.cc
index 568e831..29f94ba 100644
--- a/examples/book/toolpalette/examplewindow.cc
+++ b/examples/book/toolpalette/examplewindow.cc
@@ -190,7 +190,8 @@ ExampleWindow::ExampleWindow()
 
   //The Orientation ComboBox:
   m_refTreeModelOrientation = Gtk::ListStore::create(m_ColumnsOrientation);
-  Gtk::TreeModel::Row row = *(m_refTreeModelOrientation->append());
+  Gtk::TreeModel::iterator iter = m_refTreeModelOrientation->append();
+  Gtk::TreeModel::Row row = *iter;
   row[m_ColumnsOrientation.m_col_value] = Gtk::ORIENTATION_HORIZONTAL;
   row[m_ColumnsOrientation.m_col_name] = "Horizontal";\
   row = *(m_refTreeModelOrientation->append());
@@ -201,11 +202,12 @@ ExampleWindow::ExampleWindow()
   m_ComboOrientation.pack_start(m_ColumnsOrientation.m_col_name);
   m_ComboOrientation.signal_changed().connect(
     sigc::mem_fun(*this, &ExampleWindow::on_combo_orientation_changed) );
-  m_ComboOrientation.set_active(row);
+  m_ComboOrientation.set_active(iter);
 
   //The Style ComboBox:
   m_refTreeModelStyle = Gtk::ListStore::create(m_ColumnsStyle);
-  row = *(m_refTreeModelStyle->append());
+  iter = m_refTreeModelStyle->append();
+  row = *iter;
   row[m_ColumnsStyle.m_col_value] = Gtk::TOOLBAR_TEXT;
   row[m_ColumnsStyle.m_col_name] = "Text";\
   row = *(m_refTreeModelStyle->append());
@@ -225,7 +227,7 @@ ExampleWindow::ExampleWindow()
   m_ComboStyle.pack_start(m_ColumnsStyle.m_col_name);
   m_ComboStyle.signal_changed().connect(
     sigc::mem_fun(*this, &ExampleWindow::on_combo_style_changed) );
-  m_ComboStyle.set_active(row);
+  m_ComboStyle.set_active(iter);
 
   //Add and fill the ToolPalette:
   load_icon_items();


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