def initialize_element(elem, element_id)
      if elem.is_a?(Class) && elem < TreeLayout
        layout = elem.new
        elem = layout.view
      elsif elem.is_a?(Class)
        elem = elem.new
      elsif elem.is_a?(TreeLayout)
        layout = elem
        elem = elem.view
      end

      if layout
        if element_id
          name_element(layout, element_id)
        end
        @child_layouts << layout
      elsif element_id
        name_element(elem, element_id)
      end

      return elem
    end
def initialize_element(elem, element_id)
      if elem.is_a?(Class) && elem < TreeLayout
        layout = elem.new
        elem = layout.view
      elsif elem.is_a?(Class)
        elem = elem.new
      elsif elem.is_a?(TreeLayout)
        layout = elem
        elem = elem.view
      end

      if layout
        if element_id
          name_element(layout, element_id)
        end
        @child_layouts << layout
      elsif element_id
        name_element(elem, element_id)
      end

      return elem
    end
Initializes an instance of a view. This will need to be smarter going
 forward as `new` isn't always the designated initializer.

 Accepts a view instance, a class (which is instantiated with 'new') or a
 `ViewLayout`, which returns the root view.