Special

Introducing the “Welcome to Xojo” Bundle!

New to Xojo and looking for guidance? We've put together a terrific bundle to welcome you! Xojo Bundle

This bundle includes six back issues of the magazine -- all of year 15 in printed book and digital formats -- plus a one-year subscription so you'll be learning all about Xojo for the next year. It's the perfect way to get started programming with Xojo. And you save as much as $35 over the non-bundle price!

This offer is only available for a limited time as supplies are limited, so hurry today and order this special bundle before the offer goes away!

Article Preview


Buy Now

Issue 16.5 ('Spreadsheet Databases')
Instant purchase and download via GumRoad!

COLUMN

Updating the ProgressBar

Manipulating the UI During a Long Process

Issue: 16.5 (September/October 2018)
Author: Marc Zeedar
Author Bio: Marc taught himself programming in high school when he bought his first computer but had no money for software. He's had fun learning ever since.
Article Description: No description available.
Article Length (in bytes): 11,085
Starting Page Number: 76
Article Number: 16506
Resource File(s):

Download Icon project16506.zip Updated: 2018-08-31 11:10:06

Related Web Link(s):

http://developer.xojo.com/userguide/threading
http://docs.xojo.com/index.php/DoEvents

Excerpt of article text...

I received an email from an xDev reader asking for help with his ProgressBar code that was broken. His method used to work, but recently stopped—likely due to a change in how Xojo functions.

His original code was simple enough, so at first I was perplexed as I have used similar methods in the past. I won't replicate his code here, but it's simple enough.

He basically had a window object with a ProgressBar controller on it. A method on the window would initialize, update, and close the window based on the parameters passed. In other words, he'd pass a key that indicated "initialize" mode and it would set up the ProgressBar, while a key for "update" would change the value of the ProgressBar and redraw it, and so on.

The problem was when he encountered a long process (such as a loop) and tried to call his ProgressBar routine, nothing would be updated. The ProgressBar would always stay the same until the task would finish without any progress being shown to the user.

Debugging the Problem

Usually, when I get code from another person, it's difficult to debug as I'm not sure if there's an error in their code, which is hard to deduce without an extensive understanding of their code, or if the problem lies elsewhere (i.e. Xojo or operating system).

...End of Excerpt. Please purchase the magazine to read the full article.