Webdialog on Mac
-
Before I completely go insane here, I just want to confirm what I have read in other posts and tutorials and such.
That is, when I call a WebDialog.show_modal on Mac, it is not modal at all, correct? But totally and completely modeless, right?
I ask as, I'm getting to a few of my helper functions, and I need to confirm this before going crazy.
Is there any tricks or tips you guys have amassed?In particular, as an example, I have functions named newProject() and selectProject(), allowing a user to create or select a project. And they tend to be embedded in code like so:
if (!$project_number)
selectProject()
end # if
...other stuff ....Now if the web dialog that selectProject is displaying is completely modeless, that throws everything off.
This is catastrophically nonsense as far as I'm concerned, and as impossible to work with as if calling UI.inputbox were modeless -- I need to be able to have a function to collect user input, and yes, maybe using a dialog box to do so, and rest assured that the procedure is done inline and synchronously.
Right? Am I just missing something? Please?Many thanks again for all your help.
--J
-
It's not modal, no. It makes the window stay on top of the SketchUp windw (which is what Windows does in all cases.)
For my CleanUp plugin I worked around it by creating a tool where I hooked up the deactivate event to close the dialog. That also captures the mouse events so users can't click randomly in the model and change it while the tool and dialog is active. On SU8+ I also draw a semi-transparent polygon over the whole viewport to dim it.
Source code for the tool wrapper is here: https://bitbucket.org/thomthom/tt-library-2/src/5ec87b0647c953c397b605922f31d5dbe21ad548/TT_Lib2/modal_wrapper.rb?at=Version%202.7.0
Advertisement