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

    WxWindows for SketchUp Dialogs

    Scheduled Pinned Locked Moved Developers' Forum
    45 Posts 17 Posters 7.0k Views 17 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
      Malkomitch
      last edited by

      @unknownuser said:

      Have you used the WxFormBuilder? It would be nice to have a straight output compatible with WxSU! There is a beta which works with Python.

      Tomasz

      or you can export your design to a xrc file (xml style) and load it with xml methods from the Wx module.

      xml = Wx::XmlResource.get
      xml.load(your_file.xrc)

      (google for "xrcise", this utility write for you the code needed to load your xrc)

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

        @unknownuser said:

        I would appreciate any help with solving this strange bugsplat which appears instead of a simple ruby error message in the console.
        It happens after triggering an 'evt_button'.

        It looks like WxSU doesn't handle errors communication between WxRuby and Sketchup.

        The best way to get rid of bugsplats is to handle exceptions by yourself, at the end of each method that uses WxSU:
        That way, you display the call stack, letting you know where the bug is.

        
        rescue => detail
           puts detail.message
           puts detail.backtrace.join("\n")
        
        
        1 Reply Last reply Reply Quote 0
        • T Offline
          tomasz
          last edited by

          @malkomitch said:

          The best way to get rid of bugsplats is to handle exceptions by yourself, at the end of each method that uses WxSU:
          That way, you display the call stack, letting you know where the bug is.

          Thanks a lot for your help.
          I get a bugsplat when closing SU, but it is definitely better this way.
          I though that begin ... rescue ... end is required, but I am glad to hear that rescue alone is sufficient.

          Writing about xml loading I must say that I prefer to write my own Ruby code based on 'initial' FormBuilder layout, as it helps me better understand WxRuby. Thanks for hint anyway!

          Tomasz

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

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

            @unknownuser said:

            I thought that begin ... rescue ... end is required, but I am glad to hear that rescue alone is sufficient.

            That is because in module definitions, the module statement is a block statement so the word module works the same as begin (after all, the module does need an end.)

            
            module My_Module
              # method defs
              # code goes here
            rescue
              # error handling code
            else
              # only do code if no exceptions
            ensure
              # always do this code on exit
            end # the end of the method def
            
            

            The same is true for method definitions, where the def keyword 'begins' the block.

            
            def my_method
              # code goes here
            rescue
              # error handling code
            else
              # only do code if no exceptions
            ensure
              # always do this code
            end # the end of the module
            
            

            I'm not here much anymore.

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

              @dan rathbun said:

              That is because in module definitions, the module statement is a block statement so the word module works the same as begin (after all, the module does need an end.)

              Thanks for the explanation.

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

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

              Advertisement