[GRASS5] fix for problem opening monitor windows from the TclTk menu in WinGRASS

Currently, if you try to open a monitor window in WinGRASS using the TclTk menus, it will flash open and close. It can eventually cause problems making it impossible to open monitor windows and sometimes to even open tcltkgrass. The current workaround is to always open monitors from the command line, using d.mon, prior to using them for displaying maps (including using the display manager, d.dm).

Glynn Clements suggested a fix for this (see below). I've tested it on a Windows computer using Windows XP (and GRASS 5.0.3) and it does the trick. I've also tested it on my Mac (with GRASS 5.3) and it seems to cause no harm. I don't have access to Linnux or other Unix systems to test this, but I suspect it should be OK.

The fix is a slight modification of a line in the $GISBASE/tcltkgrass/main/gui.tcl file. As Glynn suggested below, change the line

exec xterm -geometry 40x5 -e d.mon start=$monitor

to

    exec d.mon start=$monitor &

Could this be submitted to the CVS? Thanks

Michael Barton

Begin forwarded message:

Glynn Clements wrote:

2. Can GRASS 5.3 open monitors via the tcltk menu or is it still
necessary to do this from the command line using d.mon?

I didn't try that; I'll check later.

I've checked that; it still doesn't work.

The problem appears to be this in start_monitor, in gui.tcl:

    exec xterm -geometry 40x5 -e d.mon start=$monitor

The xterm terminates as soon as d.mon completes, which seems to end up
killing the monitor (this may be due to a difference in the way that
Cygwin handles terminals, or due to the use of the Win32 spawn()
function rather than Cygwin's fork+exec).

A possible fix is to change the above line not to use an xterm, i.e.

    exec d.mon start=$monitor &

You will still need to select the monitor separately.

______________________________
Michael Barton, Professor & Curator
Department of Anthropology
Arizona State University
Tempe, AZ 85287-2402
USA

voice: 480-965-6262; fax: 480-965-7671

Michael Barton said:

Currently, if you try to open a monitor window in WinGRASS using the
TclTk menus, it will flash open and close. It can eventually cause
problems making it impossible to open monitor windows and sometimes to
even open tcltkgrass. The current workaround is to always open monitors
from the command line, using d.mon, prior to using them for displaying
maps (including using the display manager, d.dm).

Glynn Clements suggested a fix for this (see below). I've tested it on
a Windows computer using Windows XP (and GRASS 5.0.3) and it does the
trick. I've also tested it on my Mac (with GRASS 5.3) and it seems to
cause no harm. I don't have access to Linnux or other Unix systems to
test this, but I suspect it should be OK.

I just tested it (superficially) on GRASS 5.3 CVS in Debian
testing/unstable on i686 and it seems to work fine.

Moritz

Looks like Moritz committed the change earlier today, it works fine for me on both Intel/Linux(RedHat8) and Mac OS X 10.3.

On 11-Feb-04, at 13:47, Michael Barton wrote:

Currently, if you try to open a monitor window in WinGRASS using the TclTk menus, it will flash open and close. It can eventually cause problems making it impossible to open monitor windows and sometimes to even open tcltkgrass. The current workaround is to always open monitors from the command line, using d.mon, prior to using them for displaying maps (including using the display manager, d.dm).

Glynn Clements suggested a fix for this (see below). I've tested it on a Windows computer using Windows XP (and GRASS 5.0.3) and it does the trick. I've also tested it on my Mac (with GRASS 5.3) and it seems to cause no harm. I don't have access to Linnux or other Unix systems to test this, but I suspect it should be OK.

The fix is a slight modification of a line in the $GISBASE/tcltkgrass/main/gui.tcl file. As Glynn suggested below, change the line

exec xterm -geometry 40x5 -e d.mon start=$monitor

to

    exec d.mon start=$monitor &

Could this be submitted to the CVS? Thanks

Michael Barton

Begin forwarded message:

Glynn Clements wrote:

2. Can GRASS 5.3 open monitors via the tcltk menu or is it still
necessary to do this from the command line using d.mon?

I didn't try that; I'll check later.

I've checked that; it still doesn't work.

The problem appears to be this in start_monitor, in gui.tcl:

    exec xterm -geometry 40x5 -e d.mon start=$monitor

The xterm terminates as soon as d.mon completes, which seems to end up
killing the monitor (this may be due to a difference in the way that
Cygwin handles terminals, or due to the use of the Win32 spawn()
function rather than Cygwin's fork+exec).

A possible fix is to change the above line not to use an xterm, i.e.

    exec d.mon start=$monitor &

You will still need to select the monitor separately.

______________________________
Michael Barton, Professor & Curator
Department of Anthropology
Arizona State University
Tempe, AZ 85287-2402
USA

voice: 480-965-6262; fax: 480-965-7671

------
Scott W. Mitchell Scott_Mitchell@carleton.ca
Department of Geography and Environmental Studies
Carleton University, B349 Loeb Building (Office A209)
1125 Colonel By Drive, Ottawa, ON Canada K1S 5B6
+1-613-520-2600 ext 2695 Fax: 1-613-520-4301