| Prev | Next | Start of Chapter | End of Chapter | Contents | Glossary | Index | Comments | (3 out of 4)

Using Messages

You can create messages in two ways by:

Creating a Message

To create a generic message:

The message appears on the workspace. Open its table to enter text into the message area, as shown here.


Creating a New Message Class

You can create your own message classes to define a particular font size, font and background color, and so on. For example, you could create a message class called USER-WARNING-MESSAGE that uses an extra-large font and has a red background. You could then use instances of this class to alert users to problems while the KB is running.

As with object classes, you create message classes in a hierarchy so that each subclass inherits the attributes of its superior class. For information on creating your own message classes, see Creating Message Classes.

To create an instance of the message class:

where message-class is any message class.

Message classes have an initializable system attribute, the Default-message-properties attribute, which controls how instances of a message class appear. You can set the default appearance of a message by initializing this attribute appropriately, as described under Specifying Default Message Properties. You can also change message properties programmatically, as described under Using Actions With Messages.

The next figure illustrates a user-defined message class, KMM-MESSAGE, showing the text of the Default-message-properties attribute of the definition, an instance of that class, and a generic, system-defined message.


Messages do not have any class-specific attributes. They contain a text area that you can type a message into interactively, or use change the text of actions to edit programmatically.

| Prev | Next | Start of Chapter | End of Chapter | Contents | Glossary | Index | Comments | (3 out of 4)

Copyright © 1997 Gensym Corporation, Inc.