Your browser does not seem to support JavaScript. As a result, your viewing experience will be diminished, and you have been placed in read-only mode.
Please download a browser that supports JavaScript, or enable it if it's disabled (i.e. NoScript).
add_item can not only accept a string and a proc, but a command as well.
def hello UI.messagebox("Hi!") end cmd = UI;;Command.new("Say Hello") { hello } UI.menu("Plugins").add_item( cmd )
This let's you create a single command that can be used in both a menu and toolbar.
Advertisement