wxTreeCtrl event bug only win32?

Krzysztof Kaczkowski krzysztof at py142.wroclaw.sdi.tpnet.pl
Tue Aug 26 17:00:19 CEST 2003


Hello
Im  having problem, wxTreeCtrl generate 3 x  EVT_TREE_SEL_CHANGED on click
item right button mouse. This problem only win32. Why?


Simple example:

from wxPython.wx import *
class MyApp(wxApp):
    def OnInit(self):
        frame = wxFrame(NULL, -1, "wxPython",
wxDefaultPosition,wxSize(200,150))
        frame.Show(true)
        self.nr = 0
        self.SetTopWindow(frame)
        self.ID_TREE = wxNewId()
        self.tree = wxTreeCtrl(frame, self.ID_TREE)
        root = self.tree.AddRoot('root test event')
        itm = self.tree.AppendItem(root, 'Right click first item')
        itm = self.tree.AppendItem(root, 'Right click next item')
        EVT_TREE_SEL_CHANGED    (self, self.ID_TREE, self.ItemChanged)
        return True

    def ItemChanged(self, event):
        self.nr += 1
        print self.nr

app = MyApp(0)
app.MainLoop()








More information about the Python-list mailing list