Delete/Remove A Widget
775448
def del_widget(self, ref):
        
        self.server.request("widget_del %s %s" % (self.name, ref))
        del(self.widgets[ref])
874194
def delete_event(self, widget, event, data=None):
        
        if not self.close_win:
            if self.thread.isAlive():
                dlg = self.gui_helper.create_message_dialog("Do you want to cancel project creation?",
                                                            buttons=Gtk.ButtonsType.YES_NO)
                response = dlg.run()
                if response == Gtk.ResponseType.YES:
                    if self.thread.isAlive():
                        self.info_label.set_label('<span color="#FFA500">Cancelling...</span>')
                        self.dev_assistant_runner.stop()
                        self.project_canceled = True
                    else:
                        self.info_label.set_label('<span color="#008000">Done</span>')
                    self.allow_close_window()
                dlg.destroy()
                return True
        else:
            return False
141849
def clear(self):
        
        for i in range(self.count() - 1, -1, -1):
            w = self.widget(i)
            if w:
                self.removeWidget(w)
                w.close()
                w.deleteLater()
1309249
def clear_widget(self):
        
        if not self.gui_up:
            return
        canvas = self.c_view.get_canvas()
        canvas.delete_all_objects()
        self.c_view.redraw(whence=0)
717303
def on_remove(self, widget, data=None):
        """"""

        path_list = None
        if self.view is not None:
            model, path_list = self.tree_view.get_selection().get_selected_rows()
        old_path = self.get_path()
        models = [self.list_store[path][self.MODEL_STORAGE_ID] for path in path_list] if path_list else []
        if models:
            try:
                self.remove_core_elements(models)
            except AttributeError as e:
                self._logger.warning("The respective core element of {1}.list_store couldn't be removed. -> {0}"
                                  "".format(e, self.__class__.__name__))
            if len(self.list_store) > 0:
                self.tree_view.set_cursor(min(old_path[0], len(self.list_store) - 1))
            return True
        else:
            self._logger.warning("Please select an element to be removed.")
440766
public void removeButton(Widget button) {

        m_buttonPanel.remove(button);
        if (m_buttonPanel.getWidgetCount() == 0) {
            m_buttonPanel.setStyleName(I_CmsLayoutBundle.INSTANCE.dialogCss().hideButtonPanel());
        }
    }
377069
def on_remove(self, widget, data=None):
        
        treeiter, path = self.get_selected_object()
        if not treeiter:
            return

        # check if an element is selected
        dict_path_as_list = self.tree_store[path][self.ID_STORAGE_ID]
        logger.debug("Deleting semantic data entry with name {}!".format(dict_path_as_list[-1]))
        self.model.state.remove_semantic_data(dict_path_as_list)
        self.reload_tree_store_data()

        # hold cursor position where the last element was removed
        try:
            self.select_entry(self.tree_store[path][self.ID_STORAGE_ID])
        except IndexError:
            if len(self.tree_store):
                if len(path) > 1:
                    possible_before_path = tuple(list(path[:-1]) + [path[-1] - 1])
                    if possible_before_path[-1] > -1:
                        self.select_entry(self.tree_store[possible_before_path][self.ID_STORAGE_ID])
                    else:
                        self.select_entry(self.tree_store[path[:-1]][self.ID_STORAGE_ID])
                else:
                    self.select_entry(self.tree_store[path[0] - 1][self.ID_STORAGE_ID])
        return True
553578
def drop_remove(*args, **kwargs):
        
        dropped_item = args[0]
        field_list = kwargs['field_list']
        num_duplicate = 0
        for i in range(field_list.count()):
            if dropped_item.text() == field_list.item(i).text():
                num_duplicate += 1
        if num_duplicate > 1:
            # Notes(IS): For some reason, removeItemWidget is not working.
            field_list.takeItem(field_list.row(dropped_item))
299654
def remake_display(self, *args):
        
        Builder.load_string(self.kv)
        if hasattr(self, '_kv_layout'):
            self.remove_widget(self._kv_layout)
            del self._kv_layout
        self._kv_layout = KvLayout()
        self.add_widget(self._kv_layout)
1358312
def close(self):
        
        widget = self.centralWidget()
        if widget and not widget.close():
            return
            
        super(XPopupWidget, self).close()
577412
protected void removeDecorationWidget(Widget widget, int width) {

        if ((widget != null) && m_decorationWidgets.remove(widget)) {
            m_decorationWidth -= width;
            initContent();
        }
    }
233048
@Override
    public boolean remove(Widget w) {
        // Validate.
        if (w.getParent() != this) {
            return false;
        }
        // Orphan.
        try {
            orphan(w);
        } finally {
            // Physical detach.
            Element elem = w.getElement();
            // NOTE (issue #486): DO NOT call DOM.getParent() to correctly handle
            // text node removing. Calling DOM.getParent(TEXT_NODE) will throw a
            // NPE exception.
            //DOM.getParent(elem).removeChild(elem);
            elem.removeFromParent();

            // Logical detach.
            getChildren().remove(w);
        }
        return true;
    }
1220073
public void clear() {
        List<Widget> children = getChildren();
        Log.d(TAG, "clear(%s): removing %d children", getName(), children.size());
        for (Widget child : children) {
            removeChild(child, true);
        }
        requestLayout();
    }
928522
def remove_object(self, object=0, delete=True):
        
        if type(object) in [int, int]: n = object
        else:                           n = self.objects.index(object)

        # pop it from the list
        object = self.objects.pop(n)

        # remove it from the GUI and delete it
        if hasattr_safe(object, '_widget'):
            self._layout.removeWidget(object._widget)
            object._widget.hide()
            if delete: object._widget.deleteLater()
        else:
            self._layout.removeWidget(object)
            object.hide()
            if delete: object.deleteLater()
879626
def qteAutoremoveDeletedWidgets(self):
        
        widget_list = self._qteAdmin.widgetList
        deleted_widgets = [_ for _ in widget_list if sip.isdeleted(_)]
        for widgetObj in deleted_widgets:
            self._qteAdmin.widgetList.remove(widgetObj)
818488
def del_item(self):
        """"""
        item = self.current
        rectangle = self.items[item]
        self.canvas.delete(item, rectangle)
        if callable(self._callback_del):
            self._callback_del(item, rectangle)
768063
public void removeElement(CmsContainerPageElementPanel elementWidget) {

        if (elementWidget.getInheritanceInfo().isNew()) {
            getHandler().removeElement(elementWidget, ElementRemoveMode.saveAndCheckReferences);
        } else {
            elementWidget.getInheritanceInfo().setVisible(false);
            elementWidget.addStyleName(HIDDEN_ELEMENT_CLASS);
            Element elementOverlay = DOM.createDiv();
            elementOverlay.setClassName(HIDDEN_ELEMENT_OVERLAY_CLASS);
            elementWidget.getElement().appendChild(elementOverlay);
            getGroupContainerWidget().add(elementWidget);
            updateButtonVisibility(elementWidget);
            m_showElementsButton.enable();
            getGroupContainerWidget().refreshHighlighting();
        }
        m_changedInheritanceInfo = true;
    }