print ListStore's data on cout



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]