This page describes an upcoming enhancement to TclOO: Property tracking. Please stay tuned.
The concept: Adding information that is tracked by class that allows the developer to embed data inside of classes
New tools:
This method allows access to this class. Arguments that follow are the same as allowed by the "dict" command.
Return a value for a property, or die trying.
Return a value for a property, or an empty list if the value does not exist.
Return true if a property exists
Return a list of keys below the level field ?field...?
Add/modify a property
This method provides objects access to the property database of their class. (Without the hassle of having to look up their class.) At present, it is read only.
Return a value for a property, or die trying.
Return a value for a property, or an empty list if the value does not exist.
Return true if a property exists
Return a list of keys below the level field ?field...?
New Keywords:
The following keywords will be added to oo::define:
Set a property from the class definition.
Usage:
This system was originally intended to provide a Tk option-like database for TclOO objects.
# Dump the entire option dictionary set option_dict [info object [self] property get option] # Access a list of options set option_list [info object [self] property list option] # Check if an option exists set exists [info object [self] property exists option color] # Get the default value for color set color [info object [self] property getnull option color default]