By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,965 Members | 1,450 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,965 IT Pros & Developers. It's quick & easy.

create user message for wxPython

P: n/a
Hi,

There are 2 wxPython application, A and B and need to exchange msg.
Sending WM_CLOSE, wxEVT_MOUSEWHEEL to B is OK, and sending user message
like 1225 from A to B is also OK.

But B didn't catch this message, note, B is running before A sends msg
and can receive "WM_CLOSE".

Do I have to make my own msg loop by using win32api, win32gui? I used
win32gui to post Message to other windows.

Using wx.Frame:

wx.EVT_START_MSG= 1225
EVT_START_MSG_EVENT= wx.PyEventBinder(wx.EVT_START_MSG, 0)
EVT_START_MSG_EVENT(self, self.OnStart)
Or
Self.Bind(EVT_START_MSG_EVENT,self.OnStart)

def OnStart(self, event):
print 'got start message'

Thanks a lot in advance!

James
Oct 20 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a

"James Hu" <jh*@metrigenix.com> wrote in message
news:ma*************************************@pytho n.org...
Hi,
There are 2 wxPython application, A and B and need to exchange msg.


I do not think that wx even has a mechanism for sending events between
applications.?

You need some other tool, like a socket, a named pibe, some windows specific
event queue library (gack!), or maybe a toolkit like PYRO, SPREAD e.t.c.
depending on your *reason* for needing this in the first place.

I am partial to PYRO myself.

.... and you do need an event loop in any case to map from:

"remote event" <-> "message protocol" <-> "local event"

.... at least that makes it easier to test than "raw" event's which are
harder to control.
Oct 24 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.