UI::WebDialog => set_html => large HTML pages
-
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...
-
@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. -
@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!
-
@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
. -
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
-
@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!
-
No worries. Just keep asking.
Btw, what are you creating?
-
@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...
-
hm... I wonder is there was someone else also working on generating GCodes....
-
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.
-
I think Noel was doing something. I've given him a nudge.
-
Thanks guys for the hints! I got a message from Noel!
Advertisement