On 11/25/2016 04:30 AM, racoon wrote: > Does anyone happen to know how to get a toolbar gui name, e.g. > "Standard", from a toolbar name, e.g. "standard"? > > I tried `ToolbarInfo(name).gui_name` but it just gives an empty string.
The problem is that "ToolbarInfo(name)" just constructs a new instance, with no information other than the name you gave it. > Probably it can be done somehow with `Toolbars::info`? But I don't > know how. I don't know much about the toolbars, so this may or may not work. Here "name" is the thing we are looking for. docstring gui_name; # Get the toolbars Toolbars const & bars = theApp().toolbars(); # Find the one we want Toolbars::Infos::const_iterator it = bars.begin(); Toolbars::Infos::const_iterator en = bars.end(); for (; it != en; ++it) { if (it->name == name) { gui_name = it->gui_name; break; } } # now gui_name should have the right string, unless # we didn't find the name, in which case it is still empty I guess there's some fancy new way to do these iterations, but I can't remember what it is. Richard