Simple windowed application: Difference between revisions
added Unicon example
(added Unicon example) |
|||
Line 1,411:
EndWhile
EndPrgm</lang>
=={{header|Unicon}}==
<lang unicon>
import gui
$include "guih.icn"
class SimpleApp : Dialog (label)
# -- automatically called when the dialog is created
method component_setup()
# create and add the label
label := Label("label=There have been no clicks yet","pos=50%,33%", "align=c,c")
add (label)
# create and add the button
button := TextButton("label=Click me", "pos=50%,66%", "align=c,c")
button.connect(self, "clicked", ACTION_EVENT)
add (button)
# some cosmetic settings for the window
attrib("size=180,70", "bg=light gray")
end
method clicked ()
static count := 0
count +:= 1
label.set_label ("Clicked " || count || " times")
end
end
procedure main()
local d := SimpleApp ()
d.show_modal()
end
</lang>
=={{header|Vedit macro language}}==
|