Buttons: 1 event under Linux/GTK, 2 under Win32?

When I run this program under Linux/GTK the handler is called
once each time the button is clicked (which is what I
expect/want). Under WinMe, it's called twice each time the
button is clicked.

Why?

---------------------------------8<------------------------------------
import wx

class MyFrame(wx.Frame):
    
    def __init__(self,parent,title):
        wx.Frame.__init__(self,parent,-1,title)
        s = wx.BoxSizer(wx.HORIZONTAL)
        b = wx.Button(self,-1,"Connect")
        self.Bind(wx.EVT_BUTTON, self.handleConnect, b)
        s.Add(b)
        self.SetSizerAndFit(s)
        
    def handleConnect(self,event):
        event.Skip()
        print "handleConnect",event
        
class MyApp(wx.App):
    def OnInit(self):
        frame = MyFrame(None, "Button Test")
        frame.Show(True)
        self.SetTopWindow(frame)
        return True
        
app = MyApp(False)
app.MainLoop()
---------------------------------8<------------------------------------

···

--
Grant Edwards gedwards@rivatek.com
Staff Engineer
RivaTek, Inc.

Grant Edwards wrote:

When I run this program under Linux/GTK the handler is called
once each time the button is clicked (which is what I
expect/want). Under WinMe, it's called twice each time the
button is clicked.

Why?

Not sure but try putting the button on a wx.Panel instead of directly in the frame.

···

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