Re: Parbox



On Mon, 25 Oct 1999, Hans Petter Jansson wrote:
> [Egil]
> 
> > But didn't he say that this widget should hold words, pixmaps an widgets.
> > That sounds to me not as if he wants one widget for each word, but one
> > that could hold a set of words, and widgets, mixed (I.e. a special
> > handling just for text and pixmaps, but all other sub-widget types are
> > handled normal).
> 
> This seems to be the turn things are taking, indeed. Though I'd prefer a GTK
> that scaled nicely all the way, of course. To me, it doesn't sound like an
> impossible task, as you'd only have to lay out the words and widgets actually
> in view (in the case of a long document).
> 
> If every word could have a lightweight widget wrapper, it'd make life easy -
> you could for instance set attributes such as interactiveness (signal
> catching) for certain words/phrases - voila, hyperlinks. And special visual
> attributes? No problem.
> 
> But if the GtkObjects are inherently slow for massive allocation purposes, I
> suppose it should be done through a more apt interface (memory/processing is
> cheap, but not that cheap these days). So, we add some magic hair to it.
> 

I think what you need here is known in the "patterns" fraternity as the
"flyweight" pattern. There may be other alternatives, but the Gang of Four
patterns book description of Flyweight would not be a bad place to start, as it
least would give you the benefit of other people's thoughts on this issue. Of
course you may need to translate it from C++-speak, depending upon your
implementation lamguage of choice.

Regards
M.Beach



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