pw::AttributeDictionary

Type for storing a group of key-value pairs that can be attached to entities

Derives From

pw::Object

Summary
pw::AttributeDictionaryType for storing a group of key-value pairs that can be attached to entities
Static Actions
createThis action creates a new attribute dictionary object.
getAllThis action gets a list of all of the current attribute dictionaries.
getByNameThis action gets an attribute dictionary object with the given name.
Instance Attributes
NameThis attribute is the name of the attribute dictionary.
ClassThis attribute is the class of the attribute dictionary.
Instance Actions
getDictionaryThis action gets a dictionary of key-value pairs of attributes that are defined by this attribute dictionary.
setDictionaryThis action assigns the given key-value pairs as the attributes for this attribute dictionary.
updateDictionaryThis action updates the key-value pairs for this attribute dictionary.
renameDictionaryKeyThis action renames a key of this attribute dictionary.
getEntitiesThis action gets a list of entities that this dictionary has been attached to.
deleteThis action deletes this attribute dictionary.

Static Actions

create

pw::AttributeDictionary create

This action creates a new attribute dictionary object.

Parameters

This action has no parameters.

Returns

This action returns a new pw::AttributeDictionary object.

getAll

pw::AttributeDictionary getAll ?-class class_name?

This action gets a list of all of the current attribute dictionaries.

Parameters

-class class_nameThis optional flag limits this action to only return attribute dictionaries that have been assigned the given class name.  The default behavior is to return all attribute dictionaries.

Returns

This action returns a list of pw::AttributeDictionary objects.

getByName

pw::AttributeDictionary getByName name

This action gets an attribute dictionary object with the given name.

Parameters

nameThis parameter is the string name of the attribute dictionary to get.

Returns

This action returns a pw::AttributeDictionary object.

Instance Attributes

Name

$attr get/setName name

This attribute is the name of the attribute dictionary.

Type

This attribute is a string.

Default

The default for this attribute is a uniquely generated name.

Class

$attr get/setClass class

This attribute is the class of the attribute dictionary.

Type

This attribute is a string.

Default

The default for this attribute is the string User.

Instance Actions

getDictionary

$attr getDictionary ?-modified? ?attr_keys?

This action gets a dictionary of key-value pairs of attributes that are defined by this attribute dictionary.

Parameters

-modifiedThis optional flag is the notification to include the modifed state of each key-value pair in the result.  When included, the result will contain an additional list of boolean values that represent the modified state of each pair.
attr_keysThis optional parameter is a string key or a list of string keys to limit the attributes which should be returned by this action.  If not specified, all existing attributes will be returned by this action.

Returns

This action returns a list of strings that can be converted into a tcl dictionary (list of alternating keys and values).  If the -modified flag was used, a second list is returned with modified state for each key-value pair.

setDictionary

$attr setDictionary dict

This action assigns the given key-value pairs as the attributes for this attribute dictionary.

Parameters

dictThis parameter is a list of string values of alternating key-value pairs.  If the list is an empty list, all key-value pairs of the dictionary will be removed.

Returns

This action returns nothing.

updateDictionary

$attr updateDictionary ?-force? key ?value?

This action updates the key-value pairs for this attribute dictionary.

Parameters

-forceThis optional flag will cause the key-value pair to be added if it doesn’t already exist.  The default behavior is to only update the dictionary is the key exists.
keyThis parameter is a string key to update.
valueThis optional parameter is a string value of a key-value pair to set for the dictionary.  If this parameter is not given, the key will be removed from the dictionary if it exists.  If an empty string is given, it will be assigned to the key.

Returns

This action returns nothing.

renameDictionaryKey

$attr renameDictionaryKey key new_key

This action renames a key of this attribute dictionary.

Parameters

keyThis parameter is a string name of the key to rename.
new_keyThis parameter is a string new key name.

Returns

This action returns nothing.

getEntities

$attr getEntities

This action gets a list of entities that this dictionary has been attached to.

Parameters

This action has no parameters.

Returns

This action returns a list of pw::Entity objects.

delete

$attr delete

This action deletes this attribute dictionary.

Parameters

This action has no parameters.

Returns

This action returns nothing.

pw::AttributeDictionary create
This action creates a new attribute dictionary object.
pw::AttributeDictionary getAll ?-class class_name?
This action gets a list of all of the current attribute dictionaries.
pw::AttributeDictionary getByName name
This action gets an attribute dictionary object with the given name.
$attr get/setName name
This attribute is the name of the attribute dictionary.
$attr get/setClass class
This attribute is the class of the attribute dictionary.
$attr getDictionary ?-modified? ?attr_keys?
This action gets a dictionary of key-value pairs of attributes that are defined by this attribute dictionary.
$attr setDictionary dict
This action assigns the given key-value pairs as the attributes for this attribute dictionary.
$attr updateDictionary ?-force? key ?value?
This action updates the key-value pairs for this attribute dictionary.
$attr renameDictionaryKey key new_key
This action renames a key of this attribute dictionary.
$attr getEntities
This action gets a list of entities that this dictionary has been attached to.
$attr delete
This action deletes this attribute dictionary.
Base type for all glyph types
Type for storing a group of key-value pairs that can be attached to entities
A string is an array of characters.
A boolean is represented as a 0 or 1, with 0 being false and 1 being true.
Entity type
Close