Re: VTree RFC




On Tue, 9 Mar 1999, Miguel de Icaza wrote:
> 
> I would suggest that instead of having a "user-rendered-cell", you
> support widgets.  That, by extension will support what you want to.
> 

I'm afraid this would double the complexity of the VTree, by making it a
container. I'm also not sure how it would work; remember, the idea of the
thing is that nothing is rendered unless it's actually on the screen; so
you can't just gtk_container_add() the widget. I'm open to the idea, I
just don't know how it would work. Would the user or the VTree own the
widget being displayed? 

Even with widgets I want to still have the user-rendered cell; these are
far more lightweight. The purpose of them is to support text styles, or
maybe you want to draw little rectangles or circles in your tree row, I
don't know. Some trivial examples: say you have a list of movies, and you
want star-ratings next to them; the stars can be user-drawn. Or say you
want to have a little red/yellow/green status indicator. You don't want to
write a widget for that, you just gdk_draw_circle().

The pixtext type is just a convenience thing, since you could also
user-draw it.

> You could also fold Pixmaps into that same case (as these are hard to
> get right in the first place in the presence of multi-depth and
> multi-visuals, using GnomePixmap widgets will address this in a
> correct way that would work on most SGI and Sun workstations with
> high-end displays).
> 

Won't it work to simply create the GdkPixmap with the same visual/depth as
the tree widget? Or do whatever GtkCList does?

GnomePixmap is far too heavy here - say you have 30 lines on the screen,
and you page down. That means destroying the 30 GnomePixmaps that used to
be on the screen, and creating 30 more. Far too slow, don't you think?

> >   GTK_VTREE_CELL_TOGGLE,  /* Toggle button */
> >   GTK_VTREE_CELL_RADIO,   /* Radio button */
> 
> ditto.
> 

My plan here is to support simple faux widgets; the VTree just draws a
toggle or radio and responds to clicks within the relevant cell.  I've
done something similar with gnome-apt. It uses no memory whatsoever and is
very simple and fast. (The toggle/radio buttons maintain no state; they
just report to the user vtable that they were clicked and then the tree
redisplays that row, fetching the button state from the user vtable.)

To generalize this there could be a "user event cell" and any events in 
that cell would be passed out via vtable; I don't know if that's
worthwhile? 

Havoc




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