Python wx.PyEvent() Examples

The following are 14 code examples of wx.PyEvent(). You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may also want to check out all available functions/classes of the module wx , or try the search function .
Example #1
Source File: __init__.py    From BitTorrent with GNU General Public License v3.0 6 votes vote down vote up
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 
Example #2
Source File: events.py    From RF-Monitor with GNU General Public License v2.0 5 votes vote down vote up
def __init__(self, eventType, **kwargs):
        wx.PyEvent.__init__(self)
        self.SetEventType(EVENT_THREAD)
        self.type = eventType
        self.data = kwargs 
Example #3
Source File: core.py    From wafer_map with GNU General Public License v3.0 5 votes vote down vote up
def _PyEvent_Clone(self):
    """
    Make a new instance of the event that is a copy of self.  
    
    Through the magic of Python this implementation should work for
    this and all derived classes.
    """
    # Create a new instance
    import copy
    clone = copy.copy(self)
    # and then invoke the C++ copy constructor to copy the C++ bits too.
    wx.PyEvent.__init__(clone, self)
    return clone 
Example #4
Source File: core.py    From wafer_map with GNU General Public License v3.0 5 votes vote down vote up
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) 
Example #5
Source File: GoSyncEvents.py    From gosync with GNU General Public License v2.0 5 votes vote down vote up
def __init__(self, event, data):
        wx.PyEvent.__init__(self)

        self.SetEventType(event)
        self.data = data

# A singleton class for event passing between
# different modules of GoSync 
Example #6
Source File: objdictedit.py    From CANFestivino with GNU Lesser General Public License v2.1 5 votes vote down vote up
def __init__(self, linkinfo):
            wx.PyEvent.__init__(self)
            self.SetEventType(EVT_HTML_URL_CLICK)
            self.linkinfo = (linkinfo.GetHref(), linkinfo.GetTarget()) 
Example #7
Source File: networkedit.py    From CANFestivino with GNU Lesser General Public License v2.1 5 votes vote down vote up
def __init__(self, linkinfo):
            wx.PyEvent.__init__(self)
            self.SetEventType(EVT_HTML_URL_CLICK)
            self.linkinfo = (linkinfo.GetHref(), linkinfo.GetTarget()) 
Example #8
Source File: frame_parser.py    From iqiyi-parser with MIT License 5 votes vote down vote up
def __init__(self, counter):
        wx.PyEvent.__init__(self)
        self.SetEventType(ID_BUTTON_PARSE_EVENT)
        self.counter = counter




# app = wx.App()
# frame_main = FrameParser(None)
# wx.TextEntryDialog(frame_main, 'a', 'as').ShowModal()
# frame_main.Show()
# app.MainLoop() 
Example #9
Source File: dialog_dllog.py    From iqiyi-parser with MIT License 5 votes vote down vote up
def __init__(self, data):
        wx.PyEvent.__init__(self)
        self.SetEventType(EVT_DLLOG_APPEND)
        self.data = data


# app = wx.App()
# # # frame_main = FrameParser(None)
# # #
# DialogCopyLink(None).Show()
# # # frame_main.Show()
# app.MainLoop() 
Example #10
Source File: frame_merger.py    From iqiyi-parser with MIT License 5 votes vote down vote up
def __init__(self, text):
        wx.PyEvent.__init__(self)
        self.SetEventType(EVT_OUTPUT_APPEND)
        self.text = text 
Example #11
Source File: frame_merger.py    From iqiyi-parser with MIT License 5 votes vote down vote up
def __init__(self, cur_len, total_len, cur_byte_str, remain_time_str):
        wx.PyEvent.__init__(self)
        self.SetEventType(EVT_OUTPUT_UPDATE)
        self.cur_len = cur_len
        self.total_len = total_len
        self.cur_byte_str = cur_byte_str
        self.remain_time_str = remain_time_str



# app = wx.App()
# frame_main = FrameMerger(None)
# frame_main.Show()
# dlg.ShowModal()
# app.MainLoop() 
Example #12
Source File: wxAnyThread.py    From KiCost with MIT License 5 votes vote down vote up
def __init__(self,func,args,kwds):
        wx.PyEvent.__init__(self)
        self.SetEventType(_EVT_INVOKE_METHOD)
        self.func = func
        self.args = args
        self.kwds = kwds
        self.event = threading.Event() 
Example #13
Source File: dochtml.py    From OpenPLC_Editor with GNU General Public License v3.0 5 votes vote down vote up
def __init__(self, linkinfo):
        wx.PyEvent.__init__(self)
        self.SetEventType(EVT_HTML_URL_CLICK)
        self.linkinfo = (linkinfo.GetHref(), linkinfo.GetTarget()) 
Example #14
Source File: wx_viewer.py    From dials with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
def __init__(self, data=None, recenter=False):
        wx.PyEvent.__init__(self)
        self.data = data
        self.recenter = recenter
        self.SetEventType(VIEWER_UPDATE_ID)