本文整理汇总了Python中wx.CallLater方法的典型用法代码示例。如果您正苦于以下问题:Python wx.CallLater方法的具体用法?Python wx.CallLater怎么用?Python wx.CallLater使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类wx
的用法示例。
在下文中一共展示了wx.CallLater方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: windowProc
# 需要导入模块: import wx [as 别名]
# 或者: from wx import CallLater [as 别名]
def windowProc(self, hwnd, msg, wParam, lParam):
if msg != WM_COPYDATA:
return
hwnd = wParam
struct_pointer = lParam
message_data = ctypes.cast(struct_pointer, PCOPYDATASTRUCT)
url = ctypes.wstring_at(message_data.contents.lpData)
log.info("Received url: %s" % url)
try:
con_info = connection_info.ConnectionInfo.from_url(url)
except connection_info.URLParsingError:
wx.CallLater(50, gui.messageBox, parent=gui.mainFrame, caption=_("Invalid URL"),
# Translators: Message shown when an invalid URL has been provided.
message=_("Unable to parse url \"%s\"")%url, style=wx.OK | wx.ICON_ERROR)
log.exception("unable to parse nvdaremote:// url %s" % url)
raise
log.info("Connection info: %r" % con_info)
if callable(self.callback):
wx.CallLater(50, self.callback, con_info)
示例2: Calibrate
# 需要导入模块: import wx [as 别名]
# 或者: from wx import CallLater [as 别名]
def Calibrate(self, startTask):
self._loadConfiguration(None)
if 'base' in self.tasks[self.current]:
self.settings['scan']['elevation'] = self.tasks[self.current]['base']
elif 'base_region' in self.tasks[self.current]:
self.settings['scan']['region'] = self.tasks[self.current]['base_region']
self.settings['output']['scan'] = 'scan_saved'
self.settings['analyses']['file'] = ''
self._loadScanningParams(key='scanning_params')
# just update whatever was not set with 'scanning_params'
self._loadScanningParams(key='calibration_scanning_params')
# resume scanning
self.buttonCalibrate.SetLabel("Calibrating...")
self.scaniface.filter['filter'] = False
self._startScanning()
wx.CallLater(2000, lambda: self.CalibrationDone(startTask))
示例3: Run
# 需要导入模块: import wx [as 别名]
# 或者: from wx import CallLater [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)
示例4: Notify
# 需要导入模块: import wx [as 别名]
# 或者: from wx import CallLater [as 别名]
def Notify(self):
if hasattr(self, 'TotalMsgs') and self.TotalMsgs > 0:
toaster = TB.ToasterBox(self, tbstyle=TB.TB_COMPLEX)
toaster.SetPopupSize((200, 120))
toaster.SetPopupPauseTime(4000)
toaster.SetPopupPositionByInt(3)
toaster.SetPopupBackgroundColour('#F2F5A9')
tbpanel = toaster.GetToasterBoxWindow()
panel = wx.Panel(tbpanel, -1)
sizer = wx.BoxSizer(wx.VERTICAL)
sizer.AddSpacer(10)
st = wx.StaticText(panel, wx.ID_ANY, label= u'有新消息!')
sizer.Add(st, 0, wx.ALIGN_CENTER|wx.ALL, 10)
button = wx.Button(panel, wx.ID_ANY, u"点击查看")
self.Bind(wx.EVT_BUTTON, self.OnMessages, button)
sizer.Add(button, 0, wx.ALIGN_CENTER|wx.ALL, 10)
panel.SetSizer(sizer)
toaster.AddPanel(panel)
wx.CallLater(1000, toaster.Play)
示例5: edit_properties
# 需要导入模块: import wx [as 别名]
# 或者: from wx import CallLater [as 别名]
def edit_properties(self, edit_widget):
# this will be called with a delay
if edit_widget is not self.next_widget:
# wait for another call...
return
if self._notebook_decoration_size is None:
# try again later
wx.CallLater( 150, self.edit_properties, edit_widget )
return
self.current_widget = None
self.create_editor(edit_widget)
self.current_widget = edit_widget
if edit_widget:
# XXX set status bar
klass = edit_widget.get_prop_value("class", edit_widget.WX_CLASS)
self.heading.SetValue( _('Properties - %s - <%s>:') % (klass, edit_widget.name) )
else:
self.heading.SetValue( _('Properties') )
示例6: __restart_gps
# 需要导入模块: import wx [as 别名]
# 或者: from wx import CallLater [as 别名]
def __restart_gps(self):
self.__stop_gps()
wx.CallLater(GPS_RETRY * 1000, self.__start_gps)
示例7: __init__
# 需要导入模块: import wx [as 别名]
# 或者: from wx import CallLater [as 别名]
def __init__(self):
wx.adv.SplashScreen.__init__(self, images.Splash.GetBitmap(),
wx.adv.SPLASH_CENTRE_ON_SCREEN | wx.adv.SPLASH_TIMEOUT, 2500, None, -1)
self.Bind(wx.EVT_CLOSE, self._on_close)
self.__fc = wx.CallLater(2000, self._show_main)
示例8: CalibrationDone
# 需要导入模块: import wx [as 别名]
# 或者: from wx import CallLater [as 别名]
def CalibrationDone(self, startTask):
self._stopScanning()
wx.CallLater(4000, lambda: self.buttonCalibrate.SetLabel("Calibrate"))
if startTask:
wx.CallLater(4000, lambda: self.OnStart(None))
示例9: _startSlides
# 需要导入模块: import wx [as 别名]
# 或者: from wx import CallLater [as 别名]
def _startSlides(self):
# lazy import
from activities_slides import Slides
self.slides = Slides(self)
self.slides.SetPosition(self.configuration['slides']['position'])
self.slides.LoadURL('file://' + os.path.join(self.configuration['slides']['dir'], self.tasks[self.current]['slides']['file']))
self.slides.Maximize(True)
self.slides.Show()
slidenum = 1
self.slidesStatus.SetLabel("Slide {}".format(slidenum))
for t in self.tasks[self.current]['slides']['switch']:
slidenum += 1
wx.CallLater(t * 1000, self._switchSlide, slidenum)
wx.CallLater(self.tasks[self.current]['slides']['switch'][-1] * 1000, self._startTask)
示例10: _hideToolbarStatusbar
# 需要导入模块: import wx [as 别名]
# 或者: from wx import CallLater [as 别名]
def _hideToolbarStatusbar(self):
"""Hide toolbar and statusbar of active Map Display"""
self.giface.ShowAllToolbars(False)
self.giface.ShowStatusbar(False)
wx.CallLater(1000, self.giface.GetMapDisplay().PostSizeEvent)
示例11: _startTask
# 需要导入模块: import wx [as 别名]
# 或者: from wx import CallLater [as 别名]
def _startTask(self):
if self.timer.IsRunning():
return
self._hideToolbarStatusbar()
self.currentSubtask = 0
self._processingSubTask = False
self.scaniface.additionalParams4Analyses = {'subTask': self.currentSubtask}
self.LoadLayers()
if 'base' in self.tasks[self.current]:
self.settings['scan']['elevation'] = self.tasks[self.current]['base']
elif 'base_region' in self.tasks[self.current]:
self.settings['scan']['region'] = self.tasks[self.current]['base_region']
self.settings['analyses']['file'] = os.path.join(self._getTaskDir(), self.tasks[self.current]['analyses'])
self.settings['output']['scan'] = 'scan'
self._loadScanningParams(key='scanning_params')
# resume scanning
if 'filter' in self.tasks[self.current]:
self.scaniface.filter['filter'] = True
self.scaniface.filter['counter'] = 0
self.scaniface.filter['threshold'] = self.tasks[self.current]['filter']['threshold']
self.scaniface.filter['debug'] = self.tasks[self.current]['filter']['debug']
if 'single_scan' in self.tasks[self.current] and self.tasks[self.current]['single_scan']:
self._stopScanning()
else:
self._startScanning()
# profile
if 'profile' in self.tasks[self.current]:
self.StartProfile()
# display
if 'display' in self.tasks[self.current]:
self.StartDisplay()
wx.CallLater(1000, self._setFocus)
self.startTime = datetime.datetime.now()
self.endTime = 0
self.timer.Start(100)
示例12: _stop
# 需要导入模块: import wx [as 别名]
# 或者: from wx import CallLater [as 别名]
def _stop(self):
# pause scanning
self._stopScanning()
if 'duration_handsoff_after' in self.configuration:
t = self.configuration['duration_handsoff_after']
wx.CallLater(t, self.PostProcessing)
else:
self.PostProcessing()
self._setFocus()
示例13: OnSubtask
# 需要导入模块: import wx [as 别名]
# 或者: from wx import CallLater [as 别名]
def OnSubtask(self, event):
self._processingSubTask = True
self.LoadHandsOff()
# keep scanning without hands
if 'duration_handsoff' in self.configuration:
t = self.configuration['duration_handsoff']
else:
t = 0
wx.CallLater(t, self._subtaskStop)
示例14: _subtaskStop
# 需要导入模块: import wx [as 别名]
# 或者: from wx import CallLater [as 别名]
def _subtaskStop(self):
# pause scanning
self._stopScanning()
if 'duration_handsoff_after' in self.configuration:
t = self.configuration['duration_handsoff_after']
else:
t = 0
if 'solutions' in self.tasks[self.current]:
wx.CallLater(t, self.PostProcessing, onDone=self._showSolutions)
else:
wx.CallLater(t, self.PostProcessing, onDone=self._subtaskDone)
示例15: _showSolutions
# 需要导入模块: import wx [as 别名]
# 或者: from wx import CallLater [as 别名]
def _showSolutions(self):
ll = self.giface.GetLayerList()
if self.handsoff:
ll.DeleteLayer(self.handsoff)
cmd = self.tasks[self.current]['solutions'][self.currentSubtask]
if cmd[0] == 'd.rast':
ll.AddLayer('raster', name=cmd[1].split('=')[1], checked=True,
opacity=1.0, cmd=cmd)
elif cmd[0] == 'd.vect':
ll.AddLayer('vector', name=cmd[1].split('=')[1], checked=True,
opacity=1.0, cmd=cmd)
wx.CallLater(6000, self._subtaskDone)