1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79
|
Documentation Examples
======================
This tutorial is simply a collection of the various examples taken from the
Traits documentation. They are presented as a tutorial so that interested users
can see the results of actually executing the example code, as well as to
promote further study and exploration of various Traits topics in an interactive
environment that allows easy modification and testing of changes to the code.
So please feel free to explore the examples as your time, fancy and interest
dictate. Have fun!
A brief description of each of the examples presented in this tutorial follows:
Add Class Traits
Defining mutually-referring classes using the *add_class_trait* method.
All Traits Features
Shows the five primary features of the Traits package.
Bad Self Ref
Shows the incorrect way of defining a self-referencing class.
Cast Simple
Shows use of some of the simple casting types.
Circular Definition
Shows the incorrect way of defining mutually-referring classes.
Compound
Shows the definition of a compound trait.
Custom TraitHandler
Example of a custom TraitHandler
Use Custom TraitHandler
Example of using a custom TraitHandler
Delegate
Example of trait delegation.
Delegate Prefix
Examples of the Delegate() 'prefix' parameter.
Delegation Notification
Example of notification with delegation.
Event
Shows the definition of a trait event
List Notifiers
Example of zero-parameter handlers for an object containing a list
Metadata
Example of accessing trait metadata attributes
Minimal
Minimal example of using Traits.
Override Default
Example of overriding a default value for a trait attribute in a subclass
Static Notification
Example of static attribute notification
This
Example of This predefined trait
Trait Reuse
Example of reusing trait definitions
Temp Wildcard
Example of using a wildcard with a trait attribute name.
All Wildcard
Shows the trait attribute wildcard rules.
Wildcard rules
Example of trait attribute wildcard rules
|