Is there a way to programmatically close a context menu (TContextMenu)?
The menu was open by right clicking on the canvas.
Thank you!
Is there a way to programmatically close a context menu (TContextMenu)?
The menu was open by right clicking on the canvas.
Thank you!
I don’t think so, I’ll have to investigate. But what are you trying to do exactly?
In principle, something like this should work:
void *ud;
TContextMenu *cm = fCanvas->GetContextMenu();
if (cm)
((TGPopupMenu *)cm->GetContextMenuImp())->EndMenu(ud);
Hello Bertrand!
This approach does not work for me.
On the question “why”:
I have TCanvas shown in a Qt window. I handle mouse actions using the HandleInput method of TCanvas. On right-click, the context menu is shown. However, the only way to close it when it was shown non-intentionally is to click on its title. I would like to find a way to close it programmatically on the mouse click outside the menu.
Thanks again,
Andrey
OK, then I’m afraid there is no solution to your issue…