|
Re: Can any one explain about Sash and Sash forms? [message #435659 is a reply to message #435655] |
Mon, 22 August 2005 08:17 |
Stephen Rowles Messages: 14 Registered: July 2009 |
Junior Member |
|
|
Bharath wrote:
> Hi,
> Can any one explain about how sash and sash forms work? I have seen
> some code snippets, but couldn't understand anything?
>
> Bharath
Not sure about sash, but I use sash forms as follows:
Lets say you want a page with a top and bottom composite, and a nice
sash bar in between to allow you to change the relative sizes.
Create a new SashFrom form your parent shell, specify SWT.VERTICAL to
tell the form that you want the components arranged vertically:
SashForm sash = new SashForm(parent, SWT.VERTICAL)
now create your two new composites and with a parent of the sash form:
Composite top = new Composite(sash, SWT.NONE);
Composite bottom = new Composite(sash, SWT.NONE);
Then set the weights of your sash to determin how big they initially are
relative to each other, in this case we want the top form to take up 75
percent of the space and the botton the remaining 25:
sash.setWeights(new int[]{75, 25});
Then simply add your controls and layouts to either the top composite,
or the bottom composite as appropriate.
Hope this helps.
|
|
|
Powered by
FUDForum. Page generated in 0.03195 seconds