I have a timer and a Label on my Main Form, which serves as an indicator to the user of how long
a specific process needs to complete.
Unfortunately when I call this process which by the way is doing some data analyzing and processing
the label which is supposed to display time passed in seconds since the process began, does not
update during the process and instead is updated when the process is complete.
I've uploaded an example in which I am trying to simulate the problem I have.
In this example the Main module calls alternatively 2 routines, where in one case the views (Labels and Textarea) are updating ok
and in the other case they are updated when the routine passes the control back to the Main module.
The UI will be updated when the main thread is free to process the internal message queue. If you are using a timer to split the work then it will be able to process the message queue.
The UI will be updated when the main thread is free to process the internal message queue. If you are using a timer to split the work then it will be able to process the message queue.
Is it posiible to call from my Main B4J Application a separate thread (Service or B4J application), in which all the data processing will take place and it would also contain a timer which on every timer_tick will erase an event that can be captured and interpreted accordingly, by the Main Application ?
You can use it to run code on another thread. Though unless you are doing a very heavy data processing it should be possible to do it on the main thread (which will be much simpler).
You can use it to run code on another thread. Though unless you are doing a very heavy data processing it should be possible to do it on the main thread (which will be much simpler).