wxPython-users Digest 21 Jul 2006 17:43:39 -0000 Issue 1568

Thanks very much, that was a big help! I read it in your book already,
but somehow that helped to solidify it a little more. It seems to make
more sense to me to always use self.widget.Bind instead of just
self.Bind, but as you know, there are possible repercussions to this.

···

---------- Forwarded message ----------
From: Robin Dunn <robin@alldunn.com>
To: wxPython-users@lists.wxwidgets.org
Date: Thu, 20 Jul 2006 17:34:12 -0700
Subject: Re: [wxPython-users] binding to the frame or the specific instance?
John Salerno wrote:
> Can someone explain to me the difference between these two ways of
> binding a click event:
>
> self.Bind(wx.EVT_BUTTON, self.OnClick, self.button)
>
> and
>
> self.button.Bind(wx.EVT_BUTTON, self.OnClick)
>
> Both seem to work, so I assume in some cases it doesn't matter which
> you use. Did I just get lucky here, or can buttons be done either way?

http://wiki.wxpython.org/index.cgi/self.Bind_vs._self.button.Bind

Yes, I was in a *very* metaphoric mood today. :wink:

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