Hi Adam, Thanks for all the great ideas. I also think it has to do with images not being fully loaded. This has been my biggest hurdle with GWT. I tend to use a lot of images, and rely a lot on image sizes, but they aren't very reliable because of the fact that the image could be initialized, without being downloaded yet. I didn't know Load Handlers existed. That stinks it doesn't work well with IE. I think I do need to look into using the CSS more with %'s.
Thanks again for all the ideas! Sean On Jun 28, 5:02 am, Adam T <adam.t...@gmail.com> wrote: > You can generally hook into when a widget is ready in the DOM by > overriding it's onLoad() method. > > However, if you have Images you need to do more work as whilst the DOM > aspect of the Image widget may be ready in DOM it may not have size as > the actual image is not downloaded yet - your resizing is most likely > working a second time around as images are also already cached and > available immediately. > > I can think of two options of the top of my head, there are probably > more > > a) use LoadHandlers on your Image(s) these will tell you when the > Image has loaded and then you can trigger your resize (however, it's > not 100% perfect with IE and the current version of GWT > -http://code.google.com/p/google-web-toolkit/issues/detail?id=863&q=ie...) > b) enforce Image size using CSS either directly on the Image, or put > the Image widget in another container (SimplePanel, for example) and > set Image to 100% and size of SimplePanel to what you require through > CSS > c) do what you're doing with a timer until approach in (a) is fixed in > gwt > > I wonder though if you can't achieve what you want just by using > percentages in Style Sheet.... > > Hope that helps > > //Adam > > On 27 Juni, 16:42, Sean <slough...@gmail.com> wrote: > > > I'm having trouble with pictures loading fully to know a widgets full > > size. I have my main website component as a Composite. It's got quite > > a few pictures, including one large one. I place this main component > > on an Absolute Panel. I have a Resize Listener to figure out how big > > the Client Window is, and if it's larger then the main component, make > > the Absolute Panel as big as the Client window and put the main > > component in the middle of the ABS. > > > It works perfectly when the page is cached, however, if it's not, the > > size of the main component can be anywhere from 0-300-to1044(it's full > > size) depending on what's loaded the first time I try to arrange them > > all together. > > > How can I, besides using a timer with an arbitrary time, know when all > > of the main component's sub-components are loaded to know when to call > > the resize function? > > > Thank you! --~--~---------~--~----~------------~-------~--~----~ 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-Web-Toolkit@googlegroups.com To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/Google-Web-Toolkit?hl=en -~----------~----~----~----~------~----~------~--~---