User's Guide

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 (LIBPATH for OS/2 and AIX, PATH for Windows). abtico50.dll contains icons and bitmaps for the sample parts in this book, and it is shipped with VisualAge.

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


[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]