realbasic-nug
[Top] [All Lists]

Updating a listbox

To: REALbasic NUG <realbasic-nug at lists dot realsoftware dot com>
Subject: Updating a listbox
From: Ian Piper <ianpiper at mac dot com>
Date: Tue, 28 Feb 2006 09:34:12 +0000
Delivered-to: realbasic-nug at lists dot realsoftware dot com
I am writing a program that backs up a big data file from one volume to another in Windows XP. In the UI I have a listbox that is supposed to give the user a transcript of the progress. I am doing this by adding a row to the listbox and then running listbox.refresh. It is not working the way I would have expected though. Here is a short snippet that illustrates the problem. updateMessageList is a method that adds a row to the listbox and creates a log file entry. checkForSourceDB just checks that the source database exists and returns true or false. The issue is that if I write lstTranscript.refresh a number of times only the first one gets executed. So in the snippet below the listbox only updates after "proceeding with backup". The listbox then only updates when the whole backup is finished.

==== snip ====
  updateMessageList("Starting backup...")
  updateMessageList("Checking for source database C:\FOLDER\DB.MDB...")
  if checkForSourceDB then

updateMessageList("source database exists - proceeding with backup")
    lstTranscript.refresh
    updateMessageList("Archiving previous backup...")
    lstTranscript.refresh
[...]
==== snip ====

I must be missing something about how to refresh or repaint UI components when the system is doing something. I tried using doevents but this seems to be designed for loops (and I am not using loops anywhere).

Can anyone set me straight here?

One other thing - is there a way to set the mouse cursor to be the hourglass under Windows. I am using RB5.5.2 on Mac OS X.

Thanks for any help.


Ian.
--
Dr Ian M Piper
ianpiper at mac dot com
skype: ianmpiper
--
Where is the wisdom we have lost in knowledge?
Where is the knowledge we have lost in information?


_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>


<Prev in Thread] Current Thread [Next in Thread>