It might be possible to cook something up to create a new toolbar and add items to if via the SDK as long as you could figure out when you need to add this toolbar.
This would be very interesting to add, update and delete toolbarbuttons. But the only question is⌠How do you know which button is which one? What position will they take and will it show an icon with text, only 1 or both?
I wonder if we could still have the toolbars and buttons in an RUI file, but allow developers to show specific toolbars.
How would a customer override the developer and say âstop popping up this toolbar - I donât want it!â
â
Brian Gillespie
Any advance for V6 ?
An Rhi that replaces my plug-in toolbar would be good.
thx,
This article discusses how to re-stage a plug-in RUI file.
â Dale
Hi Dale,
Actually, this article seems to be wrong.
If we delete the rui in %APPDATA% (either manually or programatically), and start Rhino, it recreates it, but not by copying the newer myplugin.rui which is stored with the myplugin.rhp. Instead, it extracts the toolbar data from the userâs default.rui for recreating the file.
That way, the plugin toolbar never gets updated. You need to manually remove it inside default.rui AND delete the %APPDATA% .rui file before you start Rhino in order to update the toolbar.
This is extremely cumbersome for plugin users. They just expect the toolbar to be updated with the plugin, especially if we add buttons for new functions.
Hi @galinette,
If part of a custom toolbar is copied into another .rui file, such as default.rui
, it becomes part of that .rui file. Replacing the source .rui file will not change what got copied into default.rui
.
For example:
- A file
test.rui
containing toolbarMyTestToolbar
. - Drag toolbar
MyTestToolbar
into the standard toolbar group indefault.rui
. - Close
test.rui
. - The toolbar
MyTestToolbar
is still indefault.rui
, as it was copied there when it was dragged into the Standard toolbar group. It must be deleted fromdefault.rui
to make it go away.
Does this help?
â Dale
Hi Dale,
This makes sense, but why is the toolbar copied to default.rui automatically by Rhino?
The .rui is installed along with the .rhp file, and they have the same name. Thatâs all we do. Then in the âShow Toolbarâ context menu action, we activate it.
The toolbar is then always copied automatically to default.rui. If we uninstall the plugin, it stays there. And if we reinstall the plugin, a duplicate toolbar is created. At the end there are many junk toolbars in default.rui and the user has to remove them by hand. Thatâs a terrible user experience.
Is there something wrong we do that causes the copy to default.rui?
Hi @galinette,
Toolbar provided by plug-in .rui files are not copied to default.rui
automatically.
â Dale
Hi dale,
We found out the issue. At program startup, the toolbar was loaded but not shown. Then we right clicked on the tabs and did âShow or hide tabsâ, then selected our toolbar at the end. This does copy the toolbar tab to default.rui
On the other hand, doing âShow Toolbarâ does show the toolbar without copying it to default.rui
While there is a logic behind this, this is certainly not very intuitive. Sooner or later users will use the âShow tabâ feature, and when the plugin will be upgraded they will complain that the toolbar is not updated.
Etienne