print ListStore's data on cout
- From: Sergio Perticone <g4ll0ws gmail com>
- To: gtkmm mailing-list <gtkmm-list gnome org>
- Subject: print ListStore's data on cout
- Date: Fri, 27 Apr 2007 17:22:46 +0200
Actually I have to save ListStore's data on file, but first of all I
want to try to print it on cout. I've searched for examples but I
haven't found nothing like this.
My code is:
Glib::RefPtr<Gtk::ListStore> refModel;
// ...
typedef Gtk::TreeModel::Children TreeChildren;
typedef Gtk::TreeModel::Children::const_iterator TreeConstIter;
void Foo::f() const
{
const TreeChildren children = refModel->children();
if(children.empty()) {
std::cout << "empty\n";
return;
}
for(TreeConstIter i=children.begin(); i!=children.end(); i++) {
const TreeChildren row = (*i)->children();
for(TreeConstIter j=row.begin(); j!=row.end(); j++)
std::cout << *j << '\n';
}
}
f() prints nothing..
Thanks,
s.
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]