Author Topic: [Not Responding] Dialog with lots of refreshes  (Read 2531 times)

teebs73

  • Newbie
  • *
  • Posts: 1
[Not Responding] Dialog with lots of refreshes
« on: February 13, 2014, 11:27:09 am »
I have a common problem with Dynamic dialogs going to [Not Responding].  This happens in a lot of scenarios, but here's an example in pseduocode:
- load array with 2000 rows
- update StaticText element with value of Array[i,x] with the DialogControlSet command
- loop through all elements in array

The Dialog will run OK if i never change focus away from the dialog. But if i open another window and come back to the Dialog, it will be blank, show as [Not Responding] and no controls will be updating.  HOWEVER, the script is still running, the array is still processing, and the dialog will resume operation once the loop is complete.

This only happens if i have a high volume of refreshes --- 1000+ records.   Quick bursts of 10 records / dialog refreshes don't have any negative effect.

If i use a simple BoxText command, I have no problems.  the BOX will dispay the refreshing text whether i have focus or not and never goes to [Not Responding]

Looking for some guidance on what could be causing this...

thanks for your help!
-- Steve

JTaylor

  • Pundit
  • *****
  • Posts: 1013
    • Data & Stuff Inc.
Re: [Not Responding] Dialog with lots of refreshes
« Reply #1 on: February 13, 2014, 12:44:43 pm »
Disable the dialog using DialogProcOptions while such activities are occurring and then re-enable.


Something like:

    DialogProcOptions(JTa_Handle, dpo_disablestate,0)               ; Dialog Disable (1-Disable, 2-Wait cursor, 0-Enable).

I normally use option 2.

Jim

Deana

  • Wilson WindowWare Tech Support
  • Pundit
  • *****
  • Posts: 1183
  • WinBatch® can do it.
    • WinBatch Tech Support Database
Re: [Not Responding] Dialog with lots of refreshes
« Reply #2 on: February 13, 2014, 12:47:10 pm »
Generally in WIL dialogs you don't want to have code that takes a really long time to return to the dialog procedure. IF you do have code that takes a while to process then you will see the CPU get pegged and the dialog becomes non responsive.

In order to get around this you can temporarily Disable the dialog using DialogProcOptions 1000, then re-Enable after the long process.
Deana F.
Technical Support
Wilson WindowWare Inc.