Anonymous user
Simple windowed application: Difference between revisions
no edit summary
No edit summary |
|||
Line 1,566:
program("Click")
</pre>
=={{header|Nanoquery}}==
<lang nanoquery>import Nanoquery.Util.Windows
// define the necessary objects
$w = new("Window")
$b = new("Button")
$l = new("Label")
$b.setParent($w)
$l.setParent($w)
// define the amount of clicks
$clicks = 0
// a function to update the label
def updateLabel($caller, $event)
global $clicks
global $l
$clicks = $clicks+1
$l.setText(str($clicks))
global $clicks = $clicks
end
// prepare the components to be displayed
$w.setSize(200,200)
$b.setText("click me")
$b.setPosition(0,100)
$l.setText("There have been no clicks yet")
// set the button's event handler to the function updateLabel
$b.setHandler($updateLabel)
// show the window
w.show()</lang>
=={{header|Nim}}==
|