Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » stop swt window resizing
stop swt window resizing [message #464237] Fri, 18 November 2005 20:58 Go to next message
Andrew Holland is currently offline Andrew HollandFriend
Messages: 1
Registered: July 2009
Junior Member
does anyone know how to stop an swt window resizing?

i've use this code below which stops it but still alows the arrows on the
sides and cornersL -

Listener listener = new Listener () {


public void handleEvent (Event e) {
switch (e.type) {
case SWT.Resize:
optionsShell.setSize(400,400);
System.out.println ("Resize received");
break;
case SWT.Paint:
System.out.println ("Paint received");
break;
default:
System.out.println ("Unknown event received");
}
}
};
optionsShell.addListener (SWT.Resize, listener);
optionsShell.addListener (SWT.Paint, listener);


can anyone provide any better examples or prompt me in the right direction,

thanks
Re: stop swt window resizing [message #464300 is a reply to message #464237] Mon, 21 November 2005 08:58 Go to previous messageGo to next message
Stefan Langer is currently offline Stefan LangerFriend
Messages: 236
Registered: July 2009
Senior Member
Creat the shell as a Modal shell

SWT.PRIMARY_MODEL, SWT.APPLICATION_MODEL, etc...

Have a look at SWT

Regards
Stefan

Andrew Holland wrote:
> does anyone know how to stop an swt window resizing?
>
> i've use this code below which stops it but still alows the arrows on the
> sides and cornersL -
>
> Listener listener = new Listener () {
>
>
> public void handleEvent (Event e) {
> switch (e.type) {
> case SWT.Resize:
> optionsShell.setSize(400,400);
> System.out.println ("Resize received");
> break;
> case SWT.Paint:
> System.out.println ("Paint received");
> break;
> default:
> System.out.println ("Unknown event received");
> }
> }
> };
> optionsShell.addListener (SWT.Resize, listener);
> optionsShell.addListener (SWT.Paint, listener);
>
>
> can anyone provide any better examples or prompt me in the right direction,
>
> thanks
>
>
Re: stop swt window resizing [message #464566 is a reply to message #464237] Thu, 24 November 2005 22:27 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: mwilli.iastate.edu

Are you trying to stop resizing altogether or just make it stop after it
gets to a certain size? I don't know of an easy way to stop it after it gets
to a certain size, but you can set a minimum size, a preferred size, and set
resize to false. Take a look at the following snippet:
Shell window = new Shell();
window.setSize(400,400);
window.setResizeable(false);

That will keep the window at 400x400
"Andrew Holland" <a1dutch@dsl.pipex.com> wrote in message
news:dllf9k$hjp$1@news.eclipse.org...
> does anyone know how to stop an swt window resizing?
>
> i've use this code below which stops it but still alows the arrows on the
> sides and cornersL -
>
> Listener listener = new Listener () {
>
>
> public void handleEvent (Event e) {
> switch (e.type) {
> case SWT.Resize:
> optionsShell.setSize(400,400);
> System.out.println ("Resize received");
> break;
> case SWT.Paint:
> System.out.println ("Paint received");
> break;
> default:
> System.out.println ("Unknown event received");
> }
> }
> };
> optionsShell.addListener (SWT.Resize, listener);
> optionsShell.addListener (SWT.Paint, listener);
>
>
> can anyone provide any better examples or prompt me in the right
> direction,
>
> thanks
>
Re: stop swt window resizing [message #464587 is a reply to message #464237] Fri, 25 November 2005 14:27 Go to previous messageGo to next message
Veronika Irvine is currently offline Veronika IrvineFriend
Messages: 1272
Registered: July 2009
Senior Member
Create the shell without the SWT.RESIZE style:

Shell shell = new Shell (display, SWT.CLOSE);

"Andrew Holland" <a1dutch@dsl.pipex.com> wrote in message
news:dllf9k$hjp$1@news.eclipse.org...
> does anyone know how to stop an swt window resizing?
>
> i've use this code below which stops it but still alows the arrows on the
> sides and cornersL -
>
> Listener listener = new Listener () {
>
>
> public void handleEvent (Event e) {
> switch (e.type) {
> case SWT.Resize:
> optionsShell.setSize(400,400);
> System.out.println ("Resize received");
> break;
> case SWT.Paint:
> System.out.println ("Paint received");
> break;
> default:
> System.out.println ("Unknown event received");
> }
> }
> };
> optionsShell.addListener (SWT.Resize, listener);
> optionsShell.addListener (SWT.Paint, listener);
>
>
> can anyone provide any better examples or prompt me in the right
> direction,
>
> thanks
>
Re: stop swt window resizing [message #464640 is a reply to message #464587] Fri, 25 November 2005 17:35 Go to previous message
Daniel Spiewak is currently offline Daniel SpiewakFriend
Messages: 263
Registered: July 2009
Senior Member
Once in a while, generally after Gnome makes a new release, SWT.CLOSE stops giving the desired behavior on GTK Linux. (for example, between the 2.1 and 3.0 releases). I don't think the next release of Gnome will break this, but just fair warning. AFAIK, it works exactly as required on all other platforms consistantly.
Previous Topic:TableCursor and no more doubleClicks
Next Topic:SWT 2.1: Increasing Combo popup's Item count
Goto Forum:
  


Current Time: Thu Mar 28 17:16:41 GMT 2024

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

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

Back to the top