Win a copy of Learn Spring Security (video course) this week in the Spring forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

SWT: Is dynamic resize of Combo possible?

 
Bhavani Kumar
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,
My scenario is : I have 2 combos in a Composite. Depending on the value selected in the first Combo, the second Combo is populated. Now the values in the second combo are of variable length, so i need to resize the combo depending on the length of the text. Is it possible, since we place the combos on the composite in the beginning itself ?

Code:

msgFmtCmb = new Combo(paramComp, SWT.READ_ONLY);
gridData = new GridData();
gridData.horizontalSpan = 2;
msgFmtCmb.setLayoutData(gridData);
msgFmtCmb.addModifyListener(this);

msgTypeCmb = new Combo(paramComp, SWT.READ_ONLY);
final GridData grdDataMsgType = new GridData();
grdDataMsgType.horizontalSpan = 2;
msgTypeCmb.setLayoutData(grdDataMsgType);
msgTypeCmb.addModifyListener(this);

In the modifyText method, i am removing all values from the second combo and adding new values.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic