sketchucation logo sketchucation
    • Login
    Oops, your profile's looking a bit empty! To help us tailor your experience, please fill in key details like your SketchUp version, skill level, operating system, and more. Update and save your info on your profile page today!
    🛣️ Road Profile Builder | Generate roads, curbs and pavements easily Download

    WebDialog Question

    Scheduled Pinned Locked Moved Developers' Forum
    5 Posts 3 Posters 212 Views 3 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.
    • J Offline
      jhoutman
      last edited by

      I have found the need to finally use WebDialog to create fairly simple input dialogs for some ruby's I have written. I have been successful (so far) but I have some general house keeping questions.
      I will be calling the same WebDialog repeatedly during the course of a modeling session. Do I just create a new WebDialog the first time and set that to an instance variable? Then after that just 'show'? Does ..close just exit the dialoge although it's instance still there?
      Do I have to worry about "cleaning it up" and setting it to 'nil' ever?
      Depending on user actions my drop down needs to change. Can I just start over by assigning WebDailog.new to the same instance variable as the original?

      I hope these questions aren't to lame.

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

        I've done that for Street Generator. Works fine.

        Not sure about the cleaning up though. Not as far as I know.

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

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

          @jhoutman said:

          Do I just create a new WebDialog the first time and set that to an instance variable? Then after that just 'show'?

          Yes.

          Just leave the dialog open. Let the user minimize/restore as needed.

          Trust Ruby and the OS to garbage collect appropriately.

          If you're not already there, use this little tutorial to get started. Take the first paragraph seriously.

          http://www.martinrinehart.com/models/rubies/ruby2javascript_javascript2ruby.html

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

          1 Reply Last reply Reply Quote 0
          • J Offline
            jhoutman
            last edited by

            Thanks for the response. I have written ruby's. I found the Webdialog rather obtuse but I am getting text, can tell the difference between OK button and Cancel button etc. I am slowly getting there.

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

              @jhoutman said:

              I found the Webdialog rather obtuse ...

              Spoken like a diplomat. Some might put that more strongly.

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

              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