B4X:
Sub Process_Globals
Private fx As JFX
Private MainForm As Form
Private CBOTest As ComboBox
End Sub
Sub AppStart (Form1 As Form, Args() As String)
MainForm = Form1
MainForm.RootPane.LoadLayout("Test") 'Load the layout file.
MainForm.Show
CBOTest.Items.AddAll(Array("Item 1","Item 2","Item 3"))
CBOTest.SelectedIndex = 1
Wait For (CBOTest) CBOTest_SelectedIndexChanged(Index As Int, Value As Object)
Log("Wait Finished")
End Sub
'Return true to allow the default exceptions handler to handle the uncaught exception.
Sub Application_Error (Error As Exception, StackTrace As String) As Boolean
Return True
End Sub
Sub CBOTest_ValueChanged (Value As Object)
End Sub
Sub CBOTest_SelectedIndexChanged(Index As Int, Value As Object)
Log("Event Fired")
End Sub
From the code above the log output is:
B4X:
Waiting for debugger to connect...
Program started.
Wait Finished
I was expecting:
B4X:
Waiting for debugger to connect...
Program started.
Event Fired
Wait Finished
Taking out the Wait For I get:
B4X:
Waiting for debugger to connect...
Program started.
Event Fired
So something appears not to be working with Wait For.