Eclipse Community Forums - RDF feed
https://www.eclipse.org/forums/
Eclipse Community ForumsStrange Shell behaviour
https://www.eclipse.org/forums/index.php/mv/msg/144193/453939/#msg_453939
I used in my application a Shell with ALWAYS_ON_TOP style, to allow users
to always see some important information (server alarms, ...).
I work on Linux with SuSE 8.2.
But if the user clickes on the clock in the task bar while this shell is
displayed, it disappears.
Here is a sample code (two classes: Main.java and SpyContainer.java)
public Composite getSpyComposite() {
return spyComposite;
}
}]]>hortiz Mising name2005-04-14T12:59:15-00:00Re: Strange Shell behaviour
https://www.eclipse.org/forums/index.php/mv/msg/144193/453942/#msg_453942
hortiz Mising name2005-04-14T13:55:35-00:00Re: Strange Shell behaviour
https://www.eclipse.org/forums/index.php/mv/msg/144193/453946/#msg_453946
it should not be hiding it. Try creating the spy as a child of the other
shell?
"hortiz" <hortiz@xxxxx.com> wrote in message
news:3cb48cd36c1972c97b862078d7e23aee$1@www.eclipse.org...
> Hi,
>
> I used in my application a Shell with ALWAYS_ON_TOP style, to allow users
> to always see some important information (server alarms, ...).
>
> I work on Linux with SuSE 8.2.
>
> But if the user clickes on the clock in the task bar while this shell is
> displayed, it disappears.
>
> Here is a sample code (two classes: Main.java and SpyContainer.java)
>
> /*** Main.java ******************************/
> import org.eclipse.swt.SWT;
> import org.eclipse.swt.events.SelectionAdapter;
> import org.eclipse.swt.events.SelectionEvent;
> import org.eclipse.swt.layout.GridData;
> import org.eclipse.swt.layout.GridLayout;
> import org.eclipse.swt.widgets.Button;
> import org.eclipse.swt.widgets.Display;
> import org.eclipse.swt.widgets.Shell;
>
> public class Main {
>
> private static Display display;
>
> public static void main(String[] args) {
>
> display = new Display ();
> Shell shell = new Shell (display);
> shell.setLayout(new GridLayout());
>
> Button openSpyButton = new Button(shell, SWT.PUSH);
> openSpyButton.setText("Open Spy");
> openSpyButton.setLayoutData(new GridData());
> openSpyButton.addSelectionListener(new SelectionAdapter() {
> public void widgetSelected(SelectionEvent event) {
> SpyContainer spyContainer = new SpyContainer(display);
> spyContainer.getSpyComposite().layout();
> }
> });
>
> shell.open();
>
> while (!shell.isDisposed()) {
> if (!display.readAndDispatch()) {
> display.sleep();
> }
> }
> display.dispose();
> }
> }
>
>
> /*** SpyContainer.java **********************/
>
> import org.eclipse.swt.SWT;
> import org.eclipse.swt.layout.FillLayout;
> import org.eclipse.swt.layout.GridData;
> import org.eclipse.swt.layout.GridLayout;
> import org.eclipse.swt.widgets.Composite;
> import org.eclipse.swt.widgets.Display;
> import org.eclipse.swt.widgets.Label;
> import org.eclipse.swt.widgets.Shell;
>
> public class SpyContainer {
>
> private Shell spyShell;
> private Composite spyComposite;
>
> public SpyContainer(Display display) {
>
> spyShell = new Shell(display, SWT.NO_TRIM | SWT.ON_TOP);
> // spyShell = new Shell(display, SWT.NO_TRIM | SWT.ON_TOP |
> SWT.PRIMARY_MODAL);
> // spyShell = new Shell(display, SWT.NO_TRIM | SWT.ON_TOP |
> SWT.APPLICATION_MODAL);
> // spyShell = new Shell(display, SWT.NO_TRIM | SWT.ON_TOP |
> SWT.SYSTEM_MODAL);
> // spyShell = new Shell(display, SWT.NO_TRIM | SWT.ON_TOP |
> SWT.MODELESS);
>
> spyShell.setLayout(new FillLayout(SWT.VERTICAL));
> spyComposite = new Composite(spyShell, SWT.NONE);
> spyComposite.setLayout(new GridLayout());
>
> spyComposite.setBackground(display.getSystemColor(SWT.COLOR_ DARK_RED));
>
> Label spyLabel = new Label(spyComposite, SWT.NONE);
> spyLabel.setText("Spy Label");
> spyLabel.setLayoutData(new GridData());
> spyShell.setSize(300, 300);
> spyShell.open();
> }
>
> public Composite getSpyComposite() {
> return spyComposite;
> }
> }
>
>
>]]>Steve Northover2005-04-14T14:45:41-00:00Re: Strange Shell behaviour
https://www.eclipse.org/forums/index.php/mv/msg/144193/453947/#msg_453947
>>> Try creating the spy as a child of the other shell ?
I still have the same problem...
Did you manage to reproduce it ?
Helene]]>hortiz Mising name2005-04-14T15:20:15-00:00Re: Strange Shell behaviour
https://www.eclipse.org/forums/index.php/mv/msg/144193/454179/#msg_454179
"hortiz" <hortiz@xxxxx.com> wrote in message
news:328f778bec36593db9170c31bb4ff4ac$1@www.eclipse.org...
> Hi Steve,
>
> >>> Try creating the spy as a child of the other shell ?
>
> I still have the same problem...
> Did you manage to reproduce it ?
>
> Helene
>
>
>
>]]>Steve Northover2005-04-18T20:11:18-00:00