def add(element, element_id=nil, options={}, &block)
      # make sure we have a target - raises NoContextError if none exists
      self.target

      unless @context
        create_default_root_context
      end

      # We want to be sure that the element has a supeview or superlayer before
      # the style method is called.
      element = initialize_element(element, element_id)
      self.apply(:add_child, element, options)
      style_and_context(element, element_id, &block)

      element
    end
def add(element, element_id=nil, options={}, &block)
      # make sure we have a target - raises NoContextError if none exists
      self.target

      unless @context
        create_default_root_context
      end

      # We want to be sure that the element has a supeview or superlayer before
      # the style method is called.
      element = initialize_element(element, element_id)
      self.apply(:add_child, element, options)
      style_and_context(element, element_id, &block)

      element
    end
Instantiates a view via `create` and adds the view to the current target.
 If there is no context, a default root view can be created if that has
 been enabled (e.g. within the `layout` method).  The block is run in the
 context of the new view.