• Login
sketchucation logo sketchucation
  • Login
⚠️ Libfredo 15.4b | Minor release with bugfixes and improvements Update

UI::WebDialog => set_html => large HTML pages

Scheduled Pinned Locked Moved Developers' Forum
12 Posts 3 Posters 1.6k 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.
  • N Offline
    niccah
    last edited by 2 Nov 2012, 20:03

    Heyho!

    I have a simple question...

    I'm using the folowing code:

    html = "<html>..." + someVars + "...</html>" dlg = UI::WebDialog.new("...", true, "...", 600, 200, 50, 50, true); dlg.set_html html dlg.show

    Well, its no a perfect solution, when I use large html codes. So, what do you think, is the best way, to insert a large html page?
    It is possible to include a full html- file? But then, I guess, I can't use some ruby vars in the html code.

    What's your standard solution for that "problem"?

    Thanks for all your help!!

    Wish you a relaxed weekend...

    1 Reply Last reply Reply Quote 0
    • T Offline
      thomthom
      last edited by 3 Nov 2012, 09:16

      @niccah said:

      Well, its no a perfect solution, when I use large html codes. So, what do you think, is the best way, to insert a large html page?
      It is possible to include a full html- file? But then, I guess, I can't use some ruby vars in the html code.

      What's your standard solution for that "problem"?

      It's not really clear to me what the "problem" is. Can you specify?

      @niccah said:

      html = "<html>..." + someVars + "...</html>"

      @niccah said:

      But then, I guess, I can't use some ruby vars in the html code.

      Are you trying to send variables to the webdialog?

      By the way: set_html doesn't work under OSX after an Safari update.

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

      1 Reply Last reply Reply Quote 0
      • N Offline
        niccah
        last edited by 3 Nov 2012, 10:20

        @thomthom said:

        It's not really clear to me what the "problem" is. Can you specify?

        Oh sorry... okay, let me explain the "problem" a little bit more in detail...

        I have a plugin for Sketchup and I need a formular, where I can set a lot of options. So, I'm using a WebDialog and the content is written in a string.

        • advantage: I can insert some ruby variables (for example: "<input type="text" value="" + rubyVariable + """
        • disadvantage: The Webdialog gets larger and larger, so the string gets larger and larger => the code gets unclear.

        Now, my question is: can I write all the html code in an external file? So, normal text file, I can import with "File.open...". But then, I can't use some ruby variables in the html code.

        So, for me (a more or less Ruby newby), it is not clear what's the best way to handle large WebDialogs.

        @thomthom said:

        By the way: set_html doesn't work under OSX after an Safari update.

        Oh, that's an important hint... how I can handle this problem? Thanks a lot, ThomThom for your help!

        1 Reply Last reply Reply Quote 0
        • T Offline
          thomthom
          last edited by 3 Nov 2012, 12:41

          @niccah said:

          Now, my question is: can I write all the html code in an external file? So, normal text file, I can import with "File.open...". But then, I can't use some ruby variables in the html code.

          Don't understand what you mean by not being able to use ruby variables...
          If you compile a string with HTML and injected ruby variables, and use #set_html it's the same as if you wrote the same HTML to a file and used #set_file. I'm still not quite "getting it". 😕

          @niccah said:

          Oh, that's an important hint... how I can handle this problem? Thanks a lot, ThomThom for your help!

          Write out a temp file with the compiled HTML, then use #set_file.

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

          1 Reply Last reply Reply Quote 0
          • T Offline
            thomthom
            last edited by 3 Nov 2012, 12:45

            If you're new to WebDialogs in SketchUp you want to have a look at this thread: http://sketchucation.com/forums/viewtopic.php?f=180&t=23445#p198883

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

            1 Reply Last reply Reply Quote 0
            • N Offline
              niccah
              last edited by 6 Nov 2012, 19:43

              @thomthom said:

              If you're new to WebDialogs in SketchUp you want to have a look at this thread: http://sketchucation.com/forums/viewtopic.php?f=180&t=23445#p198883

              Oh, that was the perfect hint. You are right, I'm realy new to WebDialogs. So I read a lot the last few days and now, I know, my question was stupid 😄

              However, thanks for your endurance!

              1 Reply Last reply Reply Quote 0
              • T Offline
                thomthom
                last edited by 6 Nov 2012, 20:19

                No worries. Just keep asking.

                Btw, what are you creating?

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

                1 Reply Last reply Reply Quote 0
                • N Offline
                  niccah
                  last edited by 7 Nov 2012, 18:41

                  @thomthom said:

                  Btw, what are you creating?

                  Oh, I started a big big project...

                  On the one hand I love to play with my milling machine, on the other hand, I'm very interested to learn to write some Sketchup plugins.

                  So my project:

                  You can select some faces of your model, enter some dimensions of your milling tool and you get the right GCode. Now, I'm coding the userinterface of this plugin.

                  I hope, I can publish first beta versions in the next fex month...

                  1 Reply Last reply Reply Quote 0
                  • T Offline
                    thomthom
                    last edited by 7 Nov 2012, 18:56

                    hm... I wonder is there was someone else also working on generating GCodes....

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

                    1 Reply Last reply Reply Quote 0
                    • Chris FullmerC Offline
                      Chris Fullmer
                      last edited by 7 Nov 2012, 21:28

                      gcode site:sketchucation.com/forums/

                      There have been people talking about it in the past. I did not read any of those threads to see if anyone has some good code or a plugin for it. But there might be something there.

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

                      1 Reply Last reply Reply Quote 0
                      • T Offline
                        thomthom
                        last edited by 7 Nov 2012, 22:14

                        I think Noel was doing something. I've given him a nudge.

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

                        1 Reply Last reply Reply Quote 0
                        • N Offline
                          niccah
                          last edited by 8 Nov 2012, 10:16

                          Thanks guys for the hints! I got a message from Noel!

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

                          Advertisement