def add_widget widget
      # this help to access widget by a name
      if widget.respond_to? :name and !widget.name.nil?
        @by_name[widget.name] = widget
      end

      @widgets << widget
      @focusable_modified = true

      return @widgets.length-1
    end
def add_widget widget
      # this help to access widget by a name
      if widget.respond_to? :name and !widget.name.nil?
        @by_name[widget.name] = widget
      end

      @widgets << widget
      @focusable_modified = true

      return @widgets.length-1
    end
Add given widget to widget list and returns an incremental id.
 Adding to widgets, results in it being painted, and focussed.
 removing a widget and adding can give the same ID's, however at this point we are not
 really using ID. But need to use an incremental int in future. (internal use)