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)