sketchucation logo sketchucation
    • Login
    ℹ️ Licensed Extensions | FredoBatch, ElevationProfile, FredoSketch, LayOps, MatSim and Pic2Shape will require license from Sept 1st More Info

    Webdialog on Mac

    Scheduled Pinned Locked Moved Developers' Forum
    2 Posts 2 Posters 67 Views 2 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • H Offline
      honkinberry
      last edited by

      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

      1 Reply Last reply Reply Quote 0
      • thomthomT Offline
        thomthom
        last edited by

        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

        Thomas Thomassen — SketchUp Monkey & Coding addict
        List of my plugins and link to the CookieWare fund

        1 Reply Last reply Reply Quote 0
        • 1 / 1
        • First post
          Last post
        Buy SketchPlus
        Buy SUbD
        Buy WrapR
        Buy eBook
        Buy Modelur
        Buy Vertex Tools
        Buy SketchCuisine
        Buy FormFonts

        Advertisement