AddPixmap Method
- Last UpdatedNov 12, 2025
- 1 minute read
The AddPixmap method is the best way of setting or changing a gadget's associated pixmaps.
AddPixmap( !pixmap is STRING )
!pixmap is a string holding the file pathname of the required .png file.
AddPixmap( !pixmap1 is STRING, !pixmap2 is STRING )
!pixmap1 corresponds to the Un-selected state of the gadget, and pixmap2 corresponds to the Selected state. Specifying !pixmap1 as the null string ' ', will leave the current Selected pixmap unchanged.
PARAGRAPH gadgets only have one pixmap which is represented by the .VAL member, and so can be directly set or changed using !this.myPara.val = '<pixmap-pathname>.
Notes: The PML function !!PML.GetPathname ('<myPixmap>.png') returns the required pixmap
pathname for pixmaps held in the standard PDMS Appware pixmap directories.
It is recommended that when you define the gadget you set its size to encompass the
largest pixmap which you will later add. Failure to do this may give rise to unexpected
behavior.
Historically you could add a third pixmap which was used when the gadget was de-activated.
This practice is no longer necessary as the gadget pixmapped is automatically greyed-out
on de-activation.