Hi All!
While testing compatibility of a program written in Stata 9 with Stata
10 the following issue was uncovered: dialog controls (EDITs) are not
updated (refreshed, redrawn) while Stata is busy. The following
example code illustrates the problem:
/* - - - - - - - - - - - - - - - test_st10.dlg - - - - - - - - - - - -
- - - - - - - - */
VERSION 9
SYNCHRONOUS_ONLY
POSITION 300 100 300 100
DIALOG main, label("Stata 10 refresh test")
BEGIN
EDIT ed1 30 10 100 .
BUTTON bt1 30 40 100 ., label("Run test") onpush("program test_run")
END
PROGRAM test_run
BEGIN
put "test_st10"
stata hidden
END
/* - - - - - - - - - - - - - -EOF(test_st10.dlg) - - - - - - - - - - -
- - - - - */
/* - - - - - - - - - - - - - - - - test_st10.ado - - - - - - - - - - -
- - - - - */
program test_st10
version 9.0
forvalues i=1/100 {
.test_st10_dlg.main.ed1.setvalue "`i'"
sleep 50
}
capture version 10.0
.test_st10_dlg.main.ed1.setvalue "Stata `c(version)'"
end
/* - - - - - - - - - - - - EOF(test_st10.ado) - - - - - - - - - - - -
- - - - - - - - */
When executed in version 9, the program will show rapidly changing
numbers (1,2,...100) in the edit field.
When executed in version 10, the program will not show any numbers in
the edit field.
Is there any way to restore the old (v9) behavior?
Note that both -dialog- and -program- declare version 9, but this has no effect
Is there any way to force a control element or the whole dialog to
redraw itself?
Thank you, Sergiy Radyakin.
*
* For searches and help try:
* http://www.stata.com/support/faqs/res/findit.html
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/