class ShowPanelCommandClass(): def __init__(self): self.widgetAdded = False def GetResources(self): return {'MenuText': "Show Panel"} def Activated(self): from PySide import QtCore import BoxerGui if not self.widgetAdded: window = FreeCADGui.getMainWindow() window.addDockWidget(QtCore.Qt.RightDockWidgetArea, BoxerGui.gui.dockWidget) self.widgetAdded = True BoxerGui.gui.dockWidget.setVisible(True) return def IsActive(self): return True class BoxerWorkbench(Workbench): MenuText = "Boxer" ToolTip = "Box Maker" def Initialize(self): self.list = ["BoxerShowPanel"] self.appendToolbar("Boxer", self.list) import BoxerGui # Loads the Boxer modules def Activated(self): Gui.runCommand('BoxerShowPanel') return def Deactivated(self): return def ContextMenu(self, recipient): self.appendContextMenu("Boxer", self.list) def GetClassName(self): return "Gui::PythonWorkbench" Gui.addCommand('BoxerShowPanel', ShowPanelCommandClass()) Gui.addWorkbench(BoxerWorkbench())