32 lines
749 B
Plaintext
32 lines
749 B
Plaintext
import gui
|
|
$include "guih.icn"
|
|
|
|
procedure main()
|
|
SimpleWindow().show_modal()
|
|
end
|
|
|
|
class SimpleWindow : Dialog(label, button, count)
|
|
method component_setup()
|
|
self.set_attribs("size=222,139")
|
|
label := Label()
|
|
label.set_pos("24", "24")
|
|
label.set_internal_alignment("l")
|
|
label.set_label("There have been no clicks yet.")
|
|
self.add(label)
|
|
button := TextButton()
|
|
button.set_pos(24, 53)
|
|
button.set_label("click me")
|
|
button.set_internal_alignment("c")
|
|
button.connect(self, "incr", ACTION_EVENT)
|
|
self.add(button)
|
|
end
|
|
|
|
method incr()
|
|
/count := 0
|
|
label.set_label("There have been "||(count+:=1)||" clicks.")
|
|
end
|
|
|
|
initially
|
|
self.Dialog.initially()
|
|
end
|