本文整理汇总了Python中Canvas.start方法的典型用法代码示例。如果您正苦于以下问题:Python Canvas.start方法的具体用法?Python Canvas.start怎么用?Python Canvas.start使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Canvas
的用法示例。
在下文中一共展示了Canvas.start方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: MainWindow
# 需要导入模块: import Canvas [as 别名]
# 或者: from Canvas import start [as 别名]
class MainWindow(Systray):
def __init__(self, app):
"""
Create a main window for the given application.
"""
defaultOptions["palette"] = app.palette()
Systray.__init__(self)
self.expansions = 0
self.client = None
self.server = None
self.running = False
self.recovery = False
mainWidgets["main"] = self
mainWidgets["app"] = app
self.canvas = Canvas(self)
mainWidgets["canvas"] = self.canvas
self.tabWidget = TabWidget(self)
mainWidgets["tab"] = self.tabWidget
self.setCentralWidget(self.tabWidget)
#self.setCentralWidget(self.canvas)
self.createActions()
self.createMenus()
self.createToolBars()
self.createStatusBar()
self.createDockWindows()
self.createConfigWindows()
self.createPopupWindows()
self.createProgressBar()
self.newScene()
self.debugWindow.hide()
self.tm.hide()
self.routes.hide()
self.setVisible(True)
self.center()
self.saveLayout(environ["config"] + "defaultLayout")
self.defaultLayout = True
if options["restore"]:
self.loadLayout()
self.defaultLayout = False
self.loadProject()
def center(self):
"""
Center the window.
"""
screen = QtGui.QDesktopWidget().screenGeometry()
rect = self.geometry()
self.move((screen.width()-rect.width())/2, (screen.height()-rect.height())/2)
self.show()
def getProject(self):
"""
Return the project.
"""
return self.project
def startTutorial(self):
"""
Start the interactive tutorial.
"""
if isinstance(mainWidgets["canvas"], Tutorial):
self.log.append("You are already doing the tutorial! If you would like to stop or restart, select 'Close' from the File menu now.")
return
if not self.closeTopology():
return
self.project = "Tutorial"
self.filename = ""
self.canvas = Tutorial(self)
mainWidgets["canvas"] = self.canvas
self.tabWidget.removeTab(0)
self.tabWidget.addTab(self.canvas, "Tutorial")
self.canvas.start()
for nodeType in nodeTypes.keys():
itemTypes = nodeTypes[nodeType]
itemTypes[nodeType] = 0
self.properties.clear()
self.interfaces.clear()
self.routes.clear()
self.resetLayout(True)
self.lockDocks()
def lockDocks(self):
#.........这里部分代码省略.........