简体   繁体   中英

GWT MouseOut event on a Composite

I have:

  1. created a Composite,
  2. initWidget-ed with an AbsolutePanel
  3. added some Widgets to the Composite
  4. in the Composite constructor attached a MouseOut handler

What I wanted to reach is detecting when the mouse is out of the Composite (or AbsolutePanel), but the MouseOut handler is fired whenever the mouse is out of any wideget in the AbsolutePanel.

Is there any clean way I can reach detecting the AbsolutePanel out?

The GWT I'm using is 2.0, with no add-ons (and I don't want to use any).

OK, I've found a solution.

I extended the AbsolutePanel class, so that implements HasMouseoutHandlers. Now, instead of adding MouseHandler to the Composite, I add it to the MyAbsolutePanel only. This works fine.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM