[GRASS-dev] gis.m broken in 6.2.0rc3 for Tcl/Tk 8.3

Hi,

As the subject says, gis.m is fully broken in 6.2 for Tcl/Tk's wish8.3,
as -offrelief, -overrelief, and -compound are unknown to it.

If I remove all those, it works fine. The only difference I see is that
without the extra relief calls the mouse-mode (pointer,zoom,pan) buttons
have some shaddowing. This is arguably wanted, as they are select-one
radio buttons. Pretty minor thing though.

I expect -offrelief and -overrelief are just cosmetic, so they can be
removed without worry; and AFAICT, -compound isn't actually doing
anything as the zoom menu items don't have associated icons. (???)

These were introduced way back in May, I've just noticed now as while
I've been switching tcltk 8.3 & 8.4 -dev packages, I've kept using
wish8.4. .. just tried building 6.2rc3 on another machine which is
pure tcltk 8.3 & this popped up.

comments?

Hamish

G:grass-6.2.0RC3 > gis.m
G:grass-6.2.0RC3 > Error in startup script: unknown option "-offrelief"
    while executing
"radiobutton $tb.pointer -image [image create photo -file
"$iconpath/gui-pointer.gif"] -command "MapCanvas::stoptool $mon;
MapCanvas::poin
ter $mon" ..."
    (procedure "MapToolBar::create" line 36)
    invoked from within
"MapToolBar::create $map_tb"
    (procedure "MapCanvas::create" line 51)
    invoked from within
"MapCanvas::create"
    (procedure "Gm::startmon" line 11)
    invoked from within
"Gm::startmon"
    (procedure "Gm::create" line 69)
    invoked from within
"Gm::create"
    (procedure "main" line 30)
    invoked from within
"main $argc $argv"
    (file
"/usr/src/grass/grass-6.2.0RC3/dist.i686-pc-linux-gnu/etc/gm/gm.tcl"
line 521)

G:grass-6.2.0RC3 > cd gui/tcltk/
G:tcltk > grep -rI "\-offrelief" *
gis.m/maptool.tcl: -variable maptools($mon) -value pointer
-relief flat -offrelief flat -overrelief raised \
gis.m/maptool.tcl: -variable maptools($mon) -value zoomin
-relief flat -offrelief flat -overrelief raised \
gis.m/maptool.tcl: -variable maptools($mon) -value zoomout
-relief flat -offrelief flat -overrelief raised \
gis.m/maptool.tcl: -variable maptools($mon) -value pan
-relief flat -offrelief flat -overrelief raised \
gis.m/maptool.tcl: -variable maptools($mon) -value query
-relief flat -offrelief flat -overrelief raised \
gis.m/maptool.tcl: -variable maptools($mon) -value measure
-relief flat -offrelief flat -overrelief raised \
gis.m/maptool.tcl: -relief flat -offrelief flat -overrelief
raised \
gis.m/maptool.tcl: -relief flat -offrelief flat -overrelief
raised \
gis.m/georecttool.tcl: -variable grmaptools -value selector
-relief flat -offrelief flat -overrelief raised \
gis.m/georecttool.tcl: -variable grmaptools -value zoomin
-relief flat -offrelief flat -overrelief raised \
gis.m/georecttool.tcl: -variable grmaptools -value zoomout
-relief flat -offrelief flat -overrelief raised \
gis.m/georecttool.tcl: -variable grmaptools -value pan -relief
flat -offrelief flat -overrelief raised \
G:tcltk >

checking Tcl version... 8.3
checking Tk version... 8.3

Error in startup script: unknown option "-overrelief"
    while executing
"radiobutton $tb.pointer -image [image create photo -file
"$iconpath/gui-pointer.gif"] -command "MapCanvas::stoptool $mon;
MapCanvas::poin
ter $mon" ..."
    (procedure "MapToolBar::create" line 36)

Error in startup script: unknown option "-compound"
    while executing
"$zoommenu add command -compound top -label {Zoom to selected map}
-command {MapCanvas::zoom_map $mon}"
    (procedure "MapToolBar::create" line 72)

Hi Hamish,

Out of town, but did have a chance to look at mail this morning. This is the
kind of issue that was afraid of earlier. I appreciate you taking the time
to test this, however.

-compound can be deleted because it is turned off anyway

The -offrelief and -overrelief make the radio buttons in the tool bar look
consistent with the non-radio buttons. In this sense they are cosmetic.
However, the enormous part of the TclTk code is 'cosmetic' in that it gives
a particular appearance to the user interface.

IMHO, taking out these commands will degrade the presentation of the GUI
somewhat in a very heavily used area (as opposed to the digitizing panel in
the earlier issue). Is this worth making the GUI compatible with TclTk 8.3?
I'm not sure. If this is a significant issue and the only one that keeps
GRASS from being available to a large segment of the user community, it
probably is worth it. If it is something that affects a few people who could
update their TclTk if they wanted to do so, then I think it is not.

The same kind of issue is already popping up with wxPython.

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

From: Hamish <hamish_nospam@yahoo.com>
Date: Thu, 26 Oct 2006 22:01:20 +1300
To: grass5 <grass-dev@grass.itc.it>
Subject: [GRASS-dev] gis.m broken in 6.2.0rc3 for Tcl/Tk 8.3

Hi,

As the subject says, gis.m is fully broken in 6.2 for Tcl/Tk's wish8.3,
as -offrelief, -overrelief, and -compound are unknown to it.

If I remove all those, it works fine. The only difference I see is that
without the extra relief calls the mouse-mode (pointer,zoom,pan) buttons
have some shaddowing. This is arguably wanted, as they are select-one
radio buttons. Pretty minor thing though.

I expect -offrelief and -overrelief are just cosmetic, so they can be
removed without worry; and AFAICT, -compound isn't actually doing
anything as the zoom menu items don't have associated icons. (???)

These were introduced way back in May, I've just noticed now as while
I've been switching tcltk 8.3 & 8.4 -dev packages, I've kept using
wish8.4. .. just tried building 6.2rc3 on another machine which is
pure tcltk 8.3 & this popped up.

comments?

Hamish

G:grass-6.2.0RC3 > gis.m
G:grass-6.2.0RC3 > Error in startup script: unknown option "-offrelief"
    while executing
"radiobutton $tb.pointer -image [image create photo -file
"$iconpath/gui-pointer.gif"] -command "MapCanvas::stoptool $mon;
MapCanvas::poin
ter $mon" ..."
    (procedure "MapToolBar::create" line 36)
    invoked from within
"MapToolBar::create $map_tb"
    (procedure "MapCanvas::create" line 51)
    invoked from within
"MapCanvas::create"
    (procedure "Gm::startmon" line 11)
    invoked from within
"Gm::startmon"
    (procedure "Gm::create" line 69)
    invoked from within
"Gm::create"
    (procedure "main" line 30)
    invoked from within
"main $argc $argv"
    (file
"/usr/src/grass/grass-6.2.0RC3/dist.i686-pc-linux-gnu/etc/gm/gm.tcl"
line 521)

