Re: VTree RFC



On Tue, Mar 09, 1999 at 10:31:39PM -0500, Havoc Pennington wrote:
> 
> 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().

An incredibly lightweight implementation seems more interesting to me than
one that supports widgets. This is the direction I've taken with my Outline
widget (in Think, cvs module 'think'), except that the Outline is
canvas-based. This widget isn't nearly as lightweight as VTree could be,
though.

We discussed a thin tree widget a while ago, and I was planning on putting
some code down for an implementation later this week.. I finally have a
week and a half or so of hacking time. I'd be glad to help out if you
need it.

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

What would this be used for? Why not provide a function to draw it (and
possibly some other common data types) with the widget itself? Then you
would just set the drawing function to whatever you want, whether it be you
own rendering function or one of those. I don't see the need for a
distinction.. GtkVTreeCellType appears to just complicate things, at first
glance.

> > 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?

I'd consider that too heavy. ThinkOutline basically does that now, and I
think we need an different widget to be a completely lightweight tree.

The use of this widget looks like it might be similar to the ThinkOutline.
I'll make my API match whatever is decided for VTree, so it would be fairly
easy to switch between the two. Some sort of correspondence between
function names & concepts is always helpful.

I've been thinking - perhaps a VList widget is in order, as well. I like
the lightness of this widget, and there are certainly places where a more
lightweight list could be useful.

Peter
-- 
Peter Teichman
pat4@acpub.duke.edu



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