Sub Process_Globals
Private fx As JFX
Private MainForm As Form
Private xui As XUI
Private Button1 As B4XView
Private table1 As TableView
End Sub
Sub AppStart (Form1 As Form, Args() As String)
MainForm = Form1
MainForm.RootPane.LoadLayout("Layout1")
MainForm.Show
table1.Initialize("tab1")
table1.SetColumns(Array("a","b","c"))
table1.SetColumnWidth(0,100)
table1.SetColumnWidth(1,100)
table1.SetColumnWidth(2,100)
MainForm.RootPane.AddNode(table1,0,0,320,300)
'add 6 rows
For a = 0 To 5
Dim el As Label
el.Initialize("el")
el.Text ="label" & a
Dim co As ComboBox
co.Initialize("co")
Dim bu As Button
bu.Initialize("bu")
bu.Text = "button" & a
addToTable(table1,Array(el,co,bu))
Next
End Sub
Sub Button1_Click
xui.MsgboxAsync("Hello World!", "B4X")
End Sub
Sub addToTable(table As TableView, obs() As Object)
table.Items.Add(obs)
End Sub
Sub el_MouseClicked (EventData As MouseEvent)
Dim lab As Label = Sender
Log(lab.Text)
End Sub