當前位置: 首頁>>代碼示例>>Python>>正文


Python GUI.draw方法代碼示例

本文整理匯總了Python中GUI.draw方法的典型用法代碼示例。如果您正苦於以下問題:Python GUI.draw方法的具體用法?Python GUI.draw怎麽用?Python GUI.draw使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在GUI的用法示例。


在下文中一共展示了GUI.draw方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: render

# 需要導入模塊: import GUI [as 別名]
# 或者: from GUI import draw [as 別名]
	def render( self, dTime ):
		"""This function forces World Editor to render everything on the scene. 
		Usually called everyframe, however it still recieves a dTime value which 
		informs the renderer how much time has passed since the last render	call."""
		WorldEditor.camera().render( dTime )
		WorldEditor.render( dTime )
		GUI.draw()
		return 1
開發者ID:siredblood,項目名稱:tree-bumpkin-project,代碼行數:10,代碼來源:WorldEditorDirector.py

示例2: render

# 需要導入模塊: import GUI [as 別名]
# 或者: from GUI import draw [as 別名]
	def render( self, dTime ):
		BigBang.camera().render( dTime )
		BigBang.render( dTime )
		GUI.draw()
		return 1
開發者ID:siredblood,項目名稱:tree-bumpkin-project,代碼行數:7,代碼來源:ChunkManager.py

示例3: Widget

# 需要導入模塊: import GUI [as 別名]
# 或者: from GUI import draw [as 別名]

#.........這裏部分代碼省略.........
        self.sld_timeout.setSingleStep(500)
        self.sld_timeout.setPageStep(500)

        self.sld_pkt.setRange(1, 120)
        self.sld_pkt.setValue(60)
        self.sld_pkt.setPageStep(1)
        
        #Slider 
        self.title_wndSize = QtGui.QLabel('Marime fereastra')
        self.title_e2eDelay = QtGui.QLabel('Intarziere End to end')
        self.title_timeout = QtGui.QLabel('Valoare timeout')
        self.title_pkt = QtGui.QLabel('Numar de pachete pe minut')
        self.title_ptl = QtGui.QLabel('Protocol studiat')
        self.title_emt = QtGui.QLabel('Pachete trimise automat')
        
        #Initializare grid 
        grid = QtGui.QGridLayout()
        
        grid.setSpacing(10)

        grid.addWidget(self.title_ptl, 0, 0)
        grid.addWidget(self.rbut_SR, 0, 1)
        grid.addWidget(self.btn, 0, 2)
        QtCore.QObject.connect(self.btn, QtCore.SIGNAL("clicked()"), self.Start)
        QtCore.QObject.connect(self.rbut_SR, QtCore.SIGNAL("clicked()"), self.ModeSR)
        
        grid.addWidget(self.title_wndSize, 2, 0)
        grid.addWidget(self.sld_wndSize, 2, 1)
        grid.addWidget(self.lcd_wndSize, 2, 2)
        self.sld_wndSize.valueChanged.connect(self.lcd_wndSize.display)
        self.sld_wndSize.valueChanged.connect(self.gui.setWndSize)
        
        grid.addWidget(self.title_e2eDelay, 3, 0)
        grid.addWidget(self.sld_e2eDelay, 3, 1)
        grid.addWidget(self.lcd_e2eDelay, 3, 2)
        self.sld_e2eDelay.valueChanged.connect(self.lcd_e2eDelay.display)
        self.sld_e2eDelay.valueChanged.connect(self.gui.sete2eDelay)
        
        grid.addWidget(self.title_timeout, 4, 0)
        grid.addWidget(self.sld_timeout, 4, 1)
        grid.addWidget(self.lcd_timeout, 4, 2)
        self.sld_timeout.valueChanged.connect(self.lcd_timeout.display)
        self.sld_timeout.valueChanged.connect(self.gui.settimeout)
        
        grid.addWidget(self.title_pkt, 5, 0)
        grid.addWidget(self.sld_pkt, 5, 1)
        grid.addWidget(self.lcd_pkt, 5, 2)
        self.sld_pkt.valueChanged.connect(self.lcd_pkt.display)
        self.sld_pkt.valueChanged.connect(self.gui.setpkt)
        
        grid.addWidget(self.title_emt, 7, 0)
        
        grid.addWidget(self.gui, 8, 0, 5, 3)
        
        self.setLayout(grid)
        
        self.showMaximized()
        self.setWindowTitle('Protocolul Selective Repeat ARQ')
        self.show()
        pass
        
    def paintEvent(self, e):
        
        qp = QtGui.QPainter()
        qp.begin(self)
        self.draw(qp)
        qp.end()
        pass
    def draw(self, qp):
        self.gui.draw(qp)
        pass
    
    def SendData(self):
        
        pass
    def Start(self):
        if self.isStart == False:
            self.gui.StartAction()
            self.isStart = True
            self.btn.setText('Stop')
            pass
        elif self.isStart == True:
            self.gui.StopAction()
            self.isStart = False
            self.btn.setText('Start')
            pass
        pass
    def ModeGBN(self):
        self.gui.setMode(0)
        pass
    def ModeSR(self):
        self.gui.setMode(1)
        pass
    def ModeScroll(self):
        self.gui.setScrollMode(self.combx.currentIndex())
    def keyPressEvent(self, e):
        
        if e.key() == QtCore.Qt.Key_Escape:
            self.close()
        pass
