How to capture MouseEvents on a TableColumn [message #437604] |
Tue, 08 June 2004 14:03  |
Eclipse User |
|
|
|
Does anyone know how MouseEvents can be observed on a TableColumn?
For sure, SelectionListeners can be added to a TableColumn, but that does
not do the trick, since right-click events are not captured. Adding a
MouseListener to the underlying Table control is no good either, since it
does not issue any events on the table header/columns.
The lack of this basic feature (like presenting a context menu for a column,
for instance) is quite a show stopper in my application. Therefore, any help
is greatly appreciated!
Cheers
Erik
|
|
|
|
Re: How to capture MouseEvents on a TableColumn [message #437643 is a reply to message #437640] |
Wed, 09 June 2004 02:33   |
Eclipse User |
|
|
|
Michael,
thanks for your suggestion. I did try your approach as well, however with no
effect. No events reach the handleEvent-method at all, which confuses me.
Enlighten me please, anyone?!?
I think the underlying "problem" (regarding my original ?: how to capture
mouse events on a TC) might be that headers of Table objects are
"unreachable", since Eclipse relies heavily on the OS for this. But then
again, it is possible to add a SelectionListener to a TableColumn, so why
should it be impossible to add a MouseListener?!?
Any help on this topic is very welcome.
Erik
"Michael Xia" <yun@rti.com> skrev i meddelandet
news:ca5ka1$nog$1@eclipse.org...
> I haven't tried it, but try to just use addListener().
>
> TableColumn.addListener(SWT.MouseDown, new Listener() {
> public void handleEvent(Event event) {
> }
> });
>
> Then in handleEvent(), you could check if it's right or left mouse click
> and process it accordingly.
>
> Michael
>
>
|
|
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.04478 seconds