Re: Gtk{Tree,List} replacement proposal



Most of the notes I took going through the headers have been
said elsewhere (naming of set_selection_type(), expand_all()/collapse_all(),
etc.) But here are a few more:

Jonathan Blandford <jrb@redhat.com> writes:

> void           gtk_tlview_columns_set_type         (GtkTLView           *tlview,
> 						    GtkTLViewColumnType  type);

I'd just omit this as a convenience function that doesn't add
all that much convenience compared to API bloat.

> void           gtk_tlview_column_set_widget        (GtkTLView        *tlview,
> 						    gint              column,
> 						    GtkWidget        *widget);
> GtkWidget *    gtk_tlview_column_get_widget        (GtkTLView        *tlview,
> 						    gint              column);
> void           gtk_tlview_column_set_justification (GtkTLView        *tlview,
> 						    gint              column,
> 						    GtkJustification  justification);
> GtkJustification gtk_tlview_column_get_justification(GtkTLView        *tlview,
> 						     gint              column);

 - This should probably be gtk_tlview_set_alignment (GtkTLView *tlview,
                                                     gfloat     xalign);

 - I'd only take aligment into account for the column header if
   set_widget() hasn't been called. And it should be possible to call
   set_widget() with a widget of NULL to return to the unset state.)

>   gchar     *(* get_column_header) (GtkTLModel *TLModel, gint      column);

I tend to think that the column headers should be simply stored
in the view. There connection to the data is somewhat tenuous - they
are, so to speak, decoration, and putting them in the model
just means that they are one more thing for the model to implement.

>   gboolean   (* node_next)       (GtkTLModel *TLModel, GtkTLNode  *node);
>   GtkTLNode  (* node_children)   (GtkTLModel *TLModel, GtkTLNode   node);
>   gboolean   (* node_has_child)  (GtkTLModel *TLModel, GtkTLNode   node);
>   gint       (* node_n_children) (GtkTLModel *TLModel, GtkTLNode   node);
>   GtkTLNode  (* node_nth_child)  (GtkTLModel *TLModel, GtkTLNode   node, gint     n);
>   GtkTLNode  (* node_parent)     (GtkTLModel *TLModel, GtkTLNode   node);
 

> /* GtkTLPath Operations */
> GtkTLPath   *gtk_tlpath_new                (void);

> void         gtk_tlpath_add_index          (GtkTLPath  *path,
> 					    gint        index);

For symmetry, consistancy, this should be append_index()

> struct _GtkTLCellClass
> {
>   GtkObjectClass parent_class;
> 
>   /* vtable - not signals */
>   gint (* get_width)  (GtkTLCell *cell, gpointer   data);
>   gint (* get_height) (GtkTLCell *cell, gpointer   data);

This probably should be size_request (GtkTLCell *cell, GtkRequisition *size);

(Getting the height and width at once may be quite an efficiency
win at times, and never much of a hit.)

>   gint (* event)      (GtkTLCell *cell, GdkEvent  *event, gpointer        data);

This should return a gboolean.

Regards,
                                        Owen




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