On Sun, Jan 15, 2012 at 4:00 AM, Gustaf Nilsson <[email protected]> wrote: > hola > > i have a widget with a contextmenu. inside it is a textarea. problem is that > if i rightclick on the textarea (to use the browsers spell checking for > example) then the context menu pops up instead! how can i prevent this? > I tried to give the textarea something like: > > def onContextMenu(self, sender): > event = DOM.eventGetCurrentEvent() > DOM.eventStopPropagation(event) > > but it doesnt work. in fact it doesnt even get called even though i > have self.setContextMenu(self) in the textareas __init__()
you need to indicate that you wish the application to respond to that event type: it's not automatic, because otherwise it would waste CPU power calling functions that do.... nothing. soo.... hmmm... just looking at gwt/ui/Widget.py - you called Widget.setContextMenu... hmmm, then i have no idea. lkcl@teenymac:~/pyjamas/examples$ grep -il contextmen */*.py kitchensink/Menus.py maparea/MapAreaDemo.py minesweeper/minesweeper.py raphael/events.py so - please double-check that the kitchensink Menus example works (and minesweeper, and maparea). l.

