SWT: Unable to resize buttons on Mac

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

On my Windows machine, the button will automatically be large enough to display the entire image in the button. I tried this on a Mac, but the button didn't get tall enough to fit the whole image. I tried to use the setsize () function on the button to manually set the size, but whenever I called layout () on the parent button, it returned the size of the button to its default.

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

+2


source to share


1 answer


I found a solution.



The parent of the button used the GridLayout manager. I set the gridData buttons' heightHint and widthHint variables to a given size and it worked.

+1


source







All Articles