Statalist


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: Stata 10 behavior different from Stata 9 behavior for dialog controls


From   "Sergiy R." <[email protected]>
To   "[email protected]" <[email protected]>
Subject   st: Stata 10 behavior different from Stata 9 behavior for dialog controls
Date   Mon, 13 Aug 2007 17:00:11 -0400

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/



© Copyright 1996–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index