BTW: Messages I send to wxpython-users@lists.wxwindows.org seem to bounce.
The reason given is timeout. Messages sent to
wxpython-users@lists.sourceforge.net work fine.
Send a message about it to ron@otsys.com, with a sample bounced message (or
at least all the headers.)
> > In the child window's mouse event handler:
> >
> > self.GetParent().GetEventHandler().ProcessEvent(event)
Nope. It didn't work. I'm using python-1.5.2 with wxPython-2.2.0.
I put the above code in my OnLeftDoubleClick method of the child
window. I have an EVT_LEFT_DCLICK table entry in the parent window but
the method still doesn't get called [:(]
Is there something I'm missing ???
I just tried it out here and it works okay. I don't think ther ehave been
any changes since 2.2.0 that would change this behaviour... If you can
reduce the problem down to a small sample app I would be interested in
looking at it.
Can I send arbitrary events to the parent ??? I'm sure I can. Do I use
the above technique (ie. X.Y.ProcessEvent()) or is there some kind of
SendEvent method ??
ProcessEvent is good for when you want the event to be handled immediately.
You can use wxPostEvent(eventHandler, event) to send events from another
thread or when you want the event to be handled later, (as soon as the
application becomes idle.)
···
--
Robin Dunn
Software Craftsman
robin@AllDunn.com Java give you jitters? http://wxPython.org Relax with wxPython!
I got it working. I had to use self.GetGrandParent() rather than
self.GetParent(). I'm not sure why. The child is called wxCvsListCtrl
and is derived from wxListCtrl. My handler OnDoubleClick is in
wxCvsListCtrl which is the child of wxCvsCtrl. Therefore
wxCvsGetParent() should return the wxCvsCtrl object, but it doesn't.
Is there an explanation for what I'm seeing ???
If you had to use the grandparent then there must be some other window
between the two.
>> Can I send arbitrary events to the parent ??? I'm sure I can. Do I
use
>> the above technique (ie. X.Y.ProcessEvent()) or is there some kind of
>> SendEvent method ??
>
> ProcessEvent is good for when you want the event to be handled
immediately.
> You can use wxPostEvent(eventHandler, event) to send events from another
> thread or when you want the event to be handled later, (as soon as the
> application becomes idle.)
I found the AddPendingEvent() method. Is this an alternative to
wxPostEvent(). What are the differences ???
wxPostEvent uses AddPendingEvent. It also calls wxWakeUpIdle which tickles
the idle processor into starting in case there are no other events to get it
going.
If I use ProcessEvent() do I run the risk of getting into recursive
calls (possibly indefinately) ???
It's possible, but won't happen if you're careful. If you call self.SetSize
from a window's EVT_SIZE handler then it can happen too, but it's easy to
put recursion guards in place when needed...
···
--
Robin Dunn
Software Craftsman
robin@AllDunn.com Java give you jitters? http://wxPython.org Relax with wxPython!