public void HandleAccountRemoved(Account account) { QApplication.Invoke(delegate { QWidget widget = m_AccountXmlWidgets[account]; m_AccountXmlWidgets.Remove(account); widget.Dispose(); }); }
void ShowDemo(string name) { if (demoWidgetContainer.Layout.Count <= 1) { demoWidgetContainer.Layout.RemoveWidget(demoWidget); var demoTypeInfo = demoDictionary[name]; demoWidget.Dispose(); demoWidget = (BaseDemoWidget)Activator.CreateInstance(demoTypeInfo); demoWidgetContainer.Layout.AddWidget(demoWidget); demoWidgetContainer.Repaint(); } else { var info = new QMessageBox(icon: QMessageBox.Icon.Critical, title: "Error", text: "Invalid number of demo widgets"); info.Show(); } }
public void HideLightbox() { if (m_LightboxChild == null) { throw new InvalidOperationException("Lightbox is already hidden"); } var layout = (QBoxLayout)m_LightboxWidget.Layout(); layout.RemoveWidget(m_LightboxChild); m_LightboxChild.SetParent(null); m_LightboxChild.Dispose(); m_LightboxChild = null; base.Widget(1).Enabled = true; m_LightboxWidget.Hide(); base.CurrentIndex = 1; }