You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What is currently the preferred way to show a toolbar, an how has this changed?
When I first started writing extensions I was recommended to use the following code:
UI.start_timer(0.1, false){ tb.restore }#Use timer as workaround for bug 2902434.
I think the bug ID refers to an internal issue tracker that I don't have access to.
Some examples, including the current API docs show show being called on the Toolbar, but if I'm not mistaking this would make the toolbar show even if the user has chosen to hide it, and prefer to access the plugin using the menu or shortcuts.
The plugin I work on now relies on get_last_state like so, but maybe calling restore has the same effect:
What approach is considered the preferred? The desired behavior is to have the toolbar show after plugin install (so the user knows it exists) and then keep whatever visibility state the user has chosen.
The text was updated successfully, but these errors were encountered:
Seems like .show currently have the same. Somewhat unexpectedly... I'd still recommend preferring .restore as expected API contract fits best with expected user behaviour. More details at SketchUp/rubocop-sketchup#82 (comment)
What is currently the preferred way to show a toolbar, an how has this changed?
When I first started writing extensions I was recommended to use the following code:
I think the bug ID refers to an internal issue tracker that I don't have access to.
Some examples, including the current API docs show
show
being called on the Toolbar, but if I'm not mistaking this would make the toolbar show even if the user has chosen to hide it, and prefer to access the plugin using the menu or shortcuts.The plugin I work on now relies on get_last_state like so, but maybe calling restore has the same effect:
What approach is considered the preferred? The desired behavior is to have the toolbar show after plugin install (so the user knows it exists) and then keep whatever visibility state the user has chosen.
The text was updated successfully, but these errors were encountered: