how to receive a WM_COPYDATA message in wxwindows

Frank Bechmann fBechmann at web.de
Fri Jan 2 16:48:09 CET 2004


I started to write a SciTe director in python. I had a very basic
communication running in Pythonwin but I disliked the strong mixture
between Pythonwin's basic functionality and the Pythonwin application.

Now I was trying to do the same with wxWindows but I did not find a
way to receive the WM_COPYDATA messages sent from SciTe since there is
no predefined wx-event for WM_COPYDATA and I got completely lost in
the mix of C++/Swig/Python docs and sources. I tried to add my own
event handler like this:

    # wxEVT_COPYDATA = win32con.WM_COPYDATA  <== didn't work too
    wxEVT_COPYDATA = wx.NewEventType()
    def EVT_COPYDATA(win, func):
        win.Connect(-1, -1, wxEVT_COPYDATA, func)

    class CopyDataEvent(wx.PyEvent):
        def __init__(self, data):
            wx.PyEvent.__init__(self)
            self.SetEventType(wxEVT_COPYDATA)
            ...

    class SciCtrlFrame(wx.Frame):
        def __init__(self, logger, scitePath, sciteStartArgs):
            wx.Frame.__init__(self, None, -1, "title")
            ...
            EVT_COPYDATA(self, self.OnCopyData)

but that didn't work. Can someone give me a hint where the wxEventType
is documented or does someone even have an idea how to solve this?

thx in advance.



More information about the Python-list mailing list