New topic: 

Progressbar won't update

<http://forums.realsoftware.com/viewtopic.php?t=45270>

         Page 1 of 1
   [ 7 posts ]                 Previous topic | Next topic          Author  
Message        pbesong          Post subject: Progressbar won't updatePosted: 
Thu Sep 06, 2012 10:33 am                         
Joined: Fri Dec 09, 2005 6:25 pm
Posts: 323                I have a progress bar that is supposed to update each 
time a file is processed. It works on the Mac, but the same code does not work 
on Windows...
for z = 0 to ubound(itemArray)
  j = 0
  f = getFolderItem(itemArray(z))
  fileName = f.name
  ProgressBar1.visible = true
  ProgressText.text = "Reading File: "  + f.Name
  ProgressText.visible = true
  ProgressBar1.value = 0
  progressBar1.maximum = 65536
  
  ProgressBar1.value = (z/ubound(itemArray))*65536
  ProgressBar1.refresh
   
                             Top                DaveS          Post subject: 
Re: Progressbar won't updatePosted: Thu Sep 06, 2012 10:37 am                   
              
Joined: Sun Aug 05, 2007 10:46 am
Posts: 4102
Location: San Diego, CA                this won't necessarily solve your 
problem.... but it will ease up on a ton of internal events on the progress bar

ProgressText.visible = true
ProgressBar1.value = 0
progressBar1.maximum = ubound(itemArray)
ProgressBar1.visible = true
for z = 0 to ubound(itemArray)
  j = 0
  f = getFolderItem(itemArray(z))
  fileName = f.name
  ProgressText.text = "Reading File: "  + f.Name
  ProgressBar1.value = z
  ProgressBar1.refresh
      
_________________
Dave Sisemore
MacPro, OSX 10.7.3 RB2011r3
Note : I am not  interested in any solutions that involve custom Plug-ins of 
any kind  
                             Top                pbesong          Post subject: 
Re: Progressbar won't updatePosted: Thu Sep 06, 2012 10:41 am                   
      
Joined: Fri Dec 09, 2005 6:25 pm
Posts: 323                ah yes. so obvious. I will make that change even if 
it doesn't solve the problem. thanks!   
                             Top                pixe656          Post subject: 
Re: Progressbar won't updatePosted: Thu Sep 06, 2012 10:49 am                   
      
Joined: Wed May 20, 2009 11:02 am
Posts: 375                Updating the UI from the main thread is considered 
bad practice, and cause of problems like the one you are asking about. 

If that's what you are doing, check this: 
http://www.realsoftwareblog.com/2012/05/doing-progress-right.html

Pixe      
_________________
Using RS2011r4.3 on Windows7.  
                             Top                pbesong          Post subject: 
Re: Progressbar won't updatePosted: Fri Sep 07, 2012 11:39 am                   
      
Joined: Fri Dec 09, 2005 6:25 pm
Posts: 323                I tried doing the thread thing, but it didn't help. 
Out of frustration I drew 2 rectangles, one on top of the other (red over 
white) and made my own progress bar by adjusting the width of the red one. It 
works great, but I have some status text above it that should update and it 
seems to disappear along with a couple buttons that are above it as well. I 
tried refreshing the window, but they still get hidden for some reason. The 
rectangles in no way overlap these interface elements. Why do they disappear?   
                             Top                pixe656          Post subject: 
Re: Progressbar won't updatePosted: Fri Sep 07, 2012 5:18 pm                    
     
Joined: Wed May 20, 2009 11:02 am
Posts: 375                pbesong wrote:I tried doing the thread thing, but it 
didn't help.  And you used a timer too?      
_________________
Using RS2011r4.3 on Windows7.  
                             Top                pbesong          Post subject: 
Re: Progressbar won't updatePosted: Fri Sep 07, 2012 6:14 pm                    
     
Joined: Fri Dec 09, 2005 6:25 pm
Posts: 323                yes, i did use a timer.   
                             Top             Display posts from previous: All 
posts1 day7 days2 weeks1 month3 months6 months1 year Sort by AuthorPost 
timeSubject AscendingDescending          Page 1 of 1
   [ 7 posts ]      
-- 
Over 1500 classes with 29000 functions in one REALbasic plug-in collection. 
The Monkeybread Software Realbasic Plugin v9.3. 
http://www.monkeybreadsoftware.de/realbasic/plugins.shtml

rbforumnotifier@monkeybreadsoftware.de

Reply via email to