Re: GtkCellView API changes



On Wed, 2004-10-13 at 19:05, Anders Carlsson wrote:
> Hello,
> 
> I've taken a look at the GtkCellView API which has been made public in 
> 2.5. I think that a couple of API additions and changes are needed for 
> it to be more useful and more like the rest of the GTK+ API:
> 
> void gtk_cell_view_set_value (GtkCellView     *cell_view,
>                                GtkCellRenderer *renderer,
>                                gchar           *property,
>                                GValue          *value);
> 
> void gtk_cell_view_set_values (GtkCellView     *cell_view,
>                                 GtkCellRenderer *renderer,
>                                 ...);
> 
> gtk_cell_view_set_value is good here, but gtk_cell_view_set_values takes 
>   pairs of property names and _GValues_. I suggest that we replace this 
> function with
> 
> void gtk_cell_view_set (GtkCellView     *cell_view,
> 			GtkCellRenderer *renderer,
> 			...)
> 
> and
> 
> void gtk_cell_view_set_valist (GtkCellView     *cell_view,
>     			       GtkCellRenderer *renderer,
> 			       va_list          var_args);
> 
> which is more like all other multiple property setting functions in GTK+.
> 
> Also,
> 
> void gtk_cell_view_set_cell_data (GtkCellView     *cellview);
> 
> which is supposed to be called when the underlying tree model changes 
> should be renamed to
> 
> void gtk_cell_view_update (GtkCellView *cellview);
> 

I wonder if we really need to export this function. The combo box 
currently calls it to make sure the cell view cell renderers are 
uptodate before poking at them. Maybe gtk_cell_view_get_cell_renderers
() should simply make sure that
the renderers are uptodate before returning them...


> to better reflect what the function does. Having a set function without 
> any extra arguments seems a little awkward to me.
> 
> Finally, it'd be nice to have the cell view be able to pass on mouse 
> clicks/keyboard presses to the cell views' ::activate handlers. This 
> would be done using
> 
> void gtk_cell_view_set_can_activate (GtkCellView     *cell_view,
> 			             gboolean         can_activate);
> 
> gboolean gtk_cell_view_get_can_activate	(GtkCellView *cell_view);
> 
> when the can_activate flag is true, mouse clicks on the cell view will 
> be passed on to the cell views' ::activate handlers, if any. Also, the 
> individual cells will be focusable and in the focus chain, like a single 
> row in the tree view.
> 
> I'd like comments and/or suggestions...
> 

Sounds good to me, otherwise.


Matthias






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