#2024 Web Browser Focus

SlimerDude Mon 10 Sep 2012

I have a flux view, essentially the same as flux::HtmlView. When I load it with fwt::WebBrowser.loadStr, how I then set focus on the WebBrowser? Because I always have to click in it before I can start scrolling, or for it to receive events.

I've tried many, many combinations of browser.focus in various flux events but none seem to herald results.

Stumped.

brian Mon 10 Sep 2012

My experience with the SWT browser on Windows has been that it is pretty buggy. I can't get even get it to run anymore.

Oftentimes with focus though weird things happen depending on all the stuff might be happen after a given callback. So try scheduling a focus a bit later using Desktop.callAsync

SlimerDude Mon 10 Sep 2012

Thanks for the tip!

Desktop.callLater(100ms) |->| {
  browser.focus
}

works like a charm.

Login or Signup to reply.