Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » Setting source of SelectionEvent
Setting source of SelectionEvent [message #448413] Sat, 08 January 2005 15:58 Go to next message
Eclipse UserFriend
Originally posted by: fleque.users.NoSpam.sourceforge.net

Hi all,

I'm trying to implement a Composite accepting and notifying
SelectionListeners. So far so good, but I'm not able to instantiate a
SelectionEvent and set its source.

Is there a way?

Regards Alex
Re: Setting source of SelectionEvent [message #448762 is a reply to message #448413] Thu, 13 January 2005 20:19 Go to previous messageGo to next message
Grant Gayed is currently offline Grant GayedFriend
Messages: 2150
Registered: July 2009
Senior Member
Alex,

You just create a regular Event object, set its widget field, and send it
with Widget.notifyListeners(SWT.Selection, yourEvent).

Grant

"Fleque" <fleque@users.NoSpam.sourceforge.net> wrote in message
news:crovuf$74i$1@www.eclipse.org...
> Hi all,
>
> I'm trying to implement a Composite accepting and notifying
> SelectionListeners. So far so good, but I'm not able to instantiate a
> SelectionEvent and set its source.
>
> Is there a way?
>
> Regards Alex
Re: Setting source of SelectionEvent [message #448769 is a reply to message #448762] Thu, 13 January 2005 20:51 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: fleque.users.NoSpam.sourceforge.net

Thanks for your answer Grant,

I had a look at this possibility (and some implementations of Widgets)
and found the ?prefered? way to add listeners is by adding a
TypedListener. I can do that in my Composite but can not remove it as I
can not access the package-visible member of Widget eventTable to invoke
unhook. Is there an other way to remove the listener ??

Regards Alex



Grant Gayed wrote:
> Alex,
>
> You just create a regular Event object, set its widget field, and send it
> with Widget.notifyListeners(SWT.Selection, yourEvent).
>
> Grant
>
Re: Setting source of SelectionEvent [message #448877 is a reply to message #448769] Fri, 14 January 2005 14:45 Go to previous message
Grant Gayed is currently offline Grant GayedFriend
Messages: 2150
Registered: July 2009
Senior Member
Widget.removeListener(int, Listener) should do what you want.

Grant

"Fleque" <fleque@users.NoSpam.sourceforge.net> wrote in message
news:cs6n09$9on$1@www.eclipse.org...
> Thanks for your answer Grant,
>
> I had a look at this possibility (and some implementations of Widgets)
> and found the ?prefered? way to add listeners is by adding a
> TypedListener. I can do that in my Composite but can not remove it as I
> can not access the package-visible member of Widget eventTable to invoke
> unhook. Is there an other way to remove the listener ??
>
> Regards Alex
>
>
>
> Grant Gayed wrote:
> > Alex,
> >
> > You just create a regular Event object, set its widget field, and send
it
> > with Widget.notifyListeners(SWT.Selection, yourEvent).
> >
> > Grant
> >
Previous Topic:Image with transparent background
Next Topic:TableEditor Question
Goto Forum:
  


Current Time: Thu Apr 25 23:31:59 GMT 2024

Powered by FUDForum. Page generated in 0.03453 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top