[reportlab-users] Widgets as Flowables...

Andy Robinson reportlab-users@reportlab.com
Sun, 29 Sep 2002 22:32:55 +0100


> I don't disagree, but explaining this is hard especially for the more
> dynamic things. I tried really hard to make a drawing that based itself
> on its top and found it virtually impossible; it seems the simple
> concept of a drawing size which depends on its contents is hard in our
> scheme. 

Hard? It's downright banned :-)  If I had been around I would 
have said "don't do it", but you found a way as usual.

Actually there were two problems in that case.  The problem
(for the benefit of others) was an EPS chart to be embedded
in a Quark document, next to a table of statistics.  The
table might have between 2 and 10 rows, and the bar chart 
needed the same number of bars, precisely aligned next to
the table rows.  Of course we had designed our bar charts
to "grow upwards" from a fixed bottom point, so the route out
was to let the drawing resize itself.

If we had a way to place the chart with its top edge
fixed instead of the bottom, it would have worked.  We didn't.

If the chart was able to 'report its size', one could easily 
make a 'container widget' which would 'pack' contents to a certain
edge.  This would be a generic solution to many similar problems/

I still think it's useful in 99% of cases to say that a
drawing has a known size.  But if the size is got by a method,
or even from a __getattr__ hook, no reason it cannot be worked
out when needed.  

- Andy