Shiny Language Reference

Language Reference > Traymenu Functions


addtrayitem

addtrayitem(string Item);

 

Synonyms:

addtraymenuitem(string Item);

addtmi(string Item);

 

Appends a new item to the tray menu for the plugin

ADDTRAYITEM appends a new menu item to the tray menu that pops up when a user right clicks the Brass tray icon and selects the plugin from the popup menu. It is usual to only call this statement during the Init handler, as this ensures the tray menu items are added in the right order. The OnTrayMenu handler should test for the the added item text and act accordingly.

Specify "--SEPARATOR--" (case sensitive) to insert a separator into the tray menu.

 

Parameters

Item

The text to use for the menu item. This exact string is used, and is passed to the OnTrayMenu handler if clicked on.

 

Return Value

None

 

Example Code

// Add "My test item" to the traymenu
addtrayitem("My test item");