Disable browser right-click menu for a widget
Added by Anonymous over 13 years ago
Hi all,
I'm handling right-button events in my app and would like to disable the default browser popup menu that appears on right-button-up events. I would like to disable the menu for a given widget only. Is there a way to do this in the Wt api?
Cheers,
Dan
Replies (2)
RE: Disable browser right-click menu for a widget - Added by Wim Dumon over 13 years ago
In the TreeViewDragDrop example, we do it like this:
/*
* To support right-click, we need to disable the built-in browser
* context menu.
*
* Note that disabling the context menu and catching the
* right-click does not work reliably on all browsers.
*/
treeView->setAttributeValue
("oncontextmenu",
"event.cancelBubble = true; event.returnValue = false; return false;");
RE: Disable browser right-click menu for a widget - Added by Anonymous over 13 years ago
Thanks Wim - works like a charm.