I would like to be able to display a floating window that shows key information about my script. Things like project name, values of some parameters, etc… My script generates different versions of the original Skethcup file in an hierarchy. The info displayed by the window would allow me to understand at a glance where I am in the hierarchy.
Can you please direct me to the correct way to do this? I guess I will have to use webDialog and Javascript, but I wanted to check first
OK Thanks. I managed to create my first WebDialog and create a basic table (This will contain my project info). Please consider that I am completely new to HTML. I have been reading quite a bit but I am still struggling to achieve what I need.
Another tip:
On PCs wd.show() is needed to let you still work while the dialog is in front of the main dialog. show_modal keeps it always in front but stops you working in SketchUp.
BUT on a MAC the ‘show’ dialog will move behind the SketchUp window when you click on something.
On a MAC you need to use show_modal to keep it in front BUT on a MAC you can still work in the SketchUp window…
Test for different OSs using something like this:
if (RUBY_PLATFORM.downcase =~ /mswin|mingw/) != nil ### PC
MAC=false
else #MAC
MAC=true
end
You didn’t mention whether your html was static or whether the info in the WebDialog would change after it was displayed.
If it is static, and if the info won’t change, there’s another method you can use, which is to use the set_html method of WebDialogs. You don’t need a separate file for the html. This concept can also be used (with some javascript) to replace the UI::messagebox.