lo,
I am having problem with tree event in my tiny implementation of Mediator pattern.
In my window, i have 2 events :
* one on a wxButton which work fine
* one on a wxTreeCtrl which causing me trouble : NOTHING happens (no output, warning nor error)
the aim of my app, is having to widget which produce the same event : outputting in the text area (and testing the pattern )
tinyMediator.py (2.18 KB)
路路路
-----------
class MyApp(wx.App):
聽聽聽聽def OnInit(self):
聽聽聽聽聽聽聽聽mainWindow = wx.Frame(None, -1, "TinyMediator")
聽聽聽聽聽聽聽聽tinySizer = wx.BoxSizer(wx.VERTICAL)
聽聽聽聽聽聽聽聽tinyMediator = Mediator()
聽聽聽聽聽聽聽聽zoneText = TextArea(mainWindow)
聽聽聽聽聽聽聽聽copyBut = CopyButton(mainWindow, tinyMediator)
聽聽聽聽聽聽聽聽tinyTree = TinyTree(mainWindow, tinyMediator)
聽聽聽聽聽聽聽聽tinyMediator.registerTextView(zoneText)
聽聽聽聽聽聽聽聽tinySizer.Add(zoneText, 1, wx.EXPAND)
聽聽聽聽聽聽聽聽tinySizer.Add(copyBut, 1, wx.EXPAND)
聽聽聽聽聽聽聽聽tinySizer.Add(tinyTree, 1, wx.EXPAND)
聽聽聽聽聽聽聽聽wx.EVT_TREE_SEL_CHANGED(mainWindow, tinyTree.GetId(), tinyTree.execute)
聽聽聽聽聽聽聽聽wx.EVT_BUTTON(mainWindow, copyBut.GetId(), copyBut.execute)
聽聽聽聽聽聽聽聽mainWindow.SetSizerAndFit(tinySizer)
聽聽聽聽聽聽聽聽mainWindow.Show(wx.true)
聽聽聽聽聽聽聽聽# Show the Application as the top window
聽聽聽聽聽聽聽聽self.SetTopWindow(mainWindow)
聽聽聽聽聽聽聽聽return wx.true
-----------
If someone has any id??!!
Regards,
---kevin