Script Problem - HTML
-
It seems it will only show what's between the quotes - it is html syntax but it it won't make it bold.
But anyway if you want control I suggest you make a proper html file and open that in the web dialog. You can then do just about anything!
Chris
-
Other things don't work either . I can't figure out what my error is...
-
I don't think anyone can help unless you are specific.
But as general advice, what is ruby do with ruby, what is html do with html. For example try to avoid writing html with ruby. Then all you have to worry about is making the link - and generally that is pretty straightforward.
-
I second the previous replies.
An HTML file needs a header and footer. It could work without it, but the results are unpredictable. To get reliable result, you must make a properly formatted result - especially if you try to make it work cross platform. As the Internet engine will not recover from malformed markup as the Safari engine does.
-
@unknownuser said:
dlg = UI;;WebDialog.new("Unit Inspector", true, > "ShowUI", 739, 641, 150, 150, true) > dlg.set_html ('<b>What?</b>') > dlg.show
I can't get the HTML to work correctly. Ive tried it without the quotations, but I get this error: 'Unterminated strings meets end of file'
i'm not sure what I'm doing wrong.The minimum is to put a HTML tag. Keep in mind that it is the browser interpreting the code, not Ruby.
So try instead:dlg.set_html "<HTML><b>What?</b></HTML>"
-
Thank you. Now here we go again...
I've noticed some HTML-based input boxes. I know how to create them, but I don't know how to associate the text in the box with a ruby variable. How would I do this?
-
http://code.google.com/apis/sketchup/docs/ourdoc/webdialog.html#add_action_callback
Use the
add_action_callback
method and call a function that sets the arguments to the variables. -
I was pointed to a very good article in sketchupapi.blogspot when I first started to look at web dialogs. It is called "Passing variables .... " or something like that. Try to find it otherwise I'm afraid you will go from pillar to post and end up (wrongly) decrying web dialogs.
-
I'm not sure what one you are thinking of Chris, but this article talks about web dialogs:
Sharing data between SketchUp Ruby and Javascript
Posted by Scott Lininger, SketchUp Software Engineer If you are building rich WebDialogs in your SketchUp Plugin, then you are probably usin...
(sketchupapi.blogspot.com)
I have read it many times, and I still don't quite get some of it. I am discovering I need to rad up on HTML. Its more involved than I ever realized
Chris
-
Oh, and also this little post here, which was the one right before the one I linked to above. I guess Scott had web dialogs on his mind back then.
WebDialog
Posted by Sang Ahn, SketchUp Software Engineer One of the interesting features of SketchUp's Ruby API is the UI::WebDialog class. Since ...
(sketchupapi.blogspot.com)
Chris
-
@chris fullmer said:
I'm not sure what one you are thinking of Chris, but this article talks about web dialogs:
The trouble you see is that I cannot open anything with blog in it (nor you or tube) but the date seems right. Perhaps the other other Chris will let us know if it is useful. As you know I am very keen to interest more people in web dialogs, because, for example, I agree with this chap.
@unknownuser said:
Vic Gundotra, Google Engineering vice president and developer evangelist, told the Mobilebeat conference in San Francisco on Thursday that the web had won and users of mobile phones would get their information and entertainment from browsers in future.
...
“What we clearly see happening is a move to incredibly powerful browsers,” he said.
“Many, many applications can be delivered through the browser and what that does for our costs is stunning.
“We believe the web has won and over the next several years, the browser, for economic reasons almost, will become the platform that matters and certainly that’s where Google is investing.”
Advertisement