Command Tooltip

I don’t know how to set the title of command icon in toolbar.
When I hover the toolbar icon, I got the title and description of the command. But they are the same as the string I set by cmd.tooltip = “tooltip”. I think the title will got the string in cmd.menu_text =. But not.
Could you please help me with this?

toolbar = UI::Toolbar.new "Test"
#This command displays Hello World on the screen when clicked
cmd = UI::Command.new("TestToolTip") { UI.messagebox("Hello World") }
cmd.menu_text = "Menu text"
cmd.tooltip = "tooltip"
toolbar = toolbar.add_item cmd
toolbar.show

Try the following …

toolbar = UI::Toolbar.new "Test"

# This command displays Hello World on the screen when clicked
cmd = UI::Command.new("Menu text") { UI.messagebox("Hello World") }

# Menu text is set by the constructor call's 1st argument.
# So the following is actually not needed:
cmd.menu_text = "Menu text"

# Appears (on Windows, emboldened on top line of toolbar hover popups):
cmd.tooltip = "This is a tooltip."

# Status text appears on status bar ...
# ... (and on Windows, on bottom line of toolbar hover popups):
cmd.status_bar_text= "Testing a UI Command"
# If not set, then it will default to use the tooltip.

toolbar = toolbar.add_item cmd
toolbar.show

I forget what shows on the Mac platform. @slbaumgartner can you enlighten us?

1 Like

Later. Not at my computer now…

On my Mac hover over the toolbar button shows “This is a tooltip.”

1 Like

Thank you very much!
So #tooltip will be the title.
And #status_bar_text will be the content.

1 Like

Yes, but only on Windows. On Mac they have plain-Jane tooltips.
But on both platforms the status text should be displayed on the status bar whilst hovering.

2 Likes