onCLI([callback], remove)
Class: SwingUI.
Description:
Registers, unregisters and retrieves event handler that receive STDIN data sent by command line interface (CLI).
Parameters:
| Name | Type | Default | Description |
|---|---|---|---|
|
|
function |
Function to handle the event, |
|
|
|
boolean |
false |
Removed the callback from this event |
Returns:
If called without parameters, an array of registered callbacks is returned; otherwise this instance of SwingUI class is returned.
Type: SwingUI | Array.<function()>
Examples:
Registering an event handler to receive CLI input:
ui.onCLI(e => {console.log(`Received: ${e.data}`);});
