Hide/show a WebDialog
-
I want to toggle hidden and showing. My keycuts duo fakes this behavior by closing/relaunching the dialog. I'd like to do it for real.
Did I overlook a direct, simple way of doing this?
In Ruby, hiding is almost direct: shrink to a small size and then position off screen. But showing? That requires knowing size and position, which the docs show as properties to set, not query.
Do I have to ask JavaScript for location data (and overcome MSIE/standards incompatibilities) that I then can use in Ruby?
-
Can you close it
@my_webdialog.close
and then later show the same one that was already closed?
@my_webdialog.show
Does that work? Or does close kill the web dialoog object?
Chris
-
It doesn't kill the WebDialog object, but it kills the HTML content.
-
.
I guess the only thing to do is move it off screen.WebDialog.set_position(3000,3000)
..or whatever X,Y works for you
-
@dan rathbun said:
.
I guess the only thing to do is move it off screen.WebDialog.set_position(3000,3000)
I'd actually used:
wd.set_size 10, 10 wd.set_position -100, -100
That works great, but how to get it back? Correctly you'd set size and position back to the way they were. API doesn't have methods for reading these.
-
Not sure about the position, but for the size I'd think you can query the HTML document for the viewport size.
On Windows you could probably query the Windows API, but I'm not sure how you'd do that on Mac. Any Mac programmers around?
-
On OSX - the window is actually just hidden. The embedded WebBrowser object is created as you add the HTML to the WebDialog object - as oppose on PX, where it's rebuilt on evvery .show....
Advertisement