You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This example shows how to implement an IMenuItem plugin interface that interacts with Editor graphical user interface.
Since the OpenTAP interfaces are .NET interfaces they have to be implemented by registering the methods and properties that are required by that interface.
The IMenuItem interface has the following specification:
public interface IMenuItem : ITapPlugin
{
void Invoke();
}
The interface requires one method to be implemented, Invoke, invoke takes no arguments so implementing it is quite simple. It also requires that a DisplayAttribute is used to show the name and group of the menu item.
When used correctly, the menu item can be seen in the Editor menubar.
"""
loadMenuItem=False
ifloadMenuItem:
importOpenTap
importopentap
fromopentapimport*
importSystem
clr.AddReference("Keysight.OpenTap.Wpf")
importKeysight.OpenTap.Wpf
fromKeysight.OpenTap.WpfimportIMenuItem
# Put 'Python Menu Item' on the button and place it in the Python menu.