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

    Hide/show a WebDialog

    Scheduled Pinned Locked Moved Developers' Forum
    7 Posts 4 Posters 349 Views 4 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.
    • M Offline
      MartinRinehart
      last edited by

      I want to toggle hidden and showing. My keycuts duo fakes this behavior by closing/relaunching the dialog. I'd like to do it for real.

      Did I overlook a direct, simple way of doing this?

      In Ruby, hiding is almost direct: shrink to a small size and then position off screen. But showing? That requires knowing size and position, which the docs show as properties to set, not query.

      Do I have to ask JavaScript for location data (and overcome MSIE/standards incompatibilities) that I then can use in Ruby?

      Author, Edges to Rubies - The Complete SketchUp Tutorial at http://www.MartinRinehart.com/models/tutorial.

      1 Reply Last reply Reply Quote 0
      • Chris FullmerC Offline
        Chris Fullmer
        last edited by

        Can you close it

        @my_webdialog.close

        and then later show the same one that was already closed?

        @my_webdialog.show

        Does that work? Or does close kill the web dialoog object?

        Chris

        Lately you've been tan, suspicious for the winter.
        All my Plugins I've written

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

          It doesn't kill the WebDialog object, but it kills the HTML content.

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

          1 Reply Last reply Reply Quote 0
          • Dan RathbunD Offline
            Dan Rathbun
            last edited by

            .
            I guess the only thing to do is move it off screen.

            WebDialog.set_position(3000,3000)
            

            ..or whatever X,Y works for you

            I'm not here much anymore.

            1 Reply Last reply Reply Quote 0
            • M Offline
              MartinRinehart
              last edited by

              @dan rathbun said:

              .
              I guess the only thing to do is move it off screen.

              WebDialog.set_position(3000,3000)
              

              I'd actually used:

              
              wd.set_size 10, 10
              wd.set_position -100, -100
              
              

              That works great, but how to get it back? Correctly you'd set size and position back to the way they were. API doesn't have methods for reading these.

              Author, Edges to Rubies - The Complete SketchUp Tutorial at http://www.MartinRinehart.com/models/tutorial.

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

                Not sure about the position, but for the size I'd think you can query the HTML document for the viewport size.

                On Windows you could probably query the Windows API, but I'm not sure how you'd do that on Mac. Any Mac programmers around?

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

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

                  On OSX - the window is actually just hidden. The embedded WebBrowser object is created as you add the HTML to the WebDialog object - as oppose on PX, where it's rebuilt on evvery .show....

                  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