当前位置: 首页>>代码示例>>Python>>正文


Python Canvas.start方法代码示例

本文整理汇总了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):
#.........这里部分代码省略.........
开发者ID:aallai,项目名称:gini,代码行数:103,代码来源:MainWindow.py


注:本文中的Canvas.start方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。