(warning: new B4J user!)
I've just started working with B4J. I have a simple routine that creates a batch file based on some parameters and inputs, then executes the batch file. After completion, other actions are available to the user.
Label1.Text="please wait: executing external process..."
lst.Initialize
lst.add(":: first line of batch file")
lst.add(":: second line of batch file")
lst.add(":: and so on...")
File.WriteList(pathStore,"c:\tempBatchFile.bat",lst)
lst.Clear
lst.Add("/c")
lst.Add("""c:\tempBatchFile.bat""")
Dim sh As Shell
sh.Initialize("test","cmd.exe",lst)
sh.RunSynchronous(-1)
Label1.Text=tStr & " pull executed"
The process works great, but the batch file requires several seconds to execute, and there is no indication to the user that the process has started.
I have a label that I intended to use to show status (Label1), but the UI is not updated until the process has been completed. How can I display an updated label that is visible while the batch process is running? Similarly, can I change the mouse cursor during execution? With VBA I could use 'DoEvents' and/or Repaint to tell the application to update the display before proceeding, but have not discovered how to accomplish that with B4J.