Skip to main content



      Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » SWT EVENTS CAPTURING IN LINUX
SWT EVENTS CAPTURING IN LINUX [message #494978] Tue, 03 November 2009 07:42 Go to next message
Eclipse UserFriend
Hi everybody!

I've got a real rare problem with events: I have a SWT Table with two
columns: each one has a control. Each control has a Listener for the
SWT.focusOut event. Problem: It doesn't enter in the handleEvent() of
the listener if executing in Linux (it seems not being capturing it!).
In Windows it works fine.

Does anybody has an idea to solve it? All suggestions will be welcome!!

Thanks in advance.

Juan M.A.N.

--------------------------------------
Hi Juan,

This seems an SWT issue. I have moved it to that newsgroup.

Best Regards,

Wim Jongman
----------------------------------------
Re: SWT EVENTS CAPTURING IN LINUX [message #495075 is a reply to message #494978] Tue, 03 November 2009 12:27 Go to previous message
Eclipse UserFriend
Hi,

This works for me with the snippet below, does the snippet work for you? If
so, can you change it to more closely resemble your case and to show
FocusOut not being received by the editor control?

public class ModifiedSnippet149 {
public static void main(String[] args) {
Display display = new Display();
Shell shell = new Shell(display);
shell.setLayout (new FillLayout ());
Table table = new Table (shell, SWT.BORDER);
table.setHeaderVisible (true);
table.setLinesVisible(true);
for (int i=0; i<2; i++) {
new TableColumn (table, SWT.NONE);
}
table.getColumn (0).setText ("Task");
table.getColumn (1).setText ("Progress");
for (int i=0; i<40; i++) {
TableItem item = new TableItem (table, SWT.NONE);
item.setText ("Task " + i);
if ( i % 5 == 0) {
for (int j = 0; j < 2; j++) {
Combo bar = new Combo (table, SWT.NONE);
TableEditor editor = new TableEditor (table);
editor.grabHorizontal = editor.grabVertical = true;
editor.setEditor (bar, item, j);
bar.addListener(SWT.FocusOut, new Listener() {
public void handleEvent(Event event) {
System.out.println("focus out");
}
});
}
}
}
table.getColumn (0).pack ();
table.getColumn (1).setWidth (128);
shell.pack ();
shell.open();
while (!shell.isDisposed()) {
if (!display.readAndDispatch()) display.sleep();
}
display.dispose();
}
}

Grant


"Wim Jongman" <wim.jongman@remainsoftware.com> wrote in message
news:hcp8fg$662$1@build.eclipse.org...
> Hi everybody!
>
> I've got a real rare problem with events: I have a SWT Table with two
> columns: each one has a control. Each control has a Listener for the
> SWT.focusOut event. Problem: It doesn't enter in the handleEvent() of
> the listener if executing in Linux (it seems not being capturing it!).
> In Windows it works fine.
>
> Does anybody has an idea to solve it? All suggestions will be welcome!!
>
> Thanks in advance.
>
> Juan M.A.N.
>
> --------------------------------------
> Hi Juan,
>
> This seems an SWT issue. I have moved it to that newsgroup.
>
> Best Regards,
>
> Wim Jongman
> ----------------------------------------
Previous Topic:Concurrently modifying position in an IDocument
Next Topic:Selecting text in multiple Text widgets simultaneously with SWT.MULTI style - can I stop this?
Goto Forum:
  


Current Time: Mon Jul 07 11:43:17 EDT 2025

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

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

Back to the top