[GRASS5] Need help with tcltk regexp
Michael Barton
michael.barton at asu.edu
Sun Feb 13 01:38:24 EST 2005
I'm trying to add a button bar to the GIS Manager with buttons to
start/select display monitors. I've got it most of it done, but have hit a
wall in a relatively simple test of whether or not a monitor is open and
selected. I've used as a model, the procedure in d.m.tcl for the display
button (which will display in the current monitor, and which while open
monitor x0 if no monitor is open and selected).
Here is my procedure. I hope someone can tell me why it is not working. I
can't get it to recognize either of the regexp clauses. The variable mon can
be set to values of x0, x1, x2, etc.
Thanks in advance.
Michael
==========================================
proc DmMonitorsel::displmon { mon } {
global dmpath
if ![catch {open "|d.mon -L" r} input] {
while {[gets $input line] >= 0} {
if {[regexp -nocase {$mon.*not running} $line buffer monitor]} {
run "d.mon start=$mon"
return
} elseif {[regexp -nocase {$mon.*running} $line buffer monitor]}
{
run "d.mon select=$mon"
return
} else {
return
}
}
}
}
=========================================
____________________
C. Michael Barton, Professor of Anthropology
School of Human Evolution and Social Change
PO Box 872402
Arizona State University
Tempe, AZ 85287-2402
USA
Phone: 480-965-6262
Fax: 480-965-7671
www: <www.public.asu.edu/~cmbarton>
More information about the grass-dev
mailing list