Routines (alphabetical) > Object Classes > Graphics Object Classes > IDLgrLegend::Init

# IDLgrLegend::Init

Syntax | Return Value | Arguments | Keywords | Version History

The IDLgrLegend::Init function method initializes the legend object.

Note: Init methods are special lifecycle methods, and as such cannot be called outside the context of object creation. This means that in most cases, you cannot call the Init method directly. There is one exception to this rule: if you write your own subclass of this class, you can call the Init method from within the Init method of the subclass.

## Syntax

Obj = OBJ_NEW('IDLgrLegend' [, aItemNames] [, PROPERTY=value])

or

Result = Obj->[IDLgrLegend::]Init([aItemNames] [, PROPERTY=value]) (In a lifecycle method only.)

## Return Value

When this method is called indirectly, as part of the call to the OBJ_NEW function, the return value is an object reference to the newly-created object.

When called directly within a subclass Init method, the return value is 1 if initialization was successful, or zero otherwise.

## Arguments

### aItemNames

An array of strings to be used as the displayed item label. The length of this array is used to determine the number of items to be displayed. Each item is defined by taking one element from the ITEM_NAME, ITEM_TYPE, ITEM_LINESTYLE, ITEM_THICK, ITEM_COLOR, and ITEM_OBJECT vectors. If the number of items (as defined by the ITEM_NAME array) exceeds any of the attribute vectors, the attribute defaults will be used for any additional items.

Note: The value specified by the aItemNames argument is used to initialize the value of the ITEM_NAME property of the IDLgrLegend object.

## Keywords

Any property listed under IDLgrLegend Properties that contains the word “Yes” in the “Init” column of the properties table can be initialized during object creation using this method. To initialize the value of a property, specify the property name as a keyword set equal to the appropriate property value.

All other keywords are passed to the superclass of this object.

## Version History

5.1 | Introduced