Reputation: 2740
I would like to have some margin between text and icon (image) on my Button.
That's what I have:
Button btn = new Button(grpInventar, SWT.NONE);
GridData gd_btn = new GridData(SWT.FILL, SWT.CENTER, true, false, 2, 1);
gd_btn.widthHint = 154;
btn.setLayoutData(gd_btn);
btn.setAlignment(SWT.LEFT);
btn.setImage(this.getImageByLocation(Application.getIconLocByInventoryClass(Whateverimage.class )));
btn.setText("Text");
I would love to add something like:
btn.setMarginBetweenTextIcon(12)
Is there something out there?
Upvotes: 0
Views: 222
Reputation: 111217
There is no support for this in SWT. You could use an image with empty pixels on the right or text with leading spaces.
Also note that not all platforms support having an image and text in a button.
Upvotes: 1