color selection and tree view




I have multiple questions, I hope it is OK to ask them in a single
article.  If you know the answer to just one of them, I'll appreciate
your help too.

1/ gtk_color_selection_set_update_policy is deprecated, but nothing tells
me of an alternative way to get the effect of GTK_POLICY_DELAYED.
(GTK_POLICY_CONTINUOUS seems to be the default, and GTK_POLICY_DISCONTINUOUS
should be fairly easy by polling the mouse.)

2/ tim at centricular dot net writes in his GtkTreeView tutorial:

tim> Firstly, you should detach your list store or tree store from the
tim> tree view before doing your mass insertions, then do your
tim> insertions, and only connect your store to the tree view again when
tim> you are done with your insertions. Like this:

  ...

  model = gtk_tree_view_get_model(GTK_TREE_VIEW(view));

  g_object_ref(model); /* Make sure the model stays with us after the tree view unrefs it */

  gtk_tree_view_set_model(GTK_TREE_VIEW(view), NULL); /* Detach model from view */

  ... insert a couple of thousand rows ...

  gtk_tree_view_set_model(GTK_TREE_VIEW(view), model); /* Re-attach model to view */

  g_object_unref(model);

  ...

tim> Secondly, you should make sure that sorting is disabled while you
tim> are doing your mass insertions, otherwise your store might be
tim> resorted after each and every single row insertion, which is going
tim> to be everything but fast.

This reads like excellent advice, and I already follow the first part.  But,
as for the second part, how do I temporarily disable sorting on a sorted
view?  Merely setting the sort column to  GTK_DEFAULT_SORT_COLUMN_ID doesn't
do it, bacause I have already used gtk_tree_sortable_set_default_sort_func()
to basically remember the initial order.  Using the same function
with a NULL parameter leads to a segfault, which tells me that there is an
internal do-nothing function installed initially.  But I cannot retrieve
_that_ and use it because there is no gtk_tree_sortable_get_default_sort_func.

Really, I simply want (but cannot find) something like a "sortable" property
on the view that I can clear before the big operation and set again after.

3/ gtk_tree_view_set_search_column enables incremental searching, but the
column parameter seems to be ignored: my comparison function is always passed
0 for the column.  What is it I need to do apart from
gtk_tree_view_set_search_column and gtk_tree_view_set_search_equal_func to
be able to search multiple columns?

TIA, Ian

-- 
Nothing can be explained to a stone.
Or to a stoned person, either.



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