Re: GtkIconView



On Wed, 2004-11-24 at 01:22 +0100, Michael Natterer wrote:
> Owen Taylor <otaylor redhat com> writes:
> 
> > Quick poll, we're trying to judge how much GtkIconView has been tested,
> > since it's only 3 weeks or so until the scheduled 2.6.0 release
> >
> >  Have you used GtkIconView?
> 
> No.
> 
> >  Did it meet your apps needs?
> 
> No. As already mentioned earlier on irc, it should not have a
> "text-column" and "pixbuf-column" based API, but a cellrenderer based
> one instead. Sorry for not bringing this up earlier, but I simply
> forgot about that discussion.
> 
> (The actual use case for this cellrenderer based API in GIMP would be
> to not use pixbuf renderers, but "GimpCellRendererViewable", which
> creates its preview lazily, whereas with a pixbuf based API requires
> all previews be rendered beforehand, which can impose quite some delay
> upon creating the view).
> 
> The API is also not very GtkTreeViewish, it lacks a mapping from model
> rows to view properties (due to the lack of renderers) and it also
> lacks the concept of a "data_func", which is very useful sometimes.
> It's a completely different API even though it should be a similar one.
> 
> >  Any problems?
> 
> See above. We won't be able to use it to reimplement our
> insane grid view hack which currently uses GtkWrapBox.

I believe we should be able to add a cellrenderer-based API in 2.8,
along the lines of 

void 
gtk_icon_view_pack_start    (GtkIconView     *view,
                             GtkCellRenderer *cell,
                             gboolean         expand);
void 
gtk_icon_view_add_attribute (GtkIconView     *view,
                             GtkCellRenderer *cell,
                             const gchar     *attribute,
                             gint             column);
void 
gtk_icon_view_set_cell_data_func (GtkIconView      view,
                                  GtkCellRenderer *cell,
                                  CellDataFunc     func,
		                  gpointer         func_data,
                                  GtkDestroyNotify destroy);

The current set_{text,markup,pixbuf}_column() API can be kept
as a "toy" API, and can be implemented by setting up the
necessary cell rendererers and attributes. 
The orientation is still useful to determine if the cell 
renderers will be layed out horizontally or vertically.
Do you envision the need to arrange cell renderers different
from that ?

Matthias





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