Changing the icon
In addition to a name, each part also has a default icon to represent it on the parts palette, and also on the free-form surface (if it is a nonvisual part). The default icon is a jigsaw puzzle piece. You can provide a different icon by adding a special class method, abtInstanceGraphicsDescriptor, to the part's class. The following method returns an icon descriptor that identifies the dynamic link library (DLL) module and resource identifier for your icon. Here's an example you can use for the timer part:
abtInstanceGraphicsDescriptor
"Answers my icon descriptor"
^(AbtIconDescriptor new
moduleName:'abtico50';
id: 277)
 
Tip icon
Before you add the preceding method, make certain the DLL already contains the icon you want to use, and that the DLL is present in a directory on the search path (PATH for Windows, LD_LIBRARY_PATH for Linux.). abtico50.dll contains icons and bitmaps for the sample parts in this book, and it is shipped with VA Smalltalk.
Let's test your accessories. Open a test view, and select Models category
Your timer part should look like the following on the palette:
Timer part
Last modified date: 02/16/2021