How to get a toolbar to appear on first load of a plugin?

The timer thing is an artifact of old obsolete versions of SU. I couldn’t even find a version that demonstrated what the code comment suggest it’s trying to address. I’d not use that any more.

In general I’d recommend that you use toolbar.restore - as it have the appropriate checks to only show the toolbar if the user haven’t explicitly hidden it. (And it will show it by default). so there is no need for get_last_state when using that.

Now, oddly enough, toolbar.show behave exactly the same as toolbar.restore in SU2018. Though I find that the be unexpected behaviour. I’m pretty sure that didn’t always behave like that. (I’ll have to do some more tests on older versions.)

But the short story is; use toolbar.restore and let SketchUp deal with the state of the toolbar.

3 Likes