user3778712
user3778712

Reputation: 5

Add a listener on shell maximise button swt

I want to add a listener on my shells 'maximize' button such that an event is triggered when the user clicks on it. In this case, I want to re-size my table columns whenever the user chooses to maximize the shell. Is there any way to do this?

Upvotes: 0

Views: 662

Answers (1)

greg-449
greg-449

Reputation: 111142

You can add a SWT.Resize listener to be told about all shell size changes:

shell.addListener(SWT.Resize, new Listener()
  {
    @Override
    public void handleEvent(final Event event)
    {

    }
  });

Note: If you are using the JFace TableViewer then TableColumnLayout will do the column resize automatically.

Upvotes: 0

Related Questions