Statalist The Stata Listserver


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

Re: st: dialog programming question


From   "Michael Blasnik" <[email protected]>
To   <[email protected]>
Subject   Re: st: dialog programming question
Date   Thu, 22 Jun 2006 16:57:11 -0400

Thanks so much -- I tried it out and it works perfectly.

Michael Blasnik
[email protected]

----- Original Message ----- From: "James Hassell, StataCorp" <[email protected]>
To: <[email protected]>
Sent: Thursday, June 22, 2006 4:12 PM
Subject: Re: st: dialog programming question



My initial impression was that Michael was trying to get the dialog to show
the correct values when it was first shown, thus PREINIT and POSTINIT would
be the logical choice. However, I see that Michael wants the dialog to
reflect changes that have occurred within Stata due to an ado program that
the dialog box has initiated. This can be done by using the connection between
Stata dialogs and the class system. Appendix B of -help dialog- hints at this
but does not give a lot of detail. Basically the ado program must be aware
of the dialog and through the class system it can update the controls
in the dialog. This is done by using member programs for the various controls.

For example:
/* snippet of a dialog definition saved in xyz.dlg */
DIALOG main, tabtitle("Main")
BEGIN
EDIT ed_edit1 10 10 200 ., default(global something)
END


/* snippet of ado program that changes the dialog */
.xyz_dlg.main.ed_edit1.setvalue $someGlobalMacro

// or alternatively
.xyz_dlg.main.ed_edit1.setvalue `"`someLocalMacro'"'


Notice that the dialog is saved in a file named xyz.dlg and can be manipulated
by the ado program using xyz_dlg.tabName.controlName.memberProgram

Admittedly this is an advanced feature of the dialog programming language
without extensive documentation. I would like to encourage Michael to contact
Stata Technical Support if he has specific questions about their application.


--James Hassell, StataCorp
[email protected]

*
*   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