On Windows editions pre-v2016, calling this method when the Outliner was expanded would collapse it. This still may be true for the Mac editions.
But since the tray panels were implemented (on Windows) this method will only show or expand the Outliner panel. It will not roll it up (collapse it,) nor close it.
ADD: And there has never been any API method (although weâve requested) to query the UI to get whether the inspectors are open or closed.
Do you already wrap your import method call into an operation, with UI updates disabled to improve performance?
See the second, boolean argument to Model#start_operation.
Apart from that, it seems not possible to hide âinspector windowsâ, only show them. Also it is rather something to avoid if your plugin has side effects affecting other unrelated parts of the program. Would users find it disrupting? Would you be able to restore inspectors exactly like they were, would the inspectorâs state (size, position, focus, inserted text) be exactly restored?
Do not put setup statements like this into an operation.
You should only need to set this up once when your plugin first loads.
# at top of plugin module
@@command_valid ||= MF_UNCHECKED
# among your methods
def command_checked?
@@command_valid == MF_CHECKED
end
def command_toggle
@@command_valid =( command_checked? ? MF_UNCHECKED : MF_CHECKED )
end
# at bottom of plugin in run once block
@@command.set_validation_proc { @@command_valid }
Now you can change the value of @@command_valid variable anytime, without needing to ever touch the proc object again, because the proc just evaluates the value of the variable.
You can also just call a method within the validation proc, and have the method evaluate differently depending on current situation.
BUT, validation procs for toolbar buttons get called alot so put as little into them as needed. Otherwise it can slow the UI redraw down. Validation porcs for menu commands only get evaluated when the menu is displayed, so their speed is not as critical.