Tooltips?
-
(this is the second time I typed this as the first time, Sketchucation and my Safari threw up, but that is another post)
Is there a way of adding tooltips to a ruby? The reason why I ask is because I have amassed quite a number of rubies and if I don't use a lot of them regularly I forget what is what.
I don't want to upset anyone, but some of the names given on their rubies well, are confusing to me. Like I said if I use them regularly, then I do know what they are. Some direct examples in my plugins pulldown are: Contour Lines, Contours, and Lsystem.
What I propose is that if I can hover over the plugin ruby name, a tooltip will appear that gives a short description of what the ruby is. Or even the bottom of the screen will tell me what it does, or a text box will appear, something. Is this something that is doable? And if so, is the code easily modified so that a layman such as I can change it to add it?
Thanks for your consideration.
Rick
-
Possible.
The nature of the API encourages Toolbars to have tooltips and status text; but this is often overlooked on menu entries. (Not sure if menu items can use the tooltips, but can use the status text.)
Toolbar items and menu items are really similar, but are often handled differently based on poor examples and habits.
The "correct" way to add items to both toolbars and menus is to use a Command. Since Toolbar items require images, we are forced into using the Command class to populate the Toolbar. But for a menu, it is easier to add the method directly, but at the cost of the status text.
At any rate, all plugin-ins should probably be using Commands to for both Toolbar items and Menu items. The following snippet shows an example of adding the same Command to both a Toolbar and a Menu. To modify existing plugins, you may need to create a new Command. Search the Plugin code for the menu section (typically near the end of the file) and you may need to add code similar to the following:
cmd = UI;;Command.new("Say Hello") { UI.messagebox("Hello!") } cmd.tooltip = "Displays Hello Messagebox" cmd.status_bar_text = "Displays Hello Messagebox" # toolbar commands need images, menu commands do not # cmd.large_icon = 'c;\path\to\image_24x24px.png' # cmd.small_icon = 'c;\path\to\image_16x16px.png' tb = UI;;Toolbar.new("My Toolbar") tb.add_item(cmd) UI.menu("Plugins").add_item(cmd)
-
Did I help, or just confuse you?
Advertisement