Author Topic: How to update controls- in (almost) real time  (Read 5458 times)

cappy2112

  • Community Member
  • Posts: 91
  • Hero Points: 0
How to update controls- in (almost) real time
« on: June 28, 2007, 01:45:10 AM »

I'm printing a message to a label control, then calling a function.
However, the text in the label doe snot show up until the function has returned.

That function loops through all open files, which can take 10-20 seconds.

Is there a way to update the event queue while in the body of a loop, (Visual Basic 6 has the DoEvents() call), so other messages get processed sooner ?
« Last Edit: June 28, 2007, 01:54:21 AM by cappy2112 »

hs2

  • Senior Community Member
  • Posts: 2761
  • Hero Points: 292
Re: How to update controls- in (almost) real time
« Reply #1 on: June 28, 2007, 01:35:35 PM »
void refresh(_str option="A") could be your friend (use 'help refresh' for details)
HS2

cappy2112

  • Community Member
  • Posts: 91
  • Hero Points: 0
Re: How to update controls- in (almost) real time
« Reply #2 on: June 28, 2007, 11:38:48 PM »
void refresh(_str option="A") could be your friend (use 'help refresh' for details)
HS2

When I first started using refresh('A'), it fixed the initial problem of the control's not being updated.
Now, I'm trying to print something in a label , I call refresh, but it doesn't refresh unless I call _message_box() immediately after the call to refresh()

hs2

  • Senior Community Member
  • Posts: 2761
  • Hero Points: 292
Re: How to update controls- in (almost) real time
« Reply #3 on: June 29, 2007, 01:53:53 PM »
Did you read the help and maybe tried option 'W' (Flush paint messages to the current window) option ?
HS2

cappy2112

  • Community Member
  • Posts: 91
  • Hero Points: 0
Re: How to update controls- in (almost) real time
« Reply #4 on: July 23, 2007, 06:25:53 PM »
Did you read the help and maybe tried option 'W' (Flush paint messages to the current window) option ?
HS2

Yes-

I'm just revisiting all my posts, after returning from vacation.
It seems as though I still cannot update controls while I'm in a loop.
I have to wait until the loop is finished before anything useful is displayed.
I've tried all the options for refresh, they don't do change the situation for me.

I know I'm not referencing the Window or controls correctly. I am trying to find the reply to one of my posts which refers how to do this.

« Last Edit: July 23, 2007, 06:31:43 PM by cappy2112 »