From: Michael G. <sma...@ar...> - 2009-10-21 11:12:47
|
In article <34e...@ma...>, Eero Pajarre <epa...@gm...> wrote: > On Wed, Oct 21, 2009 at 11:06 AM, Michael Gerbracht <sma...@ar...> > wrote: > > I have a follow up question now: I would like to use the same menu on > > different TreeCtrl panes so I need a way to find out on which of the > > windows the mouse button was pressed. > I would probably bind a different function to different panes, and launch > the same menu from it. (Or maybe use a function which generates the menu on > demand). I am not sure if this is good style, but it is so easy to use > small anonymous callback functions.... Maybe I should have mentioned that I port a program which has a certain structure which I do not like to change too much. So for me it is much less work to define one menu and ask for the parent object. I will also need this at other places in the program. Anyway I found that objectID = event:GetEventObject():DynamicCast("wxTreeCtrl") will do the trick. Thanks! Michael |