Splash/Shell resize problems on Linux (Ubuntu 10.04) [message #716834] |
Thu, 18 August 2011 14:41 |
Steve Goodrich Messages: 13 Registered: February 2010 Location: Colorado |
Junior Member |
|
|
I've implemented an extension to the BasicSplashHandler, although this really has to do with the Shell class. I take the Shell, get its original bounds, add some controls to it, and get the user's login information. Once I have the user's info, I want to restore the Shell to its original size. Here's what I'm doing to restore the Shell:
void restoreSplashScreen(Shell splash, Rectangle bounds) {
// don't show while we rearrange things
splash.setVisible(false);
// now discard our controls and restore the original splash screen
for (Control control : splash.getChildren()) {
control.dispose();
}
// restore the splash screen size/location
splash.setBounds(bounds);
// Now show it
splash.layout();
splash.setVisible(true);
}
On Windows, the Shell returns to normal. On Linux, the Shell stays at its larger size.
I've tried setLocation() and setSize(), pack(), redraw(), and update()... but I can't get this window to return to its original size.
FWIW: the RESIZE style is not set (is there a way to set this after the window is created?), and there is no Layout nor LayoutData associated with the Shell (layout is null).
Can anyone help with this?
Thanks!
-- Steve G.
|
|
|
|
Re: Splash/Shell resize problems on Linux (Ubuntu 10.04) [message #717027 is a reply to message #716894] |
Fri, 19 August 2011 05:41 |
Vijay Raj Messages: 608 Registered: July 2009 |
Senior Member |
|
|
Quote:What layout manager you are using? IMHO setting the bounds is useless if you invoke layout immediately later.
Yes i also agree on this,but if there is no layout management ,then how were you managing the controls which u disposed in your code.
either way layout and bounds are not related unless there is a parent with a layout.(correct me if i am wrong)
try by only setting bounds.
---------------------
why, mr. Anderson, why, why do you persist?
Because I Choose To.
Regards,
Vijay
|
|
|
Re: Splash/Shell resize problems on Linux (Ubuntu 10.04) [message #718493 is a reply to message #716834] |
Wed, 24 August 2011 13:54 |
Grant Gayed Messages: 2150 Registered: July 2009 |
Senior Member |
|
|
The lines you've posted seem fine, splash.setBounds() should be all you
need to do since splash doesn't have a Layout set on it. The Shell does
not need the SWT.RESIZE creation style in order for you to change its
bounds, this bit just controls whether resize handles should be
available to the user for dragging.
Is it possible that the setBounds() is succeeding but the size is then
being influenced some time later in your code? After invoking
setBounds() what does getBounds() answer? Does this answer change
later? If none of this sheds any light on what's happening then you
could be seeing a bug, especially since this works on win32 for you. If
you think this is the case then you should log a bug with SWT at
https://bugs.eclipse.org/bugs/enter_bug.cgi?product=Platform&component=SWT
for further investigation.
Grant
On 8/18/2011 10:41 AM, Steve Goodrich wrote:
> I've implemented an extension to the BasicSplashHandler, although this
> really has to do with the Shell class. I take the Shell, get its
> original bounds, add some controls to it, and get the user's login
> information. Once I have the user's info, I want to restore the Shell to
> its original size. Here's what I'm doing to restore the Shell:
>
> void restoreSplashScreen(Shell splash, Rectangle bounds) {
>
> // don't show while we rearrange things
> splash.setVisible(false);
>
> // now discard our controls and restore the original splash screen
> for (Control control : splash.getChildren()) {
> control.dispose();
> }
>
> // restore the splash screen size/location
> splash.setBounds(bounds);
>
> // Now show it
> splash.layout();
> splash.setVisible(true);
> }
>
> On Windows, the Shell returns to normal. On Linux, the Shell stays at
> its larger size.
>
> I've tried setLocation() and setSize(), pack(), redraw(), and
> update()... but I can't get this window to return to its original size.
>
> FWIW: the RESIZE style is not set (is there a way to set this after the
> window is created?), and there is no Layout nor LayoutData associated
> with the Shell (layout is null).
>
> Can anyone help with this?
>
> Thanks!
> -- Steve G.
|
|
|
|
Powered by
FUDForum. Page generated in 0.03584 seconds