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


Python wx.Yield方法代碼示例

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


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

示例1: gui_repaint

# 需要導入模塊: import wx [as 別名]
# 或者: from wx import Yield [as 別名]
def gui_repaint(self, drawDC=None):
        """
        Performs update of the displayed image on the GUI canvas, using the
        supplied device context.  If drawDC is None, a ClientDC will be used to
        redraw the image.
        """
        DEBUG_MSG("gui_repaint()", 1, self)
        if self.IsShownOnScreen():
            if drawDC is None:
                drawDC=wx.ClientDC(self)

            drawDC.BeginDrawing()
            drawDC.DrawBitmap(self.bitmap, 0, 0)
            drawDC.EndDrawing()
            #wx.GetApp().Yield()
        else:
            pass 
開發者ID:ktraunmueller,項目名稱:Computable,代碼行數:19,代碼來源:backend_wx.py

示例2: onApply

# 需要導入模塊: import wx [as 別名]
# 或者: from wx import Yield [as 別名]
def onApply(self, event):
        """Applies the currently open profile. Saves it first."""
        busy = wx.BusyCursor()
        saved_file = self.onSave(None)
        sp_logging.G_LOGGER.info("onApply profile: saved %s", saved_file)
        if saved_file:
            saved_profile = ProfileData(saved_file)
            self.parent_tray_obj.reload_profiles(event)
            wx.Yield()
            thrd = self.parent_tray_obj.start_profile(event, saved_profile, force_reload=True)
            if thrd:
                while thrd.is_alive():
                    time.sleep(0.5)
        else:
            pass
        del busy 
開發者ID:hhannine,項目名稱:superpaper,代碼行數:18,代碼來源:gui.py

示例3: call_sct_command

# 需要導入模塊: import wx [as 別名]
# 或者: from wx import Yield [as 別名]
def call_sct_command(self, command):
        print("Running: {}".format(command))
        binfo = ProgressDialog(frame)
        binfo.Show()

        thr = SCTCallThread(command)
        thr.start()

        # No access to app.pending() from here
        while True:
            thr.join(0.1)
            wx.Yield()
            if not thr.isAlive():
                break
        thr.join()

        binfo.Destroy()
        # Open error dialog if stderr is not null
        if thr.status:
            binfo = ErrorDialog(frame)
            binfo.Show() 
開發者ID:neuropoly,項目名稱:spinalcordtoolbox,代碼行數:23,代碼來源:sct_plugin.py

示例4: CalibrateColor

# 需要導入模塊: import wx [as 別名]
# 或者: from wx import Yield [as 別名]
def CalibrateColor(self):
        ll = self.giface.GetLayerList()
        checked = []
        for l in ll:
            if ll.IsLayerChecked(l):
                checked.append(l.cmd)
                ll.CheckLayer(l, False)
        wx.Yield()

        self.scaniface.Scan(continuous=False)
        self.scaniface.process.wait()
        self.scaniface.process = None
        self.scaniface.status.SetLabel("Done.")

        self._defineEnvironment()

        self._calibrateColor()
        # check the layers back to previous state
        ll = self.giface.GetLayerList()
        for l in ll:
            if l.cmd in checked:
                ll.CheckLayer(l, True) 
開發者ID:tangible-landscape,項目名稱:grass-tangible-landscape,代碼行數:24,代碼來源:g.gui.tangible.py

示例5: Run

# 需要導入模塊: import wx [as 別名]
# 或者: from wx import Yield [as 別名]
def Run(self, func):
        ll = self.giface.GetLayerList()
        checked = []
        for l in ll:
            if ll.IsLayerChecked(l):
                checked.append(l.cmd)
                ll.CheckLayer(l, False)
        wx.Yield()

        if not self.scaniface.IsScanning():
            self.scaniface.Scan(continuous=False)
            self.scaniface.process.wait()
            self.scaniface.process = None
            self.scaniface.status.SetLabel("Done.")
            self.Done(func, checked)
        elif self.scaniface.pause:
            pass
        else:
            wx.CallLater(3000, self.Done, func, checked) 
