How to close a Toolbar since "toolbar.hide" doesn't work?

I’m new on Ruby Sketchup… I’m trying to close a Toolbar with a command, but the “toolbar.hide” doesn’t work, is there a way to do it ?

How did you get a reference to the toolbar and how did you try to hide it?

Do you hide it immediately after creating it (like in the example) or is the reference older (save in a module/class/global variable)?

ObjectSpace.each_object(UI::Toolbar) { |tb| (tb.hide) if == '<your toolbar name>' }


1 Like

That work perfectly. Thank you very much

It’s save on a class.