開發者ID:alexandrudsc,項目名稱:Selective-Repeat-ARQ---python,代碼行數:104,代碼來源:Main.py

示例4: Widget

# 需要導入模塊: import GUI [as 別名]
# 或者: from GUI import draw [as 別名]

#.........這裏部分代碼省略.........
        #Slider 
        self.title_wndSize = QtGui.QLabel('window Size')
        self.title_e2eDelay = QtGui.QLabel('end to end delay')
        self.title_timeout = QtGui.QLabel('time out')
        self.title_pkt = QtGui.QLabel('number of packets emited per minute')
        self.title_ptl = QtGui.QLabel('protocol')
        self.title_scrollmode = QtGui.QLabel('scroll mode')
        self.title_emt = QtGui.QLabel('automatic emission of packets')
        
        #grid Init
        grid = QtGui.QGridLayout()
        
        grid.setSpacing(10)

        grid.addWidget(self.title_ptl, 0, 0)
        grid.addWidget(self.rbut_GBN, 0, 1)
        grid.addWidget(self.rbut_SR, 1, 1)
        grid.addWidget(self.btn, 0, 2)
        QtCore.QObject.connect(self.btn, QtCore.SIGNAL("clicked()"), self.Start)
        QtCore.QObject.connect(self.rbut_GBN, QtCore.SIGNAL("clicked()"), self.ModeGBN)
        QtCore.QObject.connect(self.rbut_SR, QtCore.SIGNAL("clicked()"), self.ModeSR)
        
        grid.addWidget(self.title_wndSize, 2, 0)
        grid.addWidget(self.sld_wndSize, 2, 1)
        grid.addWidget(self.lcd_wndSize, 2, 2)
        self.sld_wndSize.valueChanged.connect(self.lcd_wndSize.display)
        self.sld_wndSize.valueChanged.connect(self.gui.setWndSize)
        
        grid.addWidget(self.title_e2eDelay, 3, 0)
        grid.addWidget(self.sld_e2eDelay, 3, 1)
        grid.addWidget(self.lcd_e2eDelay, 3, 2)
        self.sld_e2eDelay.valueChanged.connect(self.lcd_e2eDelay.display)
        self.sld_e2eDelay.valueChanged.connect(self.gui.sete2eDelay)
        
        grid.addWidget(self.title_timeout, 4, 0)
        grid.addWidget(self.sld_timeout, 4, 1)
        grid.addWidget(self.lcd_timeout, 4, 2)
        self.sld_timeout.valueChanged.connect(self.lcd_timeout.display)
        self.sld_timeout.valueChanged.connect(self.gui.settimeout)
        
        grid.addWidget(self.title_pkt, 5, 0)
        grid.addWidget(self.sld_pkt, 5, 1)
        grid.addWidget(self.lcd_pkt, 5, 2)
        self.sld_pkt.valueChanged.connect(self.lcd_pkt.display)
        self.sld_pkt.valueChanged.connect(self.gui.setpkt)
        
        grid.addWidget(self.title_scrollmode, 6, 0)
        grid.addWidget(self.combx, 6, 1)
        QtCore.QObject.connect(self.combx, QtCore.SIGNAL("activated(int)"), self.ModeScroll)
        
        grid.addWidget(self.title_emt, 7, 0)
        
        grid.addWidget(self.gui, 8, 0, 5, 3)
        
        self.setLayout(grid)
        
        self.showMaximized()
        self.setWindowTitle('Selective Repeat / Go Back N')
        self.show()
        pass
        
    def paintEvent(self, e):
        
        qp = QtGui.QPainter()
        qp.begin(self)
        self.draw(qp)
        qp.end()
        pass
    def draw(self, qp):
        self.gui.draw(qp)
        pass
    
    def SendData(self):
        
        pass
    def Start(self):
        if self.isStart == False:
            self.gui.StartAction()
            self.isStart = True
            self.btn.setText('Stop')
            pass
        elif self.isStart == True:
            self.gui.StopAction()
            self.isStart = False
            self.btn.setText('Start')
            pass
        pass
    def ModeGBN(self):
        self.gui.setMode(0)
        pass
    def ModeSR(self):
        self.gui.setMode(1)
        pass
    def ModeScroll(self):
        self.gui.setScrollMode(self.combx.currentIndex())
    def keyPressEvent(self, e):
        
        if e.key() == QtCore.Qt.Key_Escape:
            self.close()
        pass
開發者ID:alexandrudsc,項目名稱:Selective-Repeat-ARQ---python,代碼行數:104,代碼來源:Main1.py


注:本文中的GUI.draw方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。