Generic Function | Package: cg | ToC | DocOverview | CGDoc | RelNotes | FAQ | Index | PermutedIndex
| Allegro CL version 9.0 Unrevised from 8.2 to 9.0. 8.2 version

## primary-name-slot

Arguments: class-or-class-name

Returns the name of one of the slots of the specified class, which will be used to print instances of the class in a meaningful way in `class-grid` widgets and `object-editor` dialogs. The value may be set at any time by calling (setf primary-name-slot).

class-or-class-name should be either a class object or the name of a class.

If a secondary-name-slot has also been established for this class, then the values from the two slots will be printed together with a comma and space in between, as in:

    "primary-slot-value, secondary-slot-value".

These slots are used whenever a class instance is displayed in a cell of a `class-grid`, or in a widget on an `object-editor`, or in a built-in pop-up menu of an `object-editor`. At those times, primary-name-slot is called on the class. If a slot name (rather than `nil`) is returned, then a string is derived from the value of this slot and the value of the secondary-name-slot, if any. Otherwise the class instance will be printed using its print-object method, as usual.

These slot values are also used internally to cache a sorted list of the edited-instances of an `object-editor` dialog. That allows browsing the instances in an intuitive order, and allows the object-editor-select facility to handle a large number of choices as a series of pop-up menus.

This facility may be useful for a couple of different reasons:

1. It may be desirable for the user interface to present a "pretty name" that is different than a print-object string that's more useful to developers.
2. The IDE's Class Interface Editor dialog (where these slots can be specified) can be used to create browsers of database classes without writing any code, not even a print-object method.

Copyright (c) 1998-2019, Franz Inc. Oakland, CA., USA. All rights reserved.
This page was not revised from the 8.2 page.
Created 2012.5.30.

|  | ToC | DocOverview | CGDoc | RelNotes | FAQ | Index | PermutedIndex
| Allegro CL version 9.0 Unrevised from 8.2 to 9.0. 8.2 version