class documentation
class TraitslikeContextWrapper(HasTraits): (source)
Wrap a context with traits, primarily for use with Traits UI.
Method | add |
Add a set of traits to this object. |
Method | _anytrait |
Undocumented |
Method | _context |
Undocumented |
Method | _context |
Receive change notifications from the context. |
Method | _in |
Generic trait change handler to propogate mirrored trait changes into the context. |
Method | _in |
Return a list of names of all of the traits which mirror context variables. |
Method | _synch |
Undocumented |
Class Variable | _context |
Undocumented |
Instance Variable | _synched |
Undocumented |
Add a set of traits to this object. Each trait corresponds to a name in the context. Each CTrait which is added will have .in_context metadata attribute as True. Parameters ---------- ``*args`` : strs These attributes will be created as Any traits. ``**kwds`` : str -> Trait These attributes will be created as the specified Traits. Example ------- >>> from traits.api import Int >>> from codetools.contexts.traitslike_context_wrapper import TraitsLikeContextWrapper >>> tcw = TraitsLikeContextWrapper(_context={}) >>> tcw.add_traits('a', 'b', c=Int)