- if (menu->GetMainWidget()) {
- menu->DestroyMenu(TRUE);
- }
-
- wxWindow *parent = this;
-
- menu->SetId(1); /* Mark as popped-up */
- menu->CreateMenu(NULL, widget, menu);
- // menu->SetParent(parent);
- // parent->children->Append(menu); // Store menu for later deletion
-
- Widget menuWidget = (Widget) menu->GetMainWidget();
-
- int rootX = 0;
- int rootY = 0;
-
- int deviceX = x;
- int deviceY = y;
- /*
- if (this->IsKindOf(CLASSINFO(wxCanvas)))
- {
- wxCanvas *canvas = (wxCanvas *) this;
- deviceX = canvas->GetDC ()->LogicalToDeviceX (x);
- deviceY = canvas->GetDC ()->LogicalToDeviceY (y);
- }
- */
-
- Display *display = XtDisplay (widget);
- Window rootWindow = RootWindowOfScreen (XtScreen((Widget)widget));
- Window thisWindow = XtWindow (widget);
- Window childWindow;
- XTranslateCoordinates (display, thisWindow, rootWindow, (int) deviceX, (int) deviceY,
- &rootX, &rootY, &childWindow);