Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » Trouble with Sash setWeights
Trouble with Sash setWeights [message #452388] Sat, 19 March 2005 01:13 Go to next message
MP Mising name is currently offline MP Mising nameFriend
Messages: 18
Registered: July 2009
Junior Member
Not sure what is going wrong, but when I attempt to set the weight of a
sash, the whole sash disappears.

final SashForm MainSash - new SashForm(shell, SWT.HORIZONTAL);
int weights[] = {20,80};
MainSash.setWeights(weights);

Anyone have experience with this that may be able to pick out the problem?
Re: Trouble with Sash setWeights [message #452389 is a reply to message #452388] Sat, 19 March 2005 02:04 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: doug-list.threepenny.net

The SashForm requires the child controls (the windows being moved) to
have already been created before the weights can be set. Otherwise it
throws an exception (it checks that the number of weights == the number
of controls being managed).

Could that be your problem? (I think your sample code would throw).

MP wrote:

> Not sure what is going wrong, but when I attempt to set the weight of a
> sash, the whole sash disappears.
>
> final SashForm MainSash - new SashForm(shell, SWT.HORIZONTAL);
> int weights[] = {20,80};
> MainSash.setWeights(weights);
>
> Anyone have experience with this that may be able to pick out the problem?
Re: Trouble with Sash setWeights [message #452396 is a reply to message #452389] Sat, 19 March 2005 12:41 Go to previous message
MP Mising name is currently offline MP Mising nameFriend
Messages: 18
Registered: July 2009
Junior Member
Doug Pearson wrote:
> The SashForm requires the child controls (the windows being moved) to
> have already been created before the weights can be set. Otherwise it
> throws an exception (it checks that the number of weights == the number
> of controls being managed).
>
> Could that be your problem? (I think your sample code would throw).
>
> MP wrote:
>
>> Not sure what is going wrong, but when I attempt to set the weight of
>> a sash, the whole sash disappears.
>>
>> final SashForm MainSash - new SashForm(shell, SWT.HORIZONTAL);
>> int weights[] = {20,80};
>> MainSash.setWeights(weights);
>>
>> Anyone have experience with this that may be able to pick out the
>> problem?
>
>
That was the problem. Thanks Doug.
Previous Topic:TextPropertyDescriptor with multiple lines?
Next Topic:Dialog with two lists
Goto Forum:
  


Current Time: Fri Oct 18 00:03:37 GMT 2019

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

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

Back to the top