Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » Resize a composite at runtime?
Resize a composite at runtime? [message #444230] Fri, 08 October 2004 23:52 Go to next message
Eclipse UserFriend
Originally posted by: manish.garg.gmail.com

Hi,

I am trying to add a composite to my frame dynamically at run time. When
a Button - "Advanced" is cicked. What is the best way to do this?
I am currently trying the following:
The container is a gridlayout. So I try to manipulate the GridData:

button_Advanced.addSelectionListener(new SelectionListener(){

public void widgetSelected(SelectionEvent e) {
GridData gridData_AdvancedOptions = new GridData();
gridData_AdvancedOptions.heightHint = orgHeightHintForAddionalFields;
gridData_AdvancedOptions.widthHint = orgWidthHintForAddionalFields;
gridData_AdvancedOptions.horizontalSpan = 2;
group_AdditionalFields.setLayoutData(gridData_AdvancedOption s);
}

I also tried to manipulate the original GridData object. But this has no
effect. Probably the Group "group_AdditionalFields" is not updated.

Thanks.
Re: Resize a composite at runtime? [message #444417 is a reply to message #444230] Tue, 12 October 2004 14:20 Go to previous message
Veronika Irvine is currently offline Veronika IrvineFriend
Messages: 1272
Registered: July 2009
Senior Member
After you modify the layout data (you can use the original layout data
object) you must force the layout to apply itself using
group_AdditionalFields.getParent().layout(true). If the effect of your
change applies beyond the scope of group_AdditionalFields and its peers, you
may need to call layout(true) higher up on the parent tree, possibly as high
as shell.

See:
http://www.eclipse.org/articles/Understanding%20Layouts/Unde rstanding%20Layouts.htm

"Piranha_dev" <manish.garg@gmail.com> wrote in message
news:ck7981$g46$1@eclipse.org...
> Hi,
>
> I am trying to add a composite to my frame dynamically at run time. When
> a Button - "Advanced" is cicked. What is the best way to do this?
> I am currently trying the following:
> The container is a gridlayout. So I try to manipulate the GridData:
>
> button_Advanced.addSelectionListener(new SelectionListener(){
>
> public void widgetSelected(SelectionEvent e) {
> GridData gridData_AdvancedOptions = new GridData();
> gridData_AdvancedOptions.heightHint = orgHeightHintForAddionalFields;
> gridData_AdvancedOptions.widthHint = orgWidthHintForAddionalFields;
> gridData_AdvancedOptions.horizontalSpan = 2;
> group_AdditionalFields.setLayoutData(gridData_AdvancedOption s);
> }
>
> I also tried to manipulate the original GridData object. But this has no
> effect. Probably the Group "group_AdditionalFields" is not updated.
>
> Thanks.
>
Previous Topic:update lable from timertask
Next Topic:Adding a Toolbar in an Eclipse Plugin...
Goto Forum:
  


Current Time: Sat Oct 31 08:22:48 GMT 2020

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

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

Back to the top