juan2raid
juan2raid

Reputation: 1644

SWT: Unable to resize buttons on a Mac

I am developing a Java application using SWT that contains some buttons with images.

On my Windows machine, the button will automatically be large enough to show the entire image in the button. I tried this on a Mac however the button will not become tall enough to fit the entire image. I tried using the setsize() function on the button to manually set the size however whenever I called layout() on the button's parent it would set the button's size back to its default value.

Any ideas on how to make the button large enough to fit the image?

Upvotes: 2

Views: 1262

Answers (1)

juan2raid
juan2raid

Reputation: 1644

I found the solution.

The button's parent was using the GridLayout manager. I set the button's gridData variables heightHint and widthHint to the intended size and it worked.

Upvotes: 1

Related Questions