Simple windowed application: Difference between revisions
Content added Content deleted
(Added Wren) |
|||
Line 1,811: | Line 1,811: | ||
}</lang> |
}</lang> |
||
<html> |
|||
=={{header|JavaFX Script}}== |
|||
<head> |
|||
{{libheader|JavaFX 1.2}} |
|||
<title>Simple Window Application</title> |
|||
<lang javafx>import javafx.stage.*; |
|||
</head> |
|||
import javafx.scene.*; |
|||
import javafx.scene.layout.*; |
|||
import javafx.scene.control.*; |
|||
<body> |
|||
Stage { |
|||
<br>         |
|||
scene: Scene { |
|||
width: 300 height: 200 |
|||
content: VBox { |
|||
⚫ | |||
<script type="text/javascript"> |
|||
spacing: 10 |
|||
var box = document.createElement('input') |
|||
⚫ | |||
box.style.position = 'absolute'; // position it |
|||
box.style.left = '10px'; |
|||
def varText = bind if (clicks == 0) then "no clicks yet" else "{clicks} clicks" |
|||
box.style.top = '60px'; |
|||
text : bind "There have been {varText}" |
|||
document.body.appendChild(box).style.border="3px solid white"; |
|||
} |
|||
document.body.appendChild(box).value = "There have been no clicks yet"; |
|||
Button { |
|||
document.body.appendChild(box).style['width'] = '220px'; |
|||
text: "click me" |
|||
⚫ | |||
onMouseClicked: function(e) { clicks++; } |
|||
function count_clicks() { |
|||
document.body.appendChild(box).remove() |
|||
] |
|||
clicks += 1; |
|||
document.getElementById("clicks").innerHTML = clicks; |
|||
} |
|||
⚫ | |||
}</lang> |
|||
</script> |
|||
<button type="button" onclick="count_clicks()"> Click me</button> |
|||
<pre><p> Clicks: <a id="clicks">0</a> </p></pre> |
|||
</body> |
|||
</html> |
|||
=={{header|Julia}}== |
=={{header|Julia}}== |