Tables was: Re: I need a standard single line text entry widget

yampa at mindspring.com yampa at mindspring.com
Thu Apr 11 01:37:36 UTC 2002


On Wed, 10 Apr 2002 21:19:42 +0200 Karl Ramberg <karl.ramberg at chello.se> wrote:



yampa at mindspring.com wrote:


>Cool. This maybe overlaps my html table support >for Scamper. 
>With that I build a series of morphs to something >that finaly
>ends up as a proportional layout. It's very nasty >code and 
>very slow but layout of tables are shaping up, >including rowspan 
>and colspan, and width specs in pixel, percent or >nil.
>Nested tables have to be rendered several times >though...

>I would love to look at your code for this.


Karl

Sure, just be aware that this is my first experience with XML.

The XML code part of it is very simple.  I just took the regular XML parser YAXO and read and write a very simple XML document with it.  The parser is doing all the hard stuff.  BobsUI uses a lot of nested alignment morphs, like nested tables, but it was easy to do the nesting using the xml and simple recursion in the builder.  If you are having difficulty with the parsing, you might be able to parse the table description with a modified XML parser.  Once you get  an xmlDocument object, you can query it like a dictionary, like I do.  You can't do this with the whole html document, but a table description is XML-ish enough that maybe you can code for some special cases and get away with it. So for parsing the whole document, you'd use an html parser up until you hit a table, then switch to the modified xml parser, then back to the html parser when the table is done.








More information about the Squeak-dev mailing list