Re: Adding event handler from *outside* widgets

2009-08-04 Thread max3000

An onResize event. Although I'm getting no luck so far...

On Jul 31, 1:37 pm, Isaac Truett itru...@gmail.com wrote:
 What sort of event are you trying to add to HorizontalSplitPanel? A
 Composite might make more sense.

 On Fri, Jul 31, 2009 at 1:13 PM, max3000maxime.lar...@gmail.com wrote:

  And what to do when the widget is final like HorizontalSplitPanel?
  (SplitPanel is even package-scoped).

  Thanks,

  Max

  On Jul 30, 2:57 pm, Isaac Truett itru...@gmail.com wrote:
  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, max3000maxime.lar...@gmail.com 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 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
-~--~~~~--~~--~--~---



Re: Adding event handler from *outside* widgets

2009-07-31 Thread max3000

And what to do when the widget is final like HorizontalSplitPanel?
(SplitPanel is even package-scoped).

Thanks,

Max



On Jul 30, 2:57 pm, Isaac Truett itru...@gmail.com wrote:
 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, max3000maxime.lar...@gmail.com 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 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
-~--~~~~--~~--~--~---



Re: Adding event handler from *outside* widgets

2009-07-31 Thread Isaac Truett

What sort of event are you trying to add to HorizontalSplitPanel? A
Composite might make more sense.

On Fri, Jul 31, 2009 at 1:13 PM, max3000maxime.lar...@gmail.com wrote:

 And what to do when the widget is final like HorizontalSplitPanel?
 (SplitPanel is even package-scoped).

 Thanks,

 Max



 On Jul 30, 2:57 pm, Isaac Truett itru...@gmail.com wrote:
 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, max3000maxime.lar...@gmail.com 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 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
-~--~~~~--~~--~--~---



Re: Adding event handler from *outside* widgets

2009-07-30 Thread Isaac Truett

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, max3000maxime.lar...@gmail.com 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 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
-~--~~~~--~~--~--~---