Catch events from other columns in wx.ListCtrl

Mike Driscoll wrote:

Catching the EVT_LIST_BEGIN_LABEL_EDIT event works for firing my

custom

frame popup. This is probably a dumb question, but is there some kind

of

event I can fire when that popped up frame is closed so I can update my
listctrl?

You can make a custom event if you want to do it that way, but the
easiest is to just catch the frame's EVT_CLOSE and then from that
handler call some method in your listctrl class that does what you need.

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!

I found the pubsub module actually does what I needed. I'm not sure how I
would go about catching an event that is thrown in a separate module
anyway. Thanks for the help.

Mike Driscoll
Applications Specialist
MCIS - Technology Center

That's the beauty of events. The code that wants to
catch the events tells wxPython to bind it, and then
it doesn't matter what code posts the events. The
events could come from the same module, a different
module, or whatever. It will all look the same to the
event handler.

Greg

···

--- Mike Driscoll <mdriscoll@co.marshall.ia.us> wrote:

I found the pubsub module actually does what I
needed. I'm not sure how I
would go about catching an event that is thrown in a
separate module
anyway.

____________________________________________________________________________________
Building a website is a piece of cake. Yahoo! Small Business gives you all the tools to get online.
http://smallbusiness.yahoo.com/webhosting

I understand the theory of what you say, but I don't know how to execute
it. I tried the following:

<code>

def OnEditOptions(self, event):
        
       frm = Options(configLst)
       frm.Bind(wx.EVT_CLOSE, self.OnOptionsClosed)
       frm.Show()

def OnOptionsClosed(self, event):
        print 'in OnOptionsClosed!'

</code>

This only causes my print statement to execute. It doesn't close the frame
that I called. If I told the handler in the opened frame to close and did
an event.skip(), wouldn't that propagate the EVT_CLOSE to the calling app
and cause it to be closed as well?

I only started Python just over a year ago and didn't get into wxPython
until Sept. or Oct. 2006.

Thanks,

Mike

···

-----Original Message-----
From: Gre7g Luterman [mailto:hafeliel@yahoo.com]
Sent: Tuesday, June 26, 2007 9:46 AM
To: wxPython-users@lists.wxwidgets.org
Subject: Re: [wxPython-users] Catch events from other columns
in wx.ListCtrl

--- Mike Driscoll <mdriscoll@co.marshall.ia.us> wrote:

> I found the pubsub module actually does what I needed. I'm not sure
> how I would go about catching an event that is thrown in a separate
> module anyway.

That's the beauty of events. The code that wants to catch
the events tells wxPython to bind it, and then it doesn't
matter what code posts the events. The events could come
from the same module, a different module, or whatever. It
will all look the same to the event handler.

Greg

______________________________________________________________

Nah, EVT_CLOSE events don't propagate like that. You
do need the event to propagate beyond your handler,
however, so it can float up to the wxPython handler
which will actually close the frame. Try:

def OnOptionsClosed(self, event):
    print 'in OnOptionsClosed!'
    event.Skip()

and it should be much happier.

Gre7g

···

--- Mike Driscoll <mdriscoll@co.marshall.ia.us> wrote:

I understand the theory of what you say, but I don't
know how to execute
it. I tried the following:

<code>

def OnEditOptions(self, event):
        
       frm = Options(configLst)
       frm.Bind(wx.EVT_CLOSE, self.OnOptionsClosed)
       frm.Show()

def OnOptionsClosed(self, event):
        print 'in OnOptionsClosed!'

</code>

This only causes my print statement to execute. It
doesn't close the frame
that I called. If I told the handler in the opened
frame to close and did
an event.skip(), wouldn't that propagate the
EVT_CLOSE to the calling app
and cause it to be closed as well?

I only started Python just over a year ago and
didn't get into wxPython
until Sept. or Oct. 2006.

____________________________________________________________________________________
Looking for a deal? Find great prices on flights and hotels with Yahoo! FareChase.
http://farechase.yahoo.com/