How to hide SWT widget using GridLayout_124354635 - Gumtree/gumtree GitHub Wiki

Gumtree : How to hide SWT widget using GridLayout

Created by Tony Lam, last modified on Jul 07, 2009
Set data height or width to 0 (-1 is reserved as default size) and run layout()
b = new Button(this, SWT.CHECK);
b.setText("hide");
b.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
b.setSelection(false);
b.addListener(SWT.Selection, new Listener() {
    public void handleEvent(Event e) {
        if(b.getSelection()) {
            titleData.heightHint = 0;
        } else {
            titleData.heightHint = -1;
        }
        layout();
    }
});
Document generated by Confluence on Apr 01, 2015 00:11
⚠️ **GitHub.com Fallback** ⚠️