Hi, I'm using this control but I can't to handle control click (and others events). This is my code:
class BoExplorerPanel(wx.Panel):
def __init__(self, parent):
wx.Panel.__init__(self, parent, wx.ID_ANY)
self.initComponents() # initialize Window components
def initComponents(self):
print "Inizializzo i controlli"
# controls
resizeBox = wx.BoxSizer(wx.VERTICAL)
self.dirBrowser = wx.GenericDirCtrl(self, wx.ID_ANY, style = wx.DIRCTRL_DIR_ONLY)
resizeBox.Add(self.dirBrowser, 1, wx.EXPAND | wx.ALL)
self.SetSizerAndFit(resizeBox)
# events
self.Bind(wx.EVT_TREE_ITEM_ACTIVATED, self.dirBrowser_OnItemSelected, self.dirBrowser)
self.Bind(wx.EVT_TREE_ITEM_RIGHT_CLICK, self.dirBrowser_OnRightClick, self.dirBrowser)
self.Bind(wx.EVT_TREE_SEL_CHANGED, self.dirBrowser_OnSelectionChanged, self.dirBrowser)
# panel's properties
def dirBrowser_OnItemSelected(self, event):
print "CLicked"
def dirBrowser_OnRightClick(self, event):
print "Right Click"
def dirBrowser_OnSelectionChanged(self, event):
print "Selection Changed"