[wxPython] Popup menus for tree ctrl

There really should be built-in support for popup menus in tree ctrls. I have just made on for my project. It is tedious to have to do onRightClick, HitTest and Menu create and Popup. Could there be a built-in event like EVT_TREE_RIGHT_CLICK that handles the hit test and sends the tree item? I'm sure this would be useful for inexperienced users like me :slight_smile:

James Shaw

路路路

_________________________________________________________________
Join the world锟絪 largest e-mail service with MSN Hotmail. http://www.hotmail.com

Sorry, but this is really too funny: has it occured to look at the
documentation to you? If yes, what do you think EVT_TREE_ITEM_RIGHT_CLICK
does? :slight_smile:

I don't know if it wrapped in wxPython although I can't see why it
wouldn't, but it is definitely there in C++.

Bye,
VZ

路路路

On Fri, 05 Apr 2002 10:21:16 +0000 James Shaw <hertzsprrrung@hotmail.com> wrote:

There really should be built-in support for popup menus in tree ctrls. I
have just made on for my project. It is tedious to have to do onRightClick,
HitTest and Menu create and Popup. Could there be a built-in event like
EVT_TREE_RIGHT_CLICK that handles the hit test and sends the tree item? I'm
sure this would be useful for inexperienced users like me :slight_smile:

From: Vadim Zeitlin

> There really should be built-in support for popup menus in
tree ctrls. I
> have just made on for my project. It is tedious to have to
do onRightClick,
> HitTest and Menu create and Popup. Could there be a built-in
event like
> EVT_TREE_RIGHT_CLICK that handles the hit test and sends the
tree item? I'm
> sure this would be useful for inexperienced users like me :slight_smile:

Sorry, but this is really too funny: has it occured to look at the
documentation to you? If yes, what do you think EVT_TREE_ITEM_RIGHT_CLICK
does? :slight_smile:

I don't know if it wrapped in wxPython although I can't see why it
wouldn't, but it is definitely there in C++.

Hmm, I don't see this documented in either the cvs build of the docs or the
wxPython 2.3.2.1 docs. Which section is it in Vadim? However, I do see it
defined in wxPython\controls2.py (grep is your friend). If you want a GUI
grep, findfiles is your friend with PythonCard :wink: Anyway, here is the
wrapper:

def EVT_TREE_ITEM_RIGHT_CLICK(win, id, func):
    win.Connect(id, -1, wxEVT_COMMAND_TREE_ITEM_RIGHT_CLICK, func)

This seems as good a time as any to quote Robin: "The source is the ultimate
documentation." I've been burned enough times, that I grep the source all
the time looking for clues. I don't always find answers, but it never hurts
to check.

ka

路路路

On Fri, 05 Apr 2002 10:21:16 +0000 James Shaw > <hertzsprrrung@hotmail.com> wrote: