tags:

views:

97

answers:

1

I have a gridlayout. I have two rows. I want one row to take up 500 pixels. I want the other row to take up the rest of the space. How?

+1  A: 

That's not a property of the GridLayout, but of the contained widgets' layout data. Say your composite contains two widgets:

parent.setLayout( new GridLayout() );

Button upper = new Button( parent, SWT.PUSH );
GridData upperData = new GridData( SWT.FILL, SWT.TOP, true, false );
upperData.heightHint = 500;
upper.setLayoutData( upperData );

Button lower = new Button( parent, SWT.PUSH );
GridData lowerData = new GridData( SWT.FILL, SWT.FILL, true, true );
lower.setLayoutData( lowerData );
ralfstx