Widgets, at least in the core GWT library, already have methods to add handlers for events that they support. If you're adding a custom event handler for a custom event that's not part of the Widget's API, then it makes sense to subclass the widget because you are, in fact, creating a new type of Widget.
On Thu, Jul 30, 2009 at 10:51 AM, max3000<[email protected]> wrote: > > Hi, > > I find it very annoying that one can't add event handlers to widgets > *outside* the widget itself. Am I missing something or is there no way > this can be done elegantly? > > I'm thinking something like: > > panel.addHandler(ResizeEvent.getType(), new ResizeHandler() { > public void onResize(ResizeEvent event) { > view.refresh(true); > } > }); > > I find myself constantly extending widgets simply to add such > handlers. > > Thanks, > > Max > > > > --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
