zero width widgets

60 views
Skip to first unread message

Matthew Pocock

unread,
May 25, 2012, 7:59:27 AM5/25/12
to google-we...@googlegroups.com
Hi,

I seem to have recurrent problems with building up gwt layouts where things don't appear, and when I dig into the elemnt tree in chrome, I find that things are getting a zero width. Is there a standard cheat list I should be going through to debug these kind of issues?

Thanks,

Matthew

--
Dr Matthew Pocock
Integrative Bioinformatics Group, School of Computing Science, Newcastle University
skype: matthew.pocock
tel: (0191) 2566550

Derek

unread,
May 25, 2012, 9:49:33 AM5/25/12
to Google Web Toolkit
I suspect this is from mixing layoutpanels with non-layoutpanels. By
and large, layoutpanels (anything with LayoutPanel as part of its
name) need to form an unbroken chain with a previous layoutpanel all
the way back to RootLayoutPanel. If you have an HTMLPanel or
simplepanel or other non-layoutpanel between layoutpanels, the inner
layoutpanel will be sized to zero unless you explicitly set its width
and height.

On May 25, 7:59 am, Matthew Pocock <turingatemyhams...@gmail.com>
wrote:
> Hi,
>
> I seem to have recurrent problems with building up gwt layouts where things
> don't appear, and when I dig into the elemnt tree in chrome, I find that
> things are getting a zero width. Is there a standard cheat list I should be
> going through to debug these kind of issues?
>
> Thanks,
>
> Matthew
>
> --
> Dr Matthew Pocock
> Integrative Bioinformatics Group, School of Computing Science, Newcastle
> University
> mailto: turingatemyhams...@gmail.com
> gchat: turingatemyhams...@gmail.com
> msn: matthew_poc...@yahoo.co.uk

Matthew Pocock

unread,
May 25, 2012, 12:26:11 PM5/25/12
to google-we...@googlegroups.com
Ah, thanks. I had a DockLayoutPanel and was using a SimplePane as a place-holder in east, then later filling this SimplePane with a chat control. Perhaps there is a better way to dynamically replace DockLayoutPanel children. Anyway, I now tell the SimplePane to have width and height 100% (and a few other components, just to be sure), and it's laying out as I asked now.

Cheers.

Matthew

--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To post to this group, send email to google-we...@googlegroups.com.
To unsubscribe from this group, send email to google-web-tool...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.




--
Dr Matthew Pocock
Integrative Bioinformatics Group, School of Computing Science, Newcastle University

Jens

unread,
May 25, 2012, 12:29:36 PM5/25/12
to google-we...@googlegroups.com

Thad

unread,
May 27, 2012, 5:11:50 PM5/27/12
to google-we...@googlegroups.com
Yes! I must see at least one a week here "Don't mix layout and non-layout panels."

Matthew Pocock

unread,
May 28, 2012, 4:36:50 AM5/28/12
to google-we...@googlegroups.com
On 27 May 2012 22:11, Thad <thad.hu...@gmail.com> wrote:
Yes! I must see at least one a week here "Don't mix layout and non-layout panels."

If this is such a common mistake, does/should the tooling give warnings?

Matthew
 


On Friday, May 25, 2012 12:29:36 PM UTC-4, Jens wrote:
Instead of SimplePanel you could use SimpleLayoutPanel.

--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.

To post to this group, send email to google-we...@googlegroups.com.
To unsubscribe from this group, send email to google-web-tool...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.

Thomas Broyer

unread,
May 28, 2012, 6:45:15 AM5/28/12
to google-we...@googlegroups.com


On Monday, May 28, 2012 10:36:50 AM UTC+2, Matthew Pocock wrote:


On 27 May 2012 22:11, Thad <thad.hu...@gmail.com> wrote:
Yes! I must see at least one a week here "Don't mix layout and non-layout panels."

If this is such a common mistake, does/should the tooling give warnings?



The challenge here is to avoid false-positive warnings, when you add a layout panel (RequiresResize) to a non-layout-panel (ProvidesResize) but give it an explicit size.
There's also the issue of the HeaderPanel, which does not implement ProvidesResize yet provides it for its "center" child (but not for its header and footer children); which means that it would rather be the parent widget which should add the check for its children (HeaderPanel could check its "center" child but not its header and footer children, at its discretion).
Reply all
Reply to author
Forward
0 new messages