wxtreectrl and popups

Talk here about issues with one of the components hosted at wxCode, or suggest features for it.
Post Reply
armink
Experienced Solver
Experienced Solver
Posts: 79
Joined: Tue Aug 31, 2004 10:25 am
Location: Bavaria / Germany

wxtreectrl and popups

Post by armink »

In my app I had a wxTreeListCtrl on which appeared a popupmenu when right clicked on.

Now I switched to wxtreelistctrl and it doesnt appear anymore.

Her the relevant code parts:
In header file :

Code: Select all

class MyViewTree : public wxTreeListCtrl{
...
In constructor

Code: Select all

...
  PopUp = new wxMenu;
...
Then the on ... function:

Code: Select all

...
void MyViewTree::OnRightPopUp(wxMouseEvent &ev){

	PopupMenu(PopUp,  ev.GetPosition());
}
...
and finally

Code: Select all

...
EVT_RIGHT_DOWN(MyViewTree::OnRightPopUp) 
...

As said, this worked with wxTreeCtrl well

I even tried it in the constructor with

Code: Select all

Connect(
    wxEVT_RIGHT_DOWN,
    wxMouseEventHandler(MyViewTree::OnRightPopUp) ); 

But no effect ...

Any idea here around ?
Vexator
I live to help wx-kind
I live to help wx-kind
Posts: 187
Joined: Sun Jan 30, 2005 2:50 pm
Location: Heidelberg, Germany

Post by Vexator »

what happens if you replace ev.GetPosition() with wxDefaultPosition?
Windows 7 Pro
Visual Studio 2010
wxWidgets 2.9.3
armink
Experienced Solver
Experienced Solver
Posts: 79
Joined: Tue Aug 31, 2004 10:25 am
Location: Bavaria / Germany

Post by armink »

well nothing happens ... same as before.

I made a workaround opening the popup when an item is double-clicked until theres a solution.

Thanks
Post Reply