G:grass-6.2.0RC3 > cd gui/tcltk/
G:tcltk > grep -rI "\-offrelief" *
gis.m/maptool.tcl: -variable maptools($mon) -value pointer
-relief flat -offrelief flat -overrelief raised \
gis.m/maptool.tcl: -variable maptools($mon) -value zoomin
-relief flat -offrelief flat -overrelief raised \
gis.m/maptool.tcl: -variable maptools($mon) -value zoomout
-relief flat -offrelief flat -overrelief raised \
gis.m/maptool.tcl: -variable maptools($mon) -value pan
-relief flat -offrelief flat -overrelief raised \
gis.m/maptool.tcl: -variable maptools($mon) -value query
-relief flat -offrelief flat -overrelief raised \
gis.m/maptool.tcl: -variable maptools($mon) -value measure
-relief flat -offrelief flat -overrelief raised \
gis.m/maptool.tcl: -relief flat -offrelief flat -overrelief
raised \
gis.m/maptool.tcl: -relief flat -offrelief flat -overrelief
raised \
gis.m/georecttool.tcl: -variable grmaptools -value selector
-relief flat -offrelief flat -overrelief raised \
gis.m/georecttool.tcl: -variable grmaptools -value zoomin
-relief flat -offrelief flat -overrelief raised \
gis.m/georecttool.tcl: -variable grmaptools -value zoomout
-relief flat -offrelief flat -overrelief raised \
gis.m/georecttool.tcl: -variable grmaptools -value pan -relief
flat -offrelief flat -overrelief raised \
G:tcltk >

checking Tcl version... 8.3
checking Tk version... 8.3

Error in startup script: unknown option "-overrelief"
    while executing
"radiobutton $tb.pointer -image [image create photo -file
"$iconpath/gui-pointer.gif"] -command "MapCanvas::stoptool $mon;
MapCanvas::poin
ter $mon" ..."
    (procedure "MapToolBar::create" line 36)

Error in startup script: unknown option "-compound"
    while executing
"$zoommenu add command -compound top -label {Zoom to selected map}
-command {MapCanvas::zoom_map $mon}"
    (procedure "MapToolBar::create" line 72)

Hamish wrote:

> As the subject says, gis.m is fully broken in 6.2 for Tcl/Tk's
> wish8.3, as -offrelief, -overrelief, and -compound are unknown to
> it.

Michael Barton wrote:

-compound can be deleted because it is turned off anyway

ok.

The -offrelief and -overrelief make the radio buttons in the tool bar
look consistent with the non-radio buttons. In this sense they are
cosmetic. However, the enormous part of the TclTk code is 'cosmetic'
in that it gives a particular appearance to the user interface.

IMHO, taking out these commands will degrade the presentation of the
GUI somewhat in a very heavily used area (as opposed to the digitizing
panel in the earlier issue). Is this worth making the GUI compatible
with TclTk 8.3? I'm not sure. If this is a significant issue and the
only one that keeps GRASS from being available to a large segment of
the user community, it probably is worth it.

I hope the attached patches will take care of any further debate. I've
tested this with both wish8.3 and wish8.4 on Debian/Stable (sarge), and
it works as expected, but as I hope for this to be in the 6.2 release
I'd like some external conformation/feedback before applying it to the
6.2 CVS branch.

basically:

global env tk_version

if {$tk_version < 8.4} {
   [...]
} else {
   [...] -overrelief -offrelief
}

I generally don't like these sorts of version tests as they can get out
of control and make long term maintenance a problem, but in this case
I'm not too concerned with muddying up the TclTk GUI code slightly as
wxPython is just around the corner.

(sorry if the .diff is problematic, I'm having some connection problems
with the CVS server today)

If it is something that affects a few people who could update their
TclTk if they wanted to do so, then I think it is not.

"could update their TclTk if they wanted to do so"

The problem as I see it is that this is not necessarily true.

People using older systems are either doing so because a) they don't
have the technical ability to upgrade, b) they don't have administer
rights on the system to do so (mainframe), or c) they just don't want to
(compatibility with other critical software on their machine precludes
it, or it's not worth the risk/bother to damage a working system).

The same kind of issue is already popping up with wxPython.

I think that is different, with TclTk we are taking something away which
we used to offer- backwards compatibility with older systems. With
wxPython we have never released anything that worked with an older
version, so have no duty to support that and can declare whatever
required version we want. In addition, I expect older versions of
wxPython too be much less mature than older versions of tcltk.

Also I hate to force people onto the "constant upgrade bandwagon".

Hamish

(attachments)

tk8.3_safe_maptool.diff (11 KB)
tk8.3_safe_georecttool.diff (7.23 KB)