Frederick Posted August 28, 2020 Share Posted August 28, 2020 I have a TUniStatusBar where I have one panel with a text of "Ready". When I click a button to perform some database processing (which takes about 2 seconds), I would like to change the panel's text to "Processing..." at the start of the process. However, the panel's text never changes to "Processing...". What can I do to get the text of the panel to change immediately once the button is clicked? begin UniStatusBar1.Panels[0].Text:='Processing...'; // This is not handled? // some database processing end; -- Frederick (UniGUI Complete - Professional Edition 1.90.0.1534) Quote Link to comment Share on other sites More sharing options...
Sherzod Posted August 28, 2020 Share Posted August 28, 2020 1 hour ago, Frederick said: UniStatusBar1.Panels[0].Text:='Processing...'; // This is not handled? Hello, Here are some solutions to this problem. First: UniMainModule.EnableSynchronousOperations > True Related demos: \FMSoft\Framework\uniGUI\Demos\Desktop\SyncClientUpdate http://unigui.com/doc/online_help/synch-and-asynch-operations.htm Second: Using ClientEvents... Quote Link to comment Share on other sites More sharing options...
Frederick Posted August 28, 2020 Author Share Posted August 28, 2020 2 hours ago, Sherzod said: Hello, Here are some solutions to this problem. First: UniMainModule.EnableSynchronousOperations > True Related demos: \FMSoft\Framework\uniGUI\Demos\Desktop\SyncClientUpdate http://unigui.com/doc/online_help/synch-and-asynch-operations.htm Second: Using ClientEvents... Thanks. Looking at the demo, it seems that I need to treat the database processing as a main thread and update the visual controls on the side. I will explore this further. BTW, my EnableSynchronousOperations property of UniMainModule is already set to True. Quote Link to comment Share on other sites More sharing options...
Sherzod Posted August 28, 2020 Share Posted August 28, 2020 3 minutes ago, Frederick said: BTW, my EnableSynchronousOperations property of UniMainModule is already set to True. ... UniStatusBar1.Panels[0].Text:='Processing...'; UniSession.Synchronize; ... Quote Link to comment Share on other sites More sharing options...
Frederick Posted August 28, 2020 Author Share Posted August 28, 2020 Thanks. Calling UniSession.Synchronize allowed the TUniStatusBar to show the new text. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.