title: wxpython's wxEvent.Skip() explained
body: <p>I'm recently learning <code>wxPython</code> via <code>wxPython in Action</code>, but I got stuck in Chapter 3, especially to the explanation of <code>Figure 3.3</code>'s <code>Skip()</code> diamond</p>
  
  <p>In <code>Step 3 Locating the binder object</code>, the book writes:</p>
  
  <blockquote>
    <p>If a binder isn't found for the object itself, the processing walks up
    the class hierarchy to find a binder defined in a superclass of the
    object--<strong>(1)this is different than the walk up in the container hierarchy
    that happens in the next step.</strong></p>
  </blockquote>
  
  <p>But in the next step, <code>Step 4 Determining whether to continue processing</code> writes:</p>
  
  <blockquote>
    <p>The event handler asks for more processing by calling the wx.Event
    method Skip(). If the Skip() method is called, processing continues
    and <strong>(2)any</strong> handlers defined in the <strong>(3)superclass</strong> are found and executed in
    the step. The Skip() method can be called at any point in the handler.
    The Skip() method sets a flag in the event instance, which wxPython
    checks after the handler method is complete. In listing 3.3 the
    OnButtonClick() doesn't call Skip(), so in that case the event process
    is complete at the end of the handler method. The other two event
    handlers do call Skip() <strong>(4)so the system will keep searching for a
    matching event binding</strong>, <strong>(5)eventually invoking the default functionality
    for mouse enter and leave events for the native widget, such as
    mouse-over events.</strong></p>
  </blockquote>
  
  <p>My questions are related to numbers I marked in the passage:</p>
  
  <p>(1) In my understanding and some other googled materials, <em>propagat</em> is something happens in the container hierarchy, <strong>NOT</strong> the class hierarchy, is this correct?</p>
  
  <p>(2) Seriously? <strong>any</strong> handlers are executed? not the ones matching the instance and event combination?</p>
  
  <p>(3) Is <strong>superclass</strong> here correct? shouldn't it be <strong>parent windows?</strong></p>
  
  <p>(4) I think this line contradicts with question2, so maybe not <strong>any</strong> handlers are executed, just the ones which match the instance and event combination?</p>
  
  <p>(5) What is a <code>default functionality</code>? and how is it invoked? </p>
  
  <p>If anyone is intersted, listing-3.3.py is here:</p>
  
  <pre><code>import wx
  
  
  class MouseEventFrame(wx.Frame):
  
      def __init__(self, parent, id):
          wx.Frame.__init__(self, parent, id, 'Mouse Events',
                            size=(300, 200))
          self.panel = wx.Panel(self)
          self.button = wx.Button(self.panel,
                                  label='Not Over', pos=(100, 15))
          self.Bind(wx.EVT_BUTTON, self.OnButtonClick, self.button)
          self.button.Bind(wx.EVT_ENTER_WINDOW, self.OnEnterWindow)
          self.button.Bind(wx.EVT_LEAVE_WINDOW, self.OnLeaveWindow)
  
      def OnButtonClick(self, event):
          self.panel.SetBackgroundColour('Green')
          self.panel.Refresh()
  
      def OnEnterWindow(self, event):
          self.button.SetLabel('Over Me!')
          event.Skip()
  
      def OnLeaveWindow(self, event):
          self.button.SetLabel('Not Over')
          event.Skip()
  
  
  if __name__ == '__main__':
      app = wx.App()
      frame = MouseEventFrame(parent=None, id=-1)
      frame.Show()
      app.MainLoop()
  </code></pre>