Re: [gtk-list] tree{,item} widget questions



Hi,

> 
>       I was browsing through the tree widget source for 0.99.4, and I had
> two questions:
> 
> 1) If I wanted to tack on 'satellite' data to something such as a
>    GTKTreeItem (to hook on my own data to a tree item to refer to when
>    the user selects the item), is gtk_object_{set,get}_data (or the
>    {get,set}_user_data wrappers) the "right" way to do this?
Yes, this is the solution.

> 
> 2) In gtk_tree_insert, there's a check to make sure the new child is a tree
>    item, but there's no such check in gtk_tree_add; is this intentional?
>    There are (unprotected, as nearly as I can determine) GTK_TREE_ITEM()
>    casts made on a child in:
>    gtk_tree_draw, gtk_tree_foreach, gtk_tree_map, gtk_tree_remove_items,
>    gtk_tree_size_allocate, and gtk_tree_size_request
>    and there are type-checked casts several other places.  It seems likely
>    to me that the intention was for a GTKTree to only allow GTKTreeItems
>    as children, although these GTKTreeItems may have other kinds of
>    children themselves (which is allowed -- or at least handled -- in
>    gtk_tree_button_press).
> 
Ooopss... 

I'll correct this.

Thanks.

Regards,
-- 
-----------------------------------------------------------------------
    _/ _/_/  _/  _/_/   _/_/_/ _/_/_/ Bolliet Jerome
   _/ _/ _/ _/ _/  _/   /  _/     _/  email: bolliet@in2p3.fr
  _/ _/  _/_/    _/   _/_/_/   _/_/   
 _/ _/    _/   _/    _/         _/    Equipe Administration Systeme
_/ _/    _/  _/_/_/ _/     _/_/_/     email: sysunix@in2p3.fr
Centre de Calcul - Campus de la Doua
  27 boulevard du 11 novembre 1918    Tel.: 04 78 93 08 80
   69622 - VILLEURBANNE - FRANCE      Fax.: 04 78 94 30 54
-----------------------------------------------------------------------




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