[GRASS-dev] d.m/d.gis mysteries..

Hamish hamish_nospam at yahoo.com
Mon Oct 30 21:13:43 EST 2006


Maciej Sieczka wrote:
> I, personally, would even prefer d.m as the default GUI back,


with a mind to making long term users happy, and making the wxpython
development easier, I'd like to extend the GRASS_GUI variable.

currently it is both a startup shell variable and a GRASS gisenv
variable. (if it exists, the former sets the latter at startup)

currently you can do

GRASS_GUI=text grass63
  or
grass63 -text

to start with the command line one

GRASS_GUI=tcltk grass63
  or
grass63 -gui
  or
grass63 -tcltk

to start with the Tcl/Tk startup + gis.m



with this patch you can also do

grass63 -oldgui   # for d.m

or

GRASS_GUI=d.m grass63

or

GRASS_GUI=gis.m grass63

or even

# rename it to whatever the wxpython GUI will be called
GRASS_GUI=wxpython grass63

when wx becomes the default just switch "grass63 -gui" to that target.


grass remembers the last one you used and uses that as the default.


WRT, d.zoom & gis.m zooming- the x monitors and d.zoom have had more
than a decade of heavy use to become mature. gis.m has had barely 9
months of developer testing to become mature. And even then, most of the
long-time developers who hold the bulk  of the "institutional knowledge"
only work from the command line.... it is really great that it has come
so far so fast.

the zooming stuff is tricky business- even after all this time d.zoom
still has some problems and is far from elegant. accurate rendering &
point placement is the bread and butter of a GIS though, so it'd be nice
to have everyone happy with gis.m in the long term. Folks will be
picking points off the screen and writing down coordinates for their
field sites. All the time spent now perfecting the design choices will
pay off well, I am sure. Even if only for when we do the wxPython
version we can pick the best choices the first time.


choices are good,
Hamish
-------------- next part --------------
Index: lib/init/init.sh
===================================================================
RCS file: /home/grass/grassrepository/grass6/lib/init/init.sh,v
retrieving revision 1.91
diff -u -r1.91 init.sh
--- lib/init/init.sh	17 Sep 2006 23:34:24 -0000	1.91
+++ lib/init/init.sh	31 Oct 2006 01:34:54 -0000
@@ -63,12 +63,12 @@
     	# Check if the user asked for help
 	help|-h|-help|--help)
 	    echo "Usage:"
-	    echo "  $CMD_NAME [-h | -help | --help] [-text | -gui | -tcltk] [[[<GISDBASE>/]<LOCATION_NAME>/]<MAPSET>]"
+	    echo "  $CMD_NAME [-h | -help | --help] [-text | -gui] [[[<GISDBASE>/]<LOCATION_NAME>/]<MAPSET>]"
 	    echo
             echo "Flags:"
             echo "  -h or -help or --help          print this help message"
             echo "  -text                          use text based interface and set as default"
-            echo "  -gui or -tcltk                 use Tcl/Tk based graphical user interface"
+            echo "  -gui (or -tcltk)               use Tcl/Tk based graphical user interface"
             echo "                                   and set as default"
             echo
             echo "Parameters:"
@@ -79,6 +79,7 @@
             echo "  GISDBASE/LOCATION_NAME/MAPSET  fully qualified initial mapset directory"
             echo
             echo "Environment variables relevant for startup:"
+            echo "  GRASS_GUI                      select GUI (text, gis.m, d.m)" # wxpython
             echo "  GRASS_TCLSH                    set tclsh shell name to override 'tclsh'"
             echo "  GRASS_WISH                     set wish shell name to override 'wish'"
             echo "  GRASS_HTML_BROWSER             set html web browser for help pages"
@@ -93,8 +94,14 @@
 	    ;;
 	
 	# Check if the -tcltk flag was given
-	-tcltk|-gui)
-	    GRASS_GUI="tcltk"
+	-gui | -tcltk)
+	    GRASS_GUI="gis.m"
+	    shift
+	    ;;
+
+	# Check if the -oldgui flag was given
+	-oldgui)
+	    GRASS_GUI="d.m"
 	    shift
 	    ;;
     esac
@@ -349,7 +356,9 @@
 if [ "$DISPLAY" -o "$MINGW" ] ; then
 
     # Check if we need to find wish
-    if [ "$GRASS_GUI" = "tcltk" ] ; then
+    if [ "$GRASS_GUI" = "tcltk" ] || \
+	[ "$GRASS_GUI" = "gis.m" ] || \
+	[ "$GRASS_GUI" = "d.m" ] ; then
 
 	# Check if wish is working properly
 	echo 'exit 0' | "$GRASS_WISH" >/dev/null 2>&1
@@ -499,7 +508,7 @@
 	    ;;
 	
 	# Check for tcltk interface
-	tcltk)
+	tcltk | gis.m | d.m)
 	    eval `"$GRASS_WISH" -file "$TCLTKGRASSBASE/gis_set.tcl"`
 	    thetest=$?
 	        #0: failure
@@ -641,12 +650,23 @@
 case "$GRASS_GUI" in
     
     # Check for tcltk interface
-    tcltk)
+    tcltk | gis.m)
 	if [ "$osxaqua" ] ; then
 		"$GISBASE/scripts/gis.m" | sh &
 	else
 		"$GISBASE/scripts/gis.m" &
 	fi	
+	;;
+    d.m)
+	if [ "$osxaqua" ] ; then
+		"$GISBASE/scripts/d.m" | sh &
+	else
+		"$GISBASE/scripts/d.m" &
+	fi	
+	;;
+
+    wxpython)
+	echo "TODO: wxPython GUI" 1>&2
 	;;
     
     # Ignore others


More information about the grass-dev mailing list