-
Notifications
You must be signed in to change notification settings - Fork 1
Menu item types
You are giving your user a set of options to choose from. In this page we explain how those options are executed. All those options, more precisely referred to as "menu items", are objects that implement the IMenuItem interface. You can of course create your own class implementing that interface should none of the already available classes suit your needs, but the idea is that the library offers enough implementations of the interface so that most of the use cases are covered.
This item executes a function or method that takes no arguments. For simplicity, it is recommended that you use the createSimpleMenuItem function to create instances of this class:
IMenuItem lambdaMenuItem = createSimpleMenuItem("lambdaMenuItem", {writeln("Hello from lambda!");}
class MyClass
{
public void myMethod()
{
writeln("Hello from class method!");
}
}
MyClass foo = new MyClass();
IMenuItem methodMenuItem = createSimpleMenuItem("methodMenuItem", &foo.myMethod);When your user selects these items in a menu, their passed functions or methods will be called.