開發者ID:tangible-landscape,項目名稱:grass-tangible-landscape,代碼行數:21,代碼來源:color_interaction.py

示例6: AskSave

# 需要導入模塊: import wx [as 別名]
# 或者: from wx import Yield [as 別名]
def AskSave(self):
        if not (self.modified or panel.IsModified()): return True
        flags = wx.ICON_EXCLAMATION | wx.YES_NO | wx.CANCEL | wx.CENTRE
        dlg = wx.MessageDialog( self, 'File is modified. Save before exit?',
                               'Save before too late?', flags )
        say = dlg.ShowModal()
        dlg.Destroy()
        wx.Yield()
        if say == wx.ID_YES:
            self.OnSaveOrSaveAs(wx.CommandEvent(wx.ID_SAVE))
            # If save was successful, modified flag is unset
            if not self.modified: return True
        elif say == wx.ID_NO:
            self.SetModified(False)
            panel.SetModified(False)
            return True
        return False 
開發者ID:andreas-p,項目名稱:admin4,代碼行數:19,代碼來源:xrced.py

示例7: create

# 需要導入模塊: import wx [as 別名]
# 或者: from wx import Yield [as 別名]
def create(self):
        # creates/shows the widget of the given toplevel node and all its children
        wx.BeginBusyCursor()
        try:
            WindowBase.create(self)
        finally:
            wx.EndBusyCursor()
        # from old code:
        # below, probably check_prop should be False
        ## set the best size for the widget (if no one is given)
        #if not self.check_prop('size'):
            #if self.sizer:  # self.sizer is the containing sizer, i.e. the parent
                #self.sizer.fit_parent()
            #elif self.WX_CLASS=="wxPanel" and self.children:
                #wx.Yield()  # by now, there are probably many EVT_SIZE in the queue
                #self.children[0].fit_parent()

        self.widget.GetTopLevelParent().Show()
        # SafeYield and SetFocus are required for e.g. Ubuntu w. Python 3.8 and wxPython 4.0.7
        # see file SIMPLIFICATIONS\Tests_full.wxg where the first frame will not be layouted
        wx.SafeYield()
        self.widget.Raise()
        self.widget.SetFocus() 
開發者ID:wxGlade,項目名稱:wxGlade,代碼行數:25,代碼來源:edit_windows.py

示例8: readNMEA0183

# 需要導入模塊: import wx [as 別名]
# 或者: from wx import Yield [as 別名]
def readNMEA0183(self, port, baudrate):
		try:
			self.serial = serial.Serial(port, baudrate, timeout=1)
		except:
			return False
		timewait = time.time() + 1.5
		index = 0
		countwrong = 0
		print 'search NMEA0183 on ' + port + ' with baudrate ' + baudrate
		text = ''
		while time.time() < timewait:
			wx.Yield()
			try:
				c = self.serial.read(1)
			except: c = ''
			if c != '':
				b = ord(c)
				# print c
				if b == 10 or b == 13 or (32 <= b < 128):
					index += 1
					if b == 13:
						print '	' + text[:-1]
						text = ''
					elif b == 10:
						pass
					else:
						text += c

				else:
					#print 'countwrong ', b
					countwrong += 1

		if index > 10 and countwrong < index/10:
			print 'found NMEA0183 on ' + port + ' with baudrate ' + str(baudrate)
			return True
		else:
			return False 
開發者ID:sailoog,項目名稱:openplotter,代碼行數:39,代碼來源:autosetup_tty.py

示例9: readNMEA0183name

# 需要導入模塊: import wx [as 別名]
# 或者: from wx import Yield [as 別名]
def readNMEA0183name(self, port, baudrate):
		self.serial = serial.Serial(port, baudrate, timeout=1)
		timewait = time.time() + 10.1
		name_list = []
		nmea = self.serial.readline()
		while time.time() < timewait:
			wx.Yield()
			nmea = self.serial.readline()
			print '	' + nmea[:-2]
			if len(nmea) > 7:
				if nmea[1:3] not in name_list:
					name_list.append(nmea[1:3])

		if len(name_list) > 1:
			self.mpx+=1
			return 'MPX'+str(self.mpx)
		elif len(name_list) == 1:
			return name_list[0]
		else:
			return 'UNDEF' 
開發者ID:sailoog,項目名稱:openplotter,代碼行數:22,代碼來源:autosetup_tty.py

示例10: readNMEA2000

# 需要導入模塊: import wx [as 別名]
# 或者: from wx import Yield [as 別名]
def readNMEA2000(self, port, baudrate):
		try:
			self.serial = serial.Serial(port, baudrate, timeout=1)
		except:
			return False
		timewait = time.time() + 0.5
		print 'search NMEA2000 on ' + port + ' with baudrate ' + baudrate

		data = [0x10, 0x2, 0xa1, 0x01, 0x01, 0x5d, 0x10, 0x03]
		for i in data:
			self.serial.write(chr(i))
		while time.time() < timewait:
			try:
				c = self.serial.read(1)
			except: c = ''
			if c != '':
				b = ord(c)
				if b == 0x10:
					try:
						c = self.serial.read(1)
					except: c = ''
					if c != '':
						b = ord(c)
						if b == 0x02:
							print 'found NMEA2000 on ' + port + ' with baudrate ' + str(baudrate)
							wx.Yield()
							return True
		print 'not found NMEA2000 on ' + port + ' with baudrate ' + str(baudrate)
		wx.Yield()
		return False 
開發者ID:sailoog,項目名稱:openplotter,代碼行數:32,代碼來源:autosetup_tty.py

示例11: flush_events

# 需要導入模塊: import wx [as 別名]
# 或者: from wx import Yield [as 別名]
def flush_events(self):
        wx.Yield() 
開發者ID:ktraunmueller,項目名稱:Computable,代碼行數:4,代碼來源:backend_wx.py

示例12: Destroy

# 需要導入模塊: import wx [as 別名]
# 或者: from wx import Yield [as 別名]
def Destroy(self, *args, **kwargs):
        try:
            self.canvas.mpl_disconnect(self.toolbar._idDrag)
            # Rationale for line above: see issue 2941338.
        except AttributeError:
            pass # classic toolbar lacks the attribute
        wx.Frame.Destroy(self, *args, **kwargs)
        if self.toolbar is not None:
            self.toolbar.Destroy()
        wxapp = wx.GetApp()
        if wxapp:
            wxapp.Yield()
        return True 
開發者ID:ktraunmueller,項目名稱:Computable,代碼行數:15,代碼來源:backend_wx.py

示例13: flush_events

# 需要導入模塊: import wx [as 別名]
# 或者: from wx import Yield [as 別名]
def flush_events(self):
        # docstring inherited
        wx.Yield() 
開發者ID:PacktPublishing,項目名稱:Mastering-Elasticsearch-7.0,代碼行數:5,代碼來源:backend_wx.py

示例14: Destroy

# 需要導入模塊: import wx [as 別名]
# 或者: from wx import Yield [as 別名]
def Destroy(self, *args, **kwargs):
        try:
            self.canvas.mpl_disconnect(self.toolbar._idDrag)
            # Rationale for line above: see issue 2941338.
        except AttributeError:
            pass  # classic toolbar lacks the attribute
        if not self.IsBeingDeleted():
            wx.Frame.Destroy(self, *args, **kwargs)
            if self.toolbar is not None:
                self.toolbar.Destroy()
            wxapp = wx.GetApp()
            if wxapp:
                wxapp.Yield()
        return True 
開發者ID:PacktPublishing,項目名稱:Mastering-Elasticsearch-7.0,代碼行數:16,代碼來源:backend_wx.py

示例15: destroy

# 需要導入模塊: import wx [as 別名]
# 或者: from wx import Yield [as 別名]
def destroy(self, *args):
        DEBUG_MSG("destroy()", 1, self)
        self.frame.Destroy()
        wxapp = wx.GetApp()
        if wxapp:
            wxapp.Yield() 
開發者ID:PacktPublishing,項目名稱:Mastering-Elasticsearch-7.0,代碼行數:8,代碼來源:backend_wx.py


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