Re: Using a TreeStore with a ComboBox



Milosz Derezynski wrote:
Well, if it's really *just* that:

On 6/23/07, Jef Driesen <jefdriesen hotmail com <mailto:jefdriesen hotmail com>> wrote:

    After refilter, the combobox contains no items anymore, just like when I
    populate the model before using set_visible_func. This is what I
    expected, because in my model all toplevel nodes have children. Of
    course this is not the solution I need.


and the grander scheme isn't something bigger, then you can just alter the function to:

bool
Example::on_model_visible (const Gtk:TreeModel::const_iterator& iter)
{
  return (iter != store->children().begin && iter->children().empty());
}

This doesn't make any difference. This change only affects the very first node, which also has children in my example model, and thus doesn't change anything.

I think a TreeModelFilter is not the solution for my problem, because it can only hide nodes from the main model. What I need is the possibility to prevent certain nodes from being selected in the combobox. That is a change in the presentation of the model, not the model itself (e.g. something similar to the set_select_func from the treemodel).




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