7 messages in com.googlegroups.sketchuprubyRe: WebDialog callbacks not working w...
FromSent OnAttachments
Greg Ewing22 Feb 2008 03:43 
Todd Burch - Katy, Texas22 Feb 2008 05:21 
JimF22 Feb 2008 06:17 
Greg Ewing23 Feb 2008 23:07 
Todd Burch - Katy, Texas24 Feb 2008 05:31 
Greg Ewing25 Feb 2008 03:36 
Todd Burch - Katy, Texas25 Feb 2008 05:31 
Subject:Re: WebDialog callbacks not working when set_html() used instead of set_file()
From:Todd Burch - Katy, Texas (mr.t@gmail.com)
Date:02/22/2008 05:21:51 AM
List:com.googlegroups.sketchupruby

Are you on a mac?

On Feb 22, 5:43 am, Greg Ewing <greg@canterbury.ac.nz> wrote:

The following script is supposed to invoke a callback when the button is pressed. When I load the HTML from a string using the set_html() methid, the form is displayed, but the callback doesn't get fired.

If I put exactly the same HTML in a file and use the set_file() method instead, the callback works fine.

Anyone have any ideas what might be wrong?

HTML = <<-END <html>         <body>                 <input onClick="window.location='skp:on_ok'" type="button" size="100" value="Click Me">         </body> </html> END

#html = Sketchup.get_resource_path("Units/foonits.html") dlg = UI::WebDialog.new("Foonits", true) dlg.add_action_callback("on_ok") {|d,p|         UI::messagebox("Button pressed")         d.close();}

#dlg.set_file(html, nil) dlg.set_html(HTML)