WebDialog on Mac - problems with height
-
Hey folks,
I don't use Sketchup on Mac, but Burkhard told me problems concerning WebDialogs in Sketchup for Mac. We have written a very simple HTML page, which correctly displays in Sketchup for Windows. But for Mac the content does not seem to use the whole hight of the window. Any ideas?
<html> <head> <title>TITLE</title> </head> <body link="#00ff00" alink="#00ff00" vlink="#00ff00" style="border;none; margin;0; padding;0; background-color;#000; color;#0f0; font-family;Courier"> <div style="border;none; margin;0; padding;0;width;100%;text-align;center"> <h1 style="border;none; margin;0; padding;0"> <span style="font-variant;small-caps;font-weight;bolder">...</span> </h1> <h2><span style="font-variant;small-caps;font-weight;bolder">Version</span></h2> <!-- VERSION //--> <hr width="50%" noshade="noshade" style="color;#0f0;background-color;#0f0; height;1px"> <h2><span style="font-variant;small-caps;font-weight;bolder">Credits</span></h2> Foo Bar, <a href="http://errorinitus.de/" target="_blank">error initus</a> </div> </body> </html>
azuby
-
If I wasn't so lazy, I would:
- cut and paste your html into a file on my computer and save it in a folder that was convenient for a ruby script to point to
- create a new webdialog ruby script and use your example html to observe it's behavior.
But, as it is, I'm lazy.
If you want to create some Ruby console command sequences or post a webdialog shell, I'll be happy to run it for you.
Todd
-
Download the attached file, put it into your Plugins / Tools folder, run Sketchup, type "zzz_show" (without the "") into the Ruby Console. And please tell me, whether you ran it on Mac or Windows and whether the whole hight of the window is used (should be black). Thanks a lot!
azuby
-
It (the whole dialog) BARELY even shows up on the screen. It's like it's taking up a pixel.
I can look more into this later tonight. Mac / Tiger.
Thanks for putting the "lazy man" package together!
Todd
-
A couple things.
First, and most importantly, your screen coords and dialog size were reversed. It was showing up as a 10 x 10 pixel web page.
Second, I added several semi-colons in your inline styles. Safari is pretty intolerant of loose inline styles. It now shows up correct.
Finally, on a mac, set the last parm to true in the WebDialog.new line or you'll have issues.
Todd
def zzz_show d = UI;;WebDialog.new "ZZZ", false, nil, 640, 480, 10, 10, true s = <<-HTML <html> <head> <title>TITLE</title> </head> <body link="#00ff00" alink="#00ff00" vlink="#00ff00" style="border;none; margin;0; padding;0; background-color;#000; color;#0f0; font-family;Courier;"> <div style="border;none; margin;0; padding;0;width;100%;text-align;center;"> <h1 style="border;none; margin;0; padding;0;"> <span style="font-variant;small-caps;font-weight;bolder;">...</span> </h1> <h2><span style="font-variant;small-caps;font-weight;bolder;">Version</span></h2> <!-- VERSION //--> <hr width="50%" noshade="noshade" style="color;#0f0;background-color;#0f0; height;1px;"> <h2><span style="font-variant;small-caps;font-weight;bolder;">Credits</span></h2> Foo Bar, <a href="http://errorinitus.de/" target="_blank">error initus</a> </div> </body> </html> HTML d.set_html s d.show() end
-
Oh my god, the CSS things feel like Python ^^, anyway, thanks. And for the wrong initialization, well - I looked into the documentation, which confuses me (a bit) - have a look on your own for the described syntax for the WebDialog constructor:
http://download.sketchup.com/OnlineDoc/gsu6_ruby/Docs/ruby-webdialog.html
Next time I should scroll down a bit more But at the end I can't imagine, why a parameter called "resizable" resizes the content of the window if set to false. Seems to be one of the big mysteries of Sketchup ...azuby
-
Yes, that doc is wrong. This doc is better: http://groups.google.com/group/SketchUp-Plugins-Dev?hl=en
Todd
-
Todd, while you're on the subject, some of those pages' links have the the word 'edit' in the url, presumably a link for owners to edit the page. For the rest of us, it just produces an error. See the WebDialog page as an example. I believe instead of edit, it should be 'web'
-
Yes, I've seen that too. Thanks for the reminder.
Advertisement