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('../')
        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)

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.)

Peter

Reply via email to