Last week, we had the author of TDD for a Shopping Website LiveProject. Friday at 11am Ranch time, Steven Solomon will be hosting a live TDD session just for us. See for the agenda and registration link
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
Bartenders:
  • Piet Souris
  • Himai Minh

GWT load images - wait & notify or lock & unlock mechanism is needed

 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi

I have a GWT application where I'm loading lot of images and soon after I am drawing part of them into a canvas.
The problem is that the images are loading asynchronously and I can't be sure that there are available for use use later own in the code.

The solutions to use onImageLoad, is insufficient for my application because that at this time, I have no idea how will the application use them.

The best way for me would be to use some wait/notify or lock/unlock mechanism together with the onImageLoad, but I couldn't find any sample of such mechanism (or similar).

any Idea?

P.S - I prefer a solution from the official GWT SDK and not an extension (or at least a very small one).

Thanks
Muky.

 
Bartender
Posts: 11497
19
Android Google Web Toolkit Mac Eclipse IDE Ubuntu Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Why are you concerned if the image is fully loaded in your code later? Browsers are smart enough to figure that out aren't they?
If your images are static, have you considered using ClientBundle?
Edit: Corrected url tags
 
Shahar Muky
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks, that helped a lot.

Also the post on: http://comments.gmane.org/gmane.org.google.gwt/59017
 
It sure was nice of your sister to lend us her car. Let's show our appreciation by sharing this tiny ad:
Free, earth friendly heat - from the CodeRanch trailboss
https://www.kickstarter.com/projects/paulwheaton/free-heat
reply
    Bookmark Topic Watch Topic
  • New Topic