On Feb 7, 7:54 pm, "[email protected]" <[email protected]> wrote:
> On Feb 7, 8:21 pm, Thomas Broyer <[email protected]> wrote:
>
> > If you want it to do it "cleanly", I'd suggest not relying on the
> > "magic" of addDomHandler but rather just register handlers in widgets
> > using addHandler and "sinking" the native handlers yourself (in the
> > case of those events, you know you're in WebKit)
>
> Is there a way to get GWT to deliver new native events to
> Widget.onBrowserEvent(),

Yes, just use
@com.google.gwt.user.client.impl.DOMImplStandard::dispatchEvent as the
handler.

> or do I have register a listener myself in
> JavaScript code?

You'd have to register the listener anyway.

As an example, here's how I did it for drop events in Adobe AIR
(nothing AIR-specific though, could be used in any WebKit-based
browser actually). The code is still based on the pre-1.6 listener
approach, but it's not that hard to make it work the new way:
http://code.google.com/p/gwt-in-the-air/source/browse/trunk/src/net/ltgt/gwt/air/user/client/ui/DropPanel.java
http://code.google.com/p/gwt-in-the-air/source/browse/trunk/src/net/ltgt/gwt/air/user/client/ui/impl/DropPanelImplAIR.java

I'm thinking in starting a Wave about how I think event handling
should be refactored.

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.

Reply via email to