The Abaqus GUI Toolkit supports the following formats for creating icons:
XPM
BMP
GIF
PNG
icon = afxCreatePNGIcon('myIcon.png') FXLabel(self, 'A label with an icon', icon)
In some cases you may need to call the icon's create method before using it in a widget. In the previous example, it is not necessary to call the icon's create method because the label widget creates the icon when the label is created. However, if you construct an icon after you call the widget's create method, you must call the icon's create method before you use the icon in the widget. For more information, see “The create method,” Section 3.8.
The format of an XPM icon is simple; and you can use any pixmap editor, or even a text editor, to create the icon data. For more details on the XPM format, visit the XPM web site. The following image editing programs support the XPM format:
ImageMagick (www.imagemagick.org)
The GIMP (www.gimp.org)
As an alternative to using the afxCreateXPMIcon method, you can define the XPM image data as a Python list of strings and create an icon using the FXXPMIcon method, as shown in the following example.
Note: For a list of valid color names and their corresponding RGB values, see Appendix B, “Colors and RGB values. To define a transparent color, you must define it as “c None s None”, not just “c None”.
blueIconData = [ "12 12 2 1", ". c None s None", " c blue", " ", " ", " ", " ", " .... ", " .... ", " .... ", " .... ", " ", " ", " ", " " ] blueIcon = FXXPMIcon(getAFXApp(),blueIconData)Figure A–1 shows the blue square icon created by this example.