tags:

views:

43

answers:

1

I want to develop a System Virtual KeyBoard with SWT technology on the platform of powerpc under Ubuntu,and what the problem i meet is that how to make the Shell lose focus when initializing the Shell Window.

A: 

The open() method of the Shell class makes a shell visible and asks the window manager to make it become active. In most cases, the active shell is the top-most shell on the desktop and the one with focus.

If you want to make a shell visible but not active, then you might try calling the setVisible() method instead of open().

For example, I tried the following on my PC and it started the shell without focus:

Display display = new Display();
Shell shell = new Shell(display);
shell.setText("Example Shell");
shell.setVisible(true);
while (!shell.isDisposed()) {
    if (!display.readAndDispatch()) {
        display.sleep();
    }
}
display.dispose();
bporter