Purpose
Display a pushbutton with an image


Solution

This is possible with GuiXT as of version 2022 Q1 1, using transparent images.

Examples
In the SAP standard, a pushbutton can display a text plus an icon. In some cases, for example menus, a meaningful image is more user friendly, especially if you display a large button.

Here are some examples, the GuiXT button with an image on the left and the standard version with an icon on the right.


Quartz theme


Quartz theme, focus on left button

 


Signature theme


Signature theme, focus on left button



Signature theme, different color and font 




Quartz theme, two buttons in the same style

The images should match in style, size and font-size. They should be kept simple and iconic, and monochrome rather than distractingly multicolored.

 

Implementation
The simplest solution is to create the images including the text with a graphics program such as "paint.net". The width:height ratio should be the same for all button images, and should fit nicely within the dimensions of the button to be displayed

There are many free as well as licensed collections of usable images on the Internet.

The pixel in the upper left corner of the image determines the color that will be displayed transparently. For ".png" images with transparency, please change the image by filling in the transparent part with the appropriate color.

GuiXT script (example):

Pushbutton (9,80) " " /7 size=(2,24)
Image  (8.9,80.5) (10.3,103.3)  "images\delivery.png"  -plain  -transparent

 

 
Image file "delivery.png"

Components GuiXT