Thanks for sharing!
On Thu, Jul 31, 2025 at 6:56 AM Craig Mitchell <mail@craig-mitchell.com> wrote:
My OCD has been satisfied. 🙂 Thanks again Jens.public static void loadImage(String imgBase64, Consumer<HTMLImageElement> loaded) {
HTMLImageElement img = (HTMLImageElement)DomGlobal.document.createElement(ImageElement.TAG);
img.addEventListener(BrowserEvents.LOAD, e -> loaded.accept(img));
img.addEventListener(BrowserEvents.ERROR, e -> DomGlobal.console.error("Failed to load image."));
img.src = imgBase64;
}--On Thursday, 31 July 2025 at 7:45:19 pm UTC+10 Jens wrote:btw: With addEventListener, we have to use hard coded strings for the event name. Eg:img.addEventListener("load", e -> doStuff());Or are there event name constants we can use somewhere?GWT has com.google.gwt.dom.client.BrowserEvents but it is not a complete list.-- J.
You received this message because you are subscribed to the Google Groups "GWT Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscribe@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/google-web-toolkit/261f0865-534c-49e6-afdb-5e4f60e377acn%40googlegroups.com.
You received this message because you are subscribed to the Google Groups "GWT Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscribe@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/google-web-toolkit/CA%2BkiFsfPFPXypbjoTu1grVhaRxU-AFC9Bu7fPV05GC8HktaqdA%40mail.gmail.com.
No comments:
Post a Comment