Hi Guys,
If I do something like this on a components mouseReleased event handler I get what I expect (a popup menu when the component is right clicked):
def function1():
passdef rightClickPopup(component):
menu = system.gui.createPopupMenu(["Item1"], [function1])
menu.show(event)rightClickPopup(event.source)
I would like to move this to a shared script named myfuncs:
def function1():
passdef rightClickPopup(component):
menu = system.gui.createPopupMenu(["Item1"], [function1])
menu.show(event)
When a call the function on a mouseReleased event handler on a component like this:
shared.myfuncs.rightClickPopup(event.source)
I get this error:
Traceback (most recent call last):
File "event:mouseReleased", line 1, in
File "module:shared.myfuncs", line 19, in rightClickPopup
NameError: global name 'event' is not defined
Ignition v7.9.9 (b2018081621)
Java: Oracle Corporation 1.8.0_171
Any help would be much appreciated.