Shiny Language Reference

Language Reference > Traymenu Functions


changetrayitem

changetrayitem(string Item, string Replace);

 

Synonyms:

changetraymenuitem(string Item, string Replace);

changetmi(string Item, string Replace);

 

Changes an item in the tray menu for the plugin

CHANGETRAYITEM changes the text of a menu item in the tray menu that pops up when a user right clicks the Brass tray icon and selects the plugin from the popup menu. This statement is normally used to toggle menu options based on a condition within the plugin. The changed item retains it's position in the menu. The OnTrayMenu handler should respond to the replacement string and act accordingly.

Parameters

Item

The text to search for in the menu item list and change.

Replace

The new text for the item.

Return Value

None

 

Example Code

// Change "My item ON" to "My item OFF"
changetrayitem("My item ON", "My item OFF");