GtkTreeModelFilter problems




Hi!

I am trying to use GtkTreeModelFilter to filter out some rows. it works
great, but I have a problem with a cell which is a toggle.
the code below works for model when all rows are shown, but it does not
work well when some rows are hiden. it is a list, not a tree.
what's wrong with it? this code runs in cell_toggled callback.
gtk+-2.8.6

 child_path = gtk_tree_path_new_from_string (path_string);
 path =
gtk_tree_model_filter_convert_child_path_to_path (filter, child_path);
// here path is NULL when some rows are hiden
gtk_tree_path_free (child_path);
 if (path)
  {
    gtk_tree_model_get_iter (smodel, &iter, path);
    gtk_tree_path_free (path);

    col = GPOINTER_TO_INT (data);
    gtk_tree_model_get (smodel, &iter,
                        col, &bool, -1);

    bool ^= 1;
    gtk_list_store_set (GTK_LIST_STORE (smodel), &iter,
                        col, bool, -1);
  }

thanks in advance
-- 
HuamiSoft Hubert Sokolowski
http://www.huamisoft.com/
tel. 501456743



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