Show webdialog quicker?
-
chris, is it meant to work on macs?
-
ok, even a little cleaner. This way I can use set_file to set a file to point to, instead of an html string.
splash_path = File.join( Install.base_path, "assets", "splash.html") @@splash_wd = UI;;WebDialog.new("MultiFlux", true, "multiflux_splash", 800, 600, 200, 200, true); @@splash_wd.set_file splash_path UI.start_timer(0.1, false){@@splash_wd.show;} UI.start_timer(3, false){@@splash_wd.close}
It is just the
webdlg.show
that needs to inside theUI.start_timer
procedure. Now it all loads and displays as desired. -
At this point, no unfortunately. It is not a Mac plugin. HOWEVER, I'm trying hard to mac it close to MAC friendly so we can get it up and running on Mac's someday.
Are all the methods I've used so far Mac friendly?
-
@chris fullmer said:
Are all the methods I've used so far Mac friendly?
If you want the WebDialog to stay on top of the SketchUp window you want to use .show_modal under OSX. Under OSX that method doesn't produce a modal window like under Windows.
-
and .set_html has a problem with local files... john
-
Oh, ok. I'll put in the set_modal for future use. And I'll stick with my .set_file method then. Its cleaner in my ruby code and there is no reason at this point to load the html as a string.
Thanks guys!,
Chris
-
it all works on the mac with set file.
-
@chris fullmer said:
Oh, ok. I'll put in the set_modal for future use.
But not on PC...
splash_path = File.join( Install.base_path, "assets", "splash.html") @@splash_wd = UI;;WebDialog.new("MultiFlux", true, "multiflux_splash", 800, 600, 200, 200, true); @@splash_wd.set_file splash_path UI.start_timer(0.1, false){ RUBY_PLATFORM =~ /(darwin)/ ? @@splash_wd.show_modal() ; @@splash_wd.show(); } UI.start_timer(3, false){@@splash_wd.close}
-
Interesting, I would have just put it as modal for both. Modal just means it stays on top of all windows?
-
@chris fullmer said:
Interesting, I would have just put it as modal for both. Modal just means it stays on top of all windows?
No - in the Windows world it means that the child window blocks any interaction in the parent window while it is open. It also means that .show_modal doesn't return until the webdialog is closed. (Like UI.inputbox - where you continue with the code after you prompted the user.)
But it's under OSX where the scheme suddenly change. Not use if it's a platform quick, or just an SU OSX quirk, but suddenly the window does not stay on top when using .show and .show_modal means "stay on top of parent" instead of actually being modal. It's an annoying difference as the behaviour displayed under OSX does not correspond to what the method name implies.
Advertisement