| Hide Shell [message #734724] |
Sun, 09 October 2011 11:23  |
Mark Missing name Messages: 44 Registered: July 2009 Location: Ohio, USA |
Member |
|
|
I need to open a shell window to respond to events even though the window is hidden until a user wants to see it. It all works except that the window appears briefly just after the open() method before going into hiding (because setVisible(false) is called immediately after the open() method).
I tried putting setVisible(false) in the configureShell() method and in the createContents() method, but it seems to be ignored there. I also tried putting setShellStyle(SWT.Hide) just prior to Open(), but that also is ignored.
So how do I create a window without it appearing even for a moment?
Mark
|
|
|
| Re: Hide Shell [message #735053 is a reply to message #734724] |
Mon, 10 October 2011 15:20   |
 |
Lakshmi Shanmugam Messages: 271 Registered: July 2009 Location: India |
Senior Member |
|
|
Hi,
The window appears because Shell.open() marks the window as visible and makes it the active shell (please see the javadoc of Shell.open()). So, don't call open() until you want to show the window.
Lakshmi P Shanmugam
[Updated on: Mon, 10 October 2011 15:20] Report message to a moderator
|
|
|
| Re: Hide Shell [message #735144 is a reply to message #735053] |
Tue, 11 October 2011 00:35   |
Vijay Raj Messages: 603 Registered: July 2009 |
Senior Member |
|
|
Just Out of curiosity,
Why do you require a window shell without visibility?
---------------------
why, mr. Anderson, why, why do you persist?
Because I Choose To.
Regards,
Vijay
|
|
|
|
|
|
| Re: Hide Shell [message #736890 is a reply to message #736006] |
Fri, 14 October 2011 08:41   |
 |
Lakshmi Shanmugam Messages: 271 Registered: July 2009 Location: India |
Senior Member |
|
|
The window is created when you call new Shell(). Shell.open() moves the receiver to the top of the drawing order, marks it visible, sets the focus and asks the window manager to make the shell active (from the javadoc).
So, you will be able to add the controls to the Shell even if you have not called open().
You can choose to show the Shell either using Shell.open() or Shell.setVisible(true). And hide the Shell using Shell.setVisible(false) (Shell.close() will dispose the shell)
Lakshmi P Shanmugam
[Updated on: Fri, 14 October 2011 08:42] Report message to a moderator
|
|
|
| Re: Hide Shell [message #737196 is a reply to message #736890] |
Fri, 14 October 2011 15:22  |
Mark Missing name Messages: 44 Registered: July 2009 Location: Ohio, USA |
Member |
|
|
Sweet! (or should I say "SWT!"?)
I commented out open() and replaced it with createShell(), createContents(), setActive() and setVisible(false) to get the behavior I wanted. I also had to override getShell() to return the one given me from the call to createShell().
Thanks for the help! I'm all fixed!
Mark
|
|
|
Powered by
FUDForum. Page generated in 0.02173 seconds