RE: gtk_ctree_is_visible()



Hi Tim!

On 06-Aug-98 Tim Janik wrote:

> i think the name of gtk_ctree_is_visible() should better be changed
> to gtk_ctree_node_expanded(), since that is what it actually returns
> (including the parents, so gtk_ctree_node_fully_expanded() would also
> be an option).

No, not really. gtk_ctree_is_visible returns TRUE if all of nodes parents
are expanded, i.e. if gtk_ctree_is_visible (node) == TRUE then node actually
is in GTK_CLIST (ctree)->row_list.
I would expect gtk_ctree_node_expanded to return GTK_CTREE_ROW (node)->expanded.

> it's actually very easy to confuse with
> GtkVisibility gtk_clist_row_is_visible (GtkCList * clist,
>                                         gint row);
> which returns whether the specified row is inside the viewable portion
> of the scrolled window or not.

I don't object to rename this function too, but I don't like
gtk_ctree_node_expanded...

> also, for the purpose of reducing unneccessary moveto's, one needs to
> be able to obtain GtkVisibility for a given GtkCTreeNode. i guess
> something like
> 
> GtkVisibility gtk_ctree_node_is_visible (GtkCTree     *ctree,
>                                          GtkCTreeNode *node)
> {
>   gint row;
>   
>   g_return_val_if_fail (ctree != NULL, 0);
>   g_return_val_if_fail (node != NULL, 0);
>   
>   row = g_list_position (GTK_CLIST (ctree)->row_list, (GList*) node);
>   return gtk_clist_row_is_visible (GTK_CLIST (ctree), row);
> }
> 
> would do the trick. eventhough this seems to be an incredible easy code
> portion, it's still a burden to pick this up from gtkctree.c and do
> the stuff by hand if one needs to know whether a ctree node is obscured,
> just to optimize possible moveto calls.

Ok, I'll add this function.

bye,
  Lars



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