Re: [gnome-love] Expanders in GtkTree* from GTK+ 2.0



[I think people should follow up to gtk-list, please keep me in Cc as I
haven't subscribed it]

Le 30/05/01 03:45:35, jrb redhat com a écrit :
Here comes the question/problem: the tree expander arrows are always
on the first column, is there a way to have them in another column
AND follow that column when I drag&drop it?
I can't find any relevant function.

I found gtk_tree_view_set_expander_column (not documented) which
allows to specify the *visual* column where to draw the expander
arrows, not the *logical* column: when a drag&drop a column, the
expanders don't follow it.
(and is this the expected behaviour or is this a bug?)

I'm not sure which makes more sense -- the expander set in a location in
the view, or on a particular column.  I was toying with the idea of
making it column based, but that would make people who want the expander
always left justified have to listen to "columns_changed" and move the
expander.

If you want to change the behavior, you can listen to that signal and
set_expander_column to the correct column.

Would it be possible to implement this as part of GtkTreeView?

I think about two possibilities:

 · I can't see any good reason to have expanders in, say, the view's second
   column -- and always there. Either they are left justified or attached
   to a particular column.
    - by default, expanders are always left justified.
    - set_expander_column attaches them to the specified column
    - use set_expander_column(-1) -- or make a set_expander_column_default
      function -- to revert to the default (always left justified)

 · if you want to keep the current behaviour, add function to attach the
   expanders to the column rather than the view (taking a boolean as
   argument).
   The internal implementation may be done by calling set_expander_column
   when columns are reordered or handled directly in the GtkTreeView
   display (it seems it's just a matter of changing the i ==
   tree_view->priv->expander_column tests)

Tom.




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