title: Binding for events in wxpython only works for last one
body: <p>I am trying to populate the screen with multiple buttons automatically <em>(using for loop)</em></p>
  
  <p>Here is the snippet:</p>
  
  <pre><code>    i = 0
      for w in [1,2,3,4,5,6,7,8]:
          by.append(wx.Button(panel,label=w,pos = wx.Point(50*i,0)))
          by[i].Bind(wx.EVT_LEFT_DOWN,lambda event: self.OnClicked(event,by[i]))
          i += 1
      i = 0
  </code></pre>
  
  <p>when the event occurs, since I set the <code>i = 0</code>, all of the events are routed to the first button, even if I click on the last button. I know that if I set the slot with out the for loop it would work. But lets say I need to create about 50 buttons on a screen, and I want to do it automatically. How would I set the slot?</p>