How to make GridLayout row fill availible space?
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 th开发者_如何学运维e space.
How can I do this?
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 );
精彩评论