Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » Weird problems resizing Shell with 'setBounds()'
Weird problems resizing Shell with 'setBounds()' [message #461490] Mon, 26 September 2005 15:24 Go to next message
Eclipse User
Originally posted by: rdgod.hotmail.com

Greetings,

I created a WindowManager that has a function that iterates through every
Window, resizes their Shell, and then relocates them (on the default
display screen) using 'setBounds()'. I then created an Action that
executes that function. The problem I'm experiencing with 'setBounds()'
is that the Shell is resized correctly but the location is incorrect.

I began adding "sleep" code in order to try and isolate the problem. What
I found is that when 'setBounds()' is executed, the frame is moved WITHOUT
resizing the Shell. Since the Shell hasn't been resized, it will only be
moved as far as its "size" will allow (without exceeding the boundaries of
the display). Only when the Action is complete will the Shell finally be
resized. Thus, even though the Shell is the proper size, its location is
incorrect.

Does anyone have any ideas? (Basically, I'm trying to create a tiling
function.)

Thanks.
Re: Weird problems resizing Shell with 'setBounds()' [message #461598 is a reply to message #461490] Mon, 26 September 2005 23:13 Go to previous messageGo to next message
Steve Northover is currently offline Steve Northover
Messages: 1636
Registered: July 2009
Senior Member
Sounds like a Window Manager feature/problem. Some Window Managers do not
allow windows to be open off of the display.

"Supreme Overlord" <rdgod@hotmail.com> wrote in message
news:0fcefb15eaecf6599697132b58052a5d$1@www.eclipse.org...
> Greetings,
>
> I created a WindowManager that has a function that iterates through every
> Window, resizes their Shell, and then relocates them (on the default
> display screen) using 'setBounds()'. I then created an Action that
> executes that function. The problem I'm experiencing with 'setBounds()'
> is that the Shell is resized correctly but the location is incorrect.
>
> I began adding "sleep" code in order to try and isolate the problem. What
> I found is that when 'setBounds()' is executed, the frame is moved WITHOUT
> resizing the Shell. Since the Shell hasn't been resized, it will only be
> moved as far as its "size" will allow (without exceeding the boundaries of
> the display). Only when the Action is complete will the Shell finally be
> resized. Thus, even though the Shell is the proper size, its location is
> incorrect.
>
> Does anyone have any ideas? (Basically, I'm trying to create a tiling
> function.)
>
> Thanks.
>
Re: Weird problems resizing Shell with 'setBounds()' [message #1021725 is a reply to message #461598] Wed, 20 March 2013 15:25 Go to previous messageGo to next message
John Henckel is currently offline John Henckel
Messages: 2
Registered: March 2013
Junior Member
I have the same problem. Anyone know a solution?
Re: Weird problems resizing Shell with 'setBounds()' [message #1022764 is a reply to message #1021725] Fri, 22 March 2013 13:31 Go to previous message
John Henckel is currently offline John Henckel
Messages: 2
Registered: March 2013
Junior Member
Solution: you have to set the bounds before you open the window, and after you open, you have to call layout(). I found that the same code will work fine on Win7 using Aero, but then not work when using the Classic theme. So be sure to test both.

john
Previous Topic:No Mouse-Events from an open Combo -Box
Next Topic:SWT source code for 32-bit Eclipse 4.3
Goto Forum:
  


Current Time: Thu Sep 18 19:48:17 GMT 2014

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

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