[GRASSGUI] python question - waiting for a variable to change

Michael Barton michael.barton at asu.edu
Mon Mar 19 10:52:52 EDT 2007


I¹ve run into a little problem that is taxing my neophyte Python programming
abilities. However we do a popup panel for setting display layer options, I
think it is necessary to do something along the lines of the following....

1. Start the options popup. This is currently done with a double click on
the layer, which calls the onActivate even handler. For a raster, the event
handler uses...
        drastcmd = menuform.GUI().parseCommand('d.rast', gmpath)
    ...to start the autogenerated GUI.

2. When you press the ³run² button for this d.* command, the assembled
command (d.rast + options) is simply returned.

3. Now drastcmd should contain a complete d.rast command string.

So, how do I wait in onActivate until the ³run² button is pressed on the
popup and the information is returned to drastcmd (i.e., the value of
drastcmd is changed). Or, alternatively, how can a change in the value of
drastcmd generate an event that I can capture and process? I messed around
with wait() (thinking about tk_wait in TclTk), but couldn¹t get it to do
what I wanted.


Michael
__________________________________________
Michael Barton, Professor of Anthropology
School of Human Evolution & Social Change
Center for Social Dynamics & Complexity
Arizona State University

phone: 480-965-6213
fax: 480-965-7671
www: http://www.public.asu.edu/~cmbarton


-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/grass-gui/attachments/20070319/2b4757c3/attachment.html


More information about the grass-gui mailing list