Misleading passage in Tutorial Chapter 8



Hello,

I have found an erroneous or at least misleading passage in the gtkmm 
tutorial, chapter 8, the paragraph about TreeSelections:

<snip>

<title>The selected rows</title>

[...]

For multiple-selection, you need to define a callback, and give it to 
selected_foreach(), like so:

refTreeSelection->selected_foreach( 
    sigc::mem_fun(*this, &TheClass::selected_row_callback) );

...

void TheClass::selected_row_callback(const Gtk::TreeModel::iterator& iter)
{
  TreeModel::Row row = *iter;
  //Do something with the row.
}

[...]
</snip>

The call to selected_foreach and the callback function don't match in this 
example. It has to be "selected_foreach_iter", otherwise the callback 
function would need to specify a second parameter (path).

Just wanted to point that out, since it was leading to some confusion and lots 
of compiler errors on my side :)

Have a great day and kudos for keeping this great project alive,
Matthias Käppler



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