On Sat, Mar 10, 2012 at 9:49 PM, Peter Bittner <[email protected]> wrote:
> Thanks Luke,
>
>> logo.setID("logo")
>
> setID is cool, works fine!
>
> What makes me think is the result. Let me now confront the two solutions:
>
> info = '''<a href="../" title="Home"><img
> src="../img/pyjamas.64x64.png" id="logo"></a>
> <h1>Git Repository Viewer</h1>'''
> panel = VerticalPanel()
> panel.add(HTML(info))
>
> 5 lines of code. Not clear what's all mangled into the info variable.
> Additional CSS necessary to align the logo on the left of the
> h1-header. Generated code acceptable (a table cell that encapsulates
> the content of info; therefore, info's objects can/must be freely
> placed using CSS).
>
> header = HorizontalPanel()
> logo = Image('../img/pyjamas.64x64.png')
> link_logo = Anchor(Widget=logo, Title='Home')
> link_logo.href.set('../')
really that should be this:
link_logo = Anchor(Widget=logo, Title='Home', Href='../')
> title = HTML('<h1>Git Repository Viewer</h1>')
> header.add(link_logo)
> header.add(title)
>
> panel = VerticalPanel()
> panel.add(header)
>
> 9 lines of code. Pretty clear what is intended. Almost no additional
> CSS needed (logo image needs border:0 for IE; title needs
> padding-top:0.5em, because I can't figure out how to set
> VerticalAlignment on the table cell). Generated code for this portion
> is probably 10 times the size of above (table cells everywhere with
> gwt CSS-classes, an (unneeded?) div around the plain HTML), feels a
> bit scary.
:)
> I'm okay with the table use in general (I have read the FAQ! :-) ),
> but is it possible somehow to disable excessive use of
> class="gwt-something" in every second tag and (align="left"
> style="vertical-align: top; ") in every single td tag? It must have a
> massive impact on the application's performance when the source code
> is double or triple the size that is could be. (e.g. for td tags a
> default CSS file could apply the vertical-alignment setting to each an
> every cell globally with just a single line)
*sigh* no, not really.
the designer of GChart solved one usage-case in GChart, by creating a
special type of panel that dealt with certain types of web browsers
having hash tables that were too small (!). realllly awkward stuff,
but he did it.
you're talking about optimisations, and we've not really got the
resources to handle optimisations. i won't stop anyone _contributing_
such optimisations though.
> Just to state this explicitly, this is probably GWT's fault, not
> exactly Pyjamas. (It's not about that GWT does it better or so.)
it's the "divs vs tables" thing. to get guaranteed behaviour (99.9%
anyway) tables had to be used.
GWT has the resources to implement the new design of panels for GWT 2.
it's always possible to convert those to pyjamas.
l.