left button selection in tree control

hello all,

i was wondering whether there were a way to recognize when a user
selects an item in a TreeListCtrl with the left mouse button. there
are EVT_TREE_ITEM_RIGHT_CLICK and EVT_TREE_ITEM_MIDDLE_CLICK handlers,
but not one for left. alternatively, since there is the
EVT_TREE_SEL_CHANGED handler, is there a way to get whether the mouse
or keyboard was used (vs. the selection having been set
programatically)?

thanks,
Mjumbe Poe

mjumbe@seas.upenn.edu wrote:

hello all,

i was wondering whether there were a way to recognize when a user
selects an item in a TreeListCtrl with the left mouse button. there
are EVT_TREE_ITEM_RIGHT_CLICK and EVT_TREE_ITEM_MIDDLE_CLICK handlers,
but not one for left.

How about this:

self.tree.Bind(wx.EVT_LEFT_DOWN, self.OnLeftClick)

  alternatively, since there is the
EVT_TREE_SEL_CHANGED handler, is there a way to get whether the mouse
or keyboard was used (vs. the selection having been set
programatically)?

I think you can use the standard events for this: EVT_KEY_DOWN, EVT_LEFT_DOWN, etc...

ยทยทยท

thanks,
Mjumbe Poe

-------------------
Mike Driscoll

Blog: http://blog.pythonlibrary.org
Python Extension Building Network: http://www.pythonlibrary.org