I’m trying to use the new windows plugin for a pop up menu. I’m following the example code pretty much exactly and the popup works fine but there is this annoying warning that I don’t understand. My code is this:
function onActionShowChoices(event) {
var popupmenu = plugins.window.createPopupMenu()
var menuitem0 = popupmenu.addMenuItem('View By Sample Names',RunFunctionToView)
var menuitem1 = popupmenu.addMenuItem('View By Human Names',RunFunctionToView)
var menuitem2 = popupmenu.addMenuItem('View By Medrec',RunFunctionToView)
var menuitem3 = popupmenu.addMenuItem('View By Sampleid',RunFunctionToView)
var source = event.getSource()
if (source != null)
{
popupmenu.show(source);
}
}
Runs fine but for the line ‘var source = event.getSource()’ I get this warning:
Variable source hides a property
And for the line ‘popupmenu.show(source);’ I get this:
The method show(RuntimeComponent,Number,Number) in the type Popup is not applicable for the arguments (Object)
If I change the variable name from ‘source’ to something else then the first warning goes away but not the second. I don’t understand what those warnings mean. And even though the function works perfectly, it offends my sense of symmetry to have those warnings come up! Can anyone enlighten me as to what they mean and how to fix them? I think I followed the example code exactly.