js mode example cleanups

This commit is contained in:
fjenett
2011-06-18 19:37:00 +00:00
parent adeb692223
commit 87deeaa360
16 changed files with 129 additions and 144 deletions
@@ -1,5 +1,6 @@
/**
* This example demonstrates how to promt for user input
* This example demonstrates how to promt for user input. It first asks
* for password which then is used to unlock the sketch.
*/
String password = null;
@@ -94,15 +95,17 @@ boolean testLocked ( String passTry )
}
// this is needed to define a way for us to be able to call out
/* this interface is needed to explain Processing what the
properties of the object are that is handed in from JS */
interface JavaScript
{
String promtForInput( String message, String defaultAnswer );
}
// a variable
JavaScript js;
// called from JavaScript to hand in the object
void setJS ( JavaScript jsi )
{
js = jsi;