B4J Question Main Form's Views Freeze while control is passed to a module's routine

Christos Dorotheou

Member
Licensed User
Longtime User
Dear All,

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.

Thanks in advance
 

Christos Dorotheou

Member
Licensed User
Longtime User
The problem is that the main thread is occupied with the data analyzing. Can you post the data analyzing code?

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.

Thanks
 

Attachments

  • ProcessTest.zip
    2 KB · Views: 259
Upvote 0

Christos Dorotheou

Member
Licensed User
Longtime User
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.

Thanks for the reply.

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 ?

I hope I've made my self clear.

Regards Chris
 
Upvote 0
Top