K
Krzysztof Kaczkowski
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()
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()