[wxPython-users] Capturing a mouse click on the tab of an already selected notebook page

Bob Klahn bobstones at comcast.net
Tue Sep 25 17:03:11 PDT 2007


At 07:52 PM 9/25/2007, you wrote:
>Hi Bob,
>
>On 9/26/07, Bob Klahn wrote:
> > Still no luck, Robin.  My main-frame initialization code now 
> looks like this:
> >
> >      self.nb1.Bind(wx.EVT_LEFT_DOWN, self.OnLeftDown1)
> >      self.nb2.Bind(wx.EVT_LEFT_DOWN, self.OnLeftDown2)
> >
> >      def OnLeftDown1(self, evt):
> >          wx.CallAfter(self.SetDiagramFocus())
> >          evt.Skip()
> >
> >      def OnLeftDown2(self, evt):
> >          wx.CallAfter(self.SetDiagramFocus())
> >          evt.Skip()
>
>You shouldn't use brackets in the argument method of wx.CallAfter,
>this is what the traceback is saying. Try to use the following:
>
>       def OnLeftDown1(self, evt):
>           wx.CallAfter(self.SetDiagramFocus)
>           evt.Skip()
>
>       def OnLeftDown2(self, evt):
>           wx.CallAfter(self.SetDiagramFocus)
>           evt.Skip()
>
>Notice the missing parenthesis () in the wx.CallAfter arguments :-D :-D
>
>Andrea.

Aha!  Wunderbar!  It works!  Bless you.

Bob






More information about the wxpython-users mailing list