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!
    🫛 Lightbeans Update | Metallic and Roughness auto-applied in SketchUp 2025+ Download

    Web Dialog bug?

    Scheduled Pinned Locked Moved Developers' Forum
    5 Posts 4 Posters 295 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.
    • B Offline
      Brett McAllister
      last edited by

      Hi there

      Currently I am creating some web dialogs and having some real issues with stability.
      For no reason at all the dialog will just shut and what ever I have been working on will be lost.
      Have any of you guys had this issue or is it just me?
      Any help would be appreciated. I am using Sketchup 7
      Cheers

      Brett

      1 Reply Last reply Reply Quote 0
      • T Offline
        tomasz
        last edited by

        One have to be careful especially when using a Tool and a Webdialog (and Observers).
        I think you crash SU because your tool closes a WebDialog already closed or something similar. It can also be caused by creating several instances of a same WebDialog without closing former.

        In a thread called Tool <> WebDialog <> Observers relationship I have started to build a 'proper' way of creating a Tool, WebDialog and an Observer. It is far from perfect. I am still learning how to make it error-proof.

        Author of [Thea Render for SketchUp](http://www.thearender.com/sketchup)

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

          Brett,

          It sounds like Ruby is garbage collecting the dialog - I've had this happen. If you are using a local variable to reference the dialog and the variable goes out of scope, it will be GC'd.

          
          # This dlg variable will get GC'd sooner or later and the
          # dialog may go away.
          def create_dialog
              dlg = WebDialog.new(...)
              dlg.show
          end
          
          

          One common solution is to use a module to create a namespace (a scope,) and use a class variable to reference the dialog.

          Hi

          1 Reply Last reply Reply Quote 0
          • B Offline
            Brett McAllister
            last edited by

            Thanks for the replies.
            The only ruby code I am using is just to load the dialog to test it so there is no namespacing etc.
            Sounds like that will solve the problem,so I will keep that in mind as I get further along.

            Cheers
            Brett

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

              @brett mcallister said:

              Thanks for the replies.
              The only ruby code I am using is just to load the dialog to test it so there is no namespacing etc.
              Sounds like that will solve the problem,so I will keep that in mind as I get further along.

              Cheers
              Brett

              Failure to include two parameters in the code block of an action callback is a crime punishable by BugSplat.

              PC or Mac?

              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