Here's an interesting excerpt from the GWT Developer Documentation:

"
For users who create their own Widgets, you no longer need to manage
listeners manually. Every widget has a HandlerManager that manages all
of its handlers. For native events, such as ClickEvent, just call
addDomHandler() from within your code to register a handler and sink
the associated event on the Widget. When the native event is detected,
the handler will automatically be called. For logical events, such as
SelectionEvent, call addHandler() and fire the event manually using
the fireEvent() method.

You can see examples of EventHandler usage in many of the updated GWT
widgets and samples, or in new projects created with the new
webAppCreator tool.
"

I hope that helps,

Salvador

On May 6, 8:50 pm, Stephen Cagle <same...@gmail.com> wrote:
> This is probably a really simple thing, but I don't know how to
> implement the following.
>
> package mods.client.resultSelector;
>
> import com.google.gwt.event.dom.client.MouseDownEvent;
> import com.google.gwt.event.dom.client.MouseDownHandler;
> import com.google.gwt.event.dom.client.MouseMoveEvent;
> import com.google.gwt.event.dom.client.MouseMoveHandler;
> import com.google.gwt.event.dom.client.MouseOutEvent;
> import com.google.gwt.event.dom.client.MouseOutHandler;
> import com.google.gwt.event.dom.client.MouseUpEvent;
> import com.google.gwt.event.dom.client.MouseUpHandler;
> import com.google.gwt.user.client.ui.AbsolutePanel;
> import com.google.gwt.user.client.ui.Composite;
>
> public class MousyAbsolutePanel extends Composite implements
> MouseDownHandler {
>
>         AbsolutePanel abs = new AbsolutePanel();
>
>         public MousyAbsolutePanel(int width){
>                 System.out.println("MousyAbsolutePanel being created with 
> width:" +
> width);
>                 initWidget(abs);
>                 abs.setWidth(String.valueOf(width));
>                 abs.setHeight("100%");
>                 abs.setStyleName("mousyAbsolutePanel");
>         }
>
>         public void onMouseDown(MouseDownEvent event) {
>                 System.out.println("onMouseDown()");
>         }
>
> }
>
> I want to have what is effectively a absolutePanel that can accept
> mouse events. However, within the Composite object I don't know how to
> tie the the handler I have written (the onMouseDown() thing) with the
> abs variable. To put it sucinctly, I wan the abs AbsolutePanel to
> respond when it is clicked upon, but AbsolutePanels do not naturally
> accept click events. How do I go about doing this?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to Google-Web-Toolkit@googlegroups.com
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to