Skip to main content



      Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » stop swt window resizing
stop swt window resizing [message #464237] Fri, 18 November 2005 15:58 Go to next message
Eclipse UserFriend
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 03:58 Go to previous messageGo to next message
Eclipse UserFriend
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 17: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 09:27 Go to previous messageGo to next message
Eclipse UserFriend
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 12:35 Go to previous message
Eclipse UserFriend
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: Wed Jul 23 06:47:30 EDT 2025

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

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

Back to the top