Statalist The Stata Listserver

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

Re: st: dialog programming question

From   "Michael Blasnik" <>
To   <>
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

----- Original Message ----- From: "James Hassell, StataCorp" <>
To: <>
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")
EDIT ed_edit1 10 10 200 ., default(global something)

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

*   For searches and help try:

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