fleawig
December 22, 2021, 8:16pm
1
Does anyone know how to perform the equivalent of Sketchup.focus
(which focuses the active model window) without using that call? It’s only available in the API since version 2021.1, and I’m looking for a way to do the same thing—focus a model window—for an extension that supports some earlier versions. Thanks!
This has been discussed numerous times here. Please search the developer categories.
fleawig
December 22, 2021, 8:18pm
3
Thanks—I swear I did! Will look again.
Well the major thread where we discussed all the hacks was this …
Hello,
I have a UI::WebDialog. How can I set the focus on Sketchup MainWindow with a mouse click on a button in my WebDialog without closing the WebDialog?
Other forum topics are listed for both this forum and SketchUcation in the now closed issue:
opened 03:14PM - 05 Jun 20 UTC
closed 11:09AM - 10 Jun 21 UTC
enhancement
Ruby API
SketchUp
ui
fixed-SU2021.1
#### SketchUp Live API Feature Request (C and Ruby)
`Sketchup` module method … to return focus to the modeling window.
This has already been requested for like 10 years or more. And we still do not have it!
I'm opening this as a public issue so other coders can add their comments.
We should not need to do dirty hacks like opening a tiny temporary webdialog off screen and then closing it, in order to return input focus back to the application window from a **non-modal** child window such as a web dialog.
----
_REF SKETCHUP FORUM TOPICS:_
[How to set Focus to Mainwindow](https://forums.sketchup.com/t/how-to-set-focus-to-mainwindow/12383) (JUN 2015)
[Create HtmlDialog with clickable thumbnails](https://forums.sketchup.com/t/create-htmldialog-with-clickable-thumbnails/47113) (JUN 2017)
[Focus event on window object from CEF HtmlDialog Javascript?](https://forums.sketchup.com/t/focus-event-on-window-object-from-cef-htmldialog-javascript/115945) (FEB 2020)
[How to access existing toolbars and call existing commands?](https://forums.sketchup.com/t/how-to-access-existing-toolbars-and-call-existing-commands/119388) (MAR 2020)
[Can HtmlDialog yield focus to SketchUp view?](https://forums.sketchup.com/t/can-htmldialog-yield-focus-to-sketchup-view/123696) (APR 2020)
----
_REF SKETCHUCATION FORUM TOPICS:_
[Shift WebDialog Focus to SU?](http://sketchucation.com/forums/viewtopic.php?f=180&t=19167) (MAY 2009)
[X-Mouse Window Focus for Mac OSX ??](http://sketchucation.com/forums/viewtopic.php?f=180&t=33715) (DEC 2010)
[Losing focus on window](http://sketchucation.com/forums/viewtopic.php?f=180&t=48779) (NOV 2012)
There are also both open and closed bug issues re: “focus” in the API Issue Tracker …
1 Like
fleawig
December 22, 2021, 8:29pm
5
Thanks! This is better than what I was starting to find.