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


Python wx.NewEventType方法代碼示例

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


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

示例1: OnInit

# 需要導入模塊: import wx [as 別名]
# 或者: from wx import NewEventType [as 別名]
def OnInit(self):
        self.running = True
        if profile:
            try:
                os.unlink(prof_file_name)
            except:
                pass
            self.prof = Profiler()
            self.prof.enable()
        
        wx.the_app = self
        self._DoIterationId = wx.NewEventType()
        self.Connect(-1, -1, self._DoIterationId, self._doIteration)
        self.evt = wx.PyEvent()
        self.evt.SetEventType(self._DoIterationId)
        self.event_queue = []

        # this breaks TreeListCtrl, and I'm too lazy to figure out why
        #wx.IdleEvent_SetMode(wx.IDLE_PROCESS_SPECIFIED)
        # this fixes 24bit-color toolbar buttons
        wx.SystemOptions_SetOptionInt("msw.remap", 0)
        icon_path = os.path.join(image_root, 'bittorrent.ico')
        self.icon = wx.Icon(icon_path, wx.BITMAP_TYPE_ICO)
        return True 
開發者ID:kenorb-contrib,項目名稱:BitTorrent,代碼行數:26,代碼來源:__init__.py

示例2: _CommandEvent

# 需要導入模塊: import wx [as 別名]
# 或者: from wx import NewEventType [as 別名]
def _CommandEvent():
    """Generate new (CmdEvent, Binder) tuple
        e.g. MooCmdEvent, EVT_MOO = EgCommandEvent()
    """
    evttype = wx.NewEventType()

    class _Event(wx.PyCommandEvent):
        def __init__(self, id, **kw):
            wx.PyCommandEvent.__init__(self, evttype, id)
            self.__dict__.update(kw)
            if not hasattr(self, "value"):
                self.value = None

        def GetValue(self):
            return self.value

        def SetValue(self, value):
            self.value = value

    return _Event, wx.PyEventBinder(evttype, 1) 
開發者ID:EventGhost,項目名稱:EventGhost,代碼行數:22,代碼來源:Core.py

示例3: CallAfter

# 需要導入模塊: import wx [as 別名]
# 或者: from wx import NewEventType [as 別名]
def CallAfter(callableObj, *args, **kw):
    """
    Call the specified function after the current and pending event
    handlers have been completed.  This is also good for making GUI
    method calls from non-GUI threads.  Any extra positional or
    keyword args are passed on to the callable when it is called.
    
    :param PyObject callableObj: the callable object
    :param args: arguments to be passed to the callable object
    :param kw: keywords to be passed to the callable object
    
    .. seealso::
        :class:`CallLater`
    """
    assert callable(callableObj), "callableObj is not callable"
    app = wx.GetApp()
    assert app is not None, 'No wx.App created yet'
    
    if not hasattr(app, "_CallAfterId"):
        app._CallAfterId = wx.NewEventType()
        app.Connect(-1, -1, app._CallAfterId,
                    lambda event: event.callable(*event.args, **event.kw) )
    evt = wx.PyEvent()
    evt.SetEventType(app._CallAfterId)
    evt.callable = callableObj
    evt.args = args
    evt.kw = kw
    wx.PostEvent(app, evt) 
開發者ID:dougthor42,項目名稱:wafer_map,代碼行數:30,代碼來源:core.py

示例4: _EventMaker

# 需要導入模塊: import wx [as 別名]
# 或者: from wx import NewEventType [as 別名]
def _EventMaker():
    evt = wx.NewEventType()
    return (evt, wx.PyEventBinder(evt)) 
開發者ID:JackonYang,項目名稱:bookhub,代碼行數:5,代碼來源:OLVEvent.py


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