示例#1
0
 def __init__ ( self, *values, **traits ):
     """ Initializes the object.
     """
     ViewElement.__init__( self, **traits )
     content = []
     accum   = []
     for value in values:
         if isinstance( value, Group ):
             self._flush( content, accum )
             content.append( value )
         elif type( value ) in SequenceTypes:
             self._flush( content, accum )
             content.append( Group( *value ) )
         else:
             accum.append( value )
     self._flush( content, accum )
     
     # If 'content' trait was specified, add it to the end of the content:
     if self.content is not None:
         content.append( self.content )
     
     # Make sure this View is the container for all its children:
     for item in content:
         item.container = self
         
     # Wrap all of the content up into a Group and save it as our content:
     self.content = Group( container = self, *content )
示例#2
0
 def __init__(self, *values, **facets):
     """ Initializes the object.
     """
     ViewElement.__init__(self, **facets)
     self.set_content(*values)
示例#3
0
 def __init__(self, *values, **traits):
     """ Initializes the object.
     """
     ViewElement.__init__(self, **traits)
     self.set_content(*values)