Add a widget to the widows.

        The widget will auto render. You can use the function like that if you want to keep the widget accecible :
            self.my_widget = self.add(my_widget)
191685
def add(self, widget, condition=lambda: 42):
        

        assert callable(condition)
        assert isinstance(widget, BaseWidget)
        self._widgets.append((widget, condition))

        return widget
54836
public int addWidget (Widget widget, int colSpan, String... styles)
    {
        int row = getRowCount();
        setWidget(row, 0, widget, colSpan, styles);
        return row;
    }
87568
def create_widget(self):
        
        d = self.declaration
        self.widget = View(self.get_context(), None, d.style)
1270854
function Widget(options) {
  this.__data = {};
  try {
    var e;
    if (typeof options === 'undefined') options = {};
    if (typeof options.innerHTML !== 'undefined' && typeof options.childNodes !== 'undefined') {
      // On passe directement un élément.
      options = {element: options};
    }
    if (typeof options.tag === 'undefined') options.tag = "div";
    if (options.element) {
      this.element(options.element);
    } else if (typeof options.id !== 'undefined') {
      e = window.document.getElementById(options.id);
      if (!e) {
        throw Error("Can't find element with id: \"" + options.id + "\"!");
      }
      this.element(e);
    } else {
      this.element(window.document.createElement(options.tag));
      this.addClass("wdg", "custom");
    }
  }
  catch (ex) {
    console.error("[widget] ", ex);
    console.error("[Widget] ", JSON.stringify(options));
    throw Error(ex);
  }
}
160631
def child_added(self, child):
        
        view = child.widget
        if view is not None:
            self.window.setContentView(view)
1327149
def child_added(self, child):
        
        super(UiKitView, self).child_added(child)

        layout = self.layout
        for i, child_widget in enumerate(self.child_widgets()):
            if child_widget == child.widget:
                layout.insertArrangedSubview(child_widget, atIndex=i)
                layout.insertSubview(child_widget, atIndex=i)
545990
def add_slave(self, slave, container_name="widget"):
        
        cont = getattr(self, container_name, None)
        if cont is None:
            raise AttributeError(
                'Container name must be a member of the delegate')
        cont.add(slave.widget)
        self.slaves.append(slave)
        return slave
1158817
def child_added(self, child):
        
        super(AbstractWidgetItemGroup, self).child_added(child)
        self.get_member('_items').reset(self)
115127
public void addBottomWidget(Widget w) {

        m_content.removeStyleName(I_CmsLayoutBundle.INSTANCE.dialogCss().alertMainContent());
        m_bottomWidgets.getElement().getStyle().clearDisplay();
        m_bottomWidgets.add(w);

    }
41599
def create_widget(self):
        
        d = self.declaration
        self.widget = Icon(self.get_context(), None, d.style)
1117142
def create_widget(self):
        
        d = self.declaration
        self.widget = CoordinatorLayout(self.get_context(), None, d.style)
174692
function(item, ItemView, index){
    // get the itemViewOptions if any were specified
    var itemViewOptions = Marionette.getOption(this, "itemViewOptions");
    if (_.isFunction(itemViewOptions)){
      itemViewOptions = itemViewOptions.call(this, item, index);
    }

    // build the view 
    var view = this.buildItemView(item, ItemView, itemViewOptions);
    
    // set up the child view event forwarding
    this.addChildViewEventForwarding(view);

    // this view is about to be added
    this.triggerMethod("before:item:added", view);

    // Store the child view itself so we can properly
    // remove and/or close it later
    this.children.add(view);

    // Render it and show it
    this.renderItemView(view, index);

    // call the "show" method if the collection view
    // has already been shown
    if (this._isShown){
      Marionette.triggerMethod.call(view, "show");
    }

    // this view was added
    this.triggerMethod("after:item:added", view);
  }
11847
def create_widget(self):
        
        d = self.declaration
        self.widget = WebView(self.get_context(), None, d.style)
617751
def child_added(self, child):
        
        view = child.widget
        if view is not None:
            self.dialog.setContentView(view)
1367274
def add_child(self, widget):
        
        li_itm = _li(id=self.id + str(self._count))
        li_itm.add_child(widget)

        super(List, self).add_child(li_itm)
        self._items.append((widget, li_itm))
        self._count += 1
1281316
def add_frame_widget(self, ref, left=1, top=1, right=20, bottom=1, width=20, height=4, direction="h", speed=1):
        

        if ref not in self.widgets:
            widget = widgets.FrameWidget(
                screen=self, ref=ref, left=left, top=top, right=right, bottom=bottom, width=width, height=height,
                direction=direction, speed=speed,
            )
            self.widgets[ref] = widget
            return self.widgets[ref]
1024922
def add(self, widget, *args, **kwargs):
        
        ins_widget = widget(*args, **kwargs)
        self.__iadd__(ins_widget)
        return ins_widget