Re: [gtkmm] TreeModel::foreach_iter



Am 24.08.2004 18:16:30 schrieb(en) David Jensen:
David Jensen wrote:
Martin Schulze wrote:


I don't understand! What changes did you make your original code working:

void
DirList::Config_Update()
{
    ls->foreach_iter(sigc::mem_fun(*this, &DirList::slot_update));
}

bool
DirList::slot_update(const Gtk::TreeModel::iterator& iter)
{
    (*iter)[ls->dlc.color] = Color[(*iter)[ls->dlc.type]];
    return TRUE;
}


SORRY, i'm still stepping in it!

DirList::slot_update(const Gtk::TreeModel::iterator& iter)
{
     (*iter)[ls->dlc.color] = Color[(*iter)[ls->dlc.type]];
     return FALSE;
}

TRUE wont work!!  it quits after one iter

Well,
http://www.gtkmm.org/docs/gtkmm-2.4/docs/reference/html/classGtk_1_1TreeModel.html#a7

explicitely states that:

'If the callback function returns true, then the tree ceases to be walked, and foreach() returns.'

Regards,

 Martin



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