1 win
= jpcrr
.window
.create("test from Lua");
2 win
:create_component({gridx
= 0, gridy
= 0, gridwidth
= 1, gridheight
= 1, name
= "label1", type = "label", text
= "foo"});
3 win
:create_component({gridx
= 1, gridy
= 0, gridwidth
= 1, gridheight
= 1, name
= "text1", type = "textfield", text
= "", columns
= 40});
4 win
:create_component({gridx
= 0, gridy
= 1, gridwidth
= 1, gridheight
= 1, name
= "label2", type = "label", text
= "bar"});
5 win
:create_component({gridx
= 1, gridy
= 1, gridwidth
= 1, gridheight
= 1, name
= "text2", type = "textfield", text
= "", columns
= 40});
6 win
:create_component({gridx
= 0, gridy
= 2, gridwidth
= 1, gridheight
= 1, name
= "label3", type = "label", text
= "baz"});
7 win
:create_component({gridx
= 1, gridy
= 2, gridwidth
= 1, gridheight
= 1, name
= "text3", type = "textfield", text
= "", columns
= 40});
8 win
:create_component({gridx
= 0, gridy
= 3, gridwidth
= 2, gridheight
= 1, name
= "button1", type = "button", text
= "zot"});
9 win
:create_component({gridx
= 0, gridy
= 4, gridwidth
= 2, gridheight
= 1, name
= "checkbox1", type = "checkbox", text
= "foobar"});
12 win
:select("checkbox1");
15 mtype
, message
= jpcrr
.wait_event();
16 if mtype
== "lock" then
20 print("Got '" .. mtype
.. "'['" .. message
.. "'].")
22 print("Got '" .. mtype
.. "'[<no message>].")