Sub Process_Globals
Private fx As JFX
Private MainForm As Form
End Sub
Sub AppStart (Form1 As Form, Args() As String)
MainForm = Form1
MainForm.Show
CreateCheckboxes(MainForm.RootPane, 5, 6)
End Sub
Sub CreateCheckboxes(Parent As AnchorPane, NumX As Int, NumY As Int) As CheckBox(,)
Dim width As Int = Parent.width / NumX
Dim height As Int = Parent.height / NumY
Dim cb(NumX, NumY) As CheckBox
For x = 0 To NumX - 1
For y = 0 To NumY - 2
Dim chk As CheckBox
chk.Initialize("chk")
Parent.AddNode(chk, 20 + x * width, y * height, width - 5, height - 5)
chk.Text = "Checkbox (" & x & "," & y & ")"
cb(x, y) = chk
Next
Next
Return cb
End Sub
Sub chk_CheckedChange(Checked As Boolean)
Dim chk As CheckBox = Sender
Log(chk.Text & ": " & Checked)
End Sub