Hello,
I'm trying to take advantage of this code below, that I found here (Todd was right... well, almost)
That's the html file
<HTML>
<HEAD>
<title>Webdialog UI </title>
<style type="text/css">
</style>
</HEAD>
<body>
<div>
<p><font color="blue">Input</font><br>
<input type="text" name="myTextInput" size="24"></input>
</p>
<p><input type="submit" name="submitButtonName" onclick="tellSketchup(myTextInput.value)"></p>
</div>
<script type="text/javascript">
function tellSketchup(value)
{
//this non-intuitive command will call the sketchup function "ValueChanged"
//with the name and value of the control that changed
window.location='skp;ValueChanged@'+ value;
}
</script>
</body>
</HTML>
and here is the .rb file
def inputSimple()
#create
dlg = UI;;WebDialog.new("inputSimple", true,"inputsimple", 300, 300, 100, 50, true)
fn= File.dirname(__FILE__)+'/inputsimple.html'
dlg.set_file fn
dlg.show {}
dlg.add_action_callback("ValueChanged") {|d,p|
puts p
dlg.close {}
}
end
But I can't achieve what I'm looking for: getting integer from the webdialog and use it to draw a box (f.e)
to do so i'm trying to
- Call another def at the end of the inputSimple()
- Use the input as a variable in this called def;
- Use multiple inputs
But I do not succeed.
Can someone help?