[GRASS-user] re: WXPYTHON???

On Feb 1, 2009, at 4:30 AM, <grass-user-request@lists.osgeo.org> wrote:

Date: Sat, 31 Jan 2009 18:28:06 -0500
From: Macsurfcat <macsurfcat@me.com>
Subject: [GRASS-user] re: WXPYTHON???
To: grass-user@lists.osgeo.org
Message-ID: <4984DE86.4020508@me.com>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed

Howdy,

Just a little problem I've encountered before, resolved once but
forgotten the solution:

I've downloaded another version of GRASS 6.3.0 because of extreme
problems with previous; the GUI default (of course) is not the wxpython
which I prefer. I have reset it again and again in terminal with an -u
flag with the same result. The claim is the GUI will be updated, but
upon opening GRASS again, the older GUI is called and utilized.

Help suggests several options but doesn't exactly explain how to
implement them: ie; how does one change a variable in the ".grassrc6
folder", for example.

Sounds ridiculous, I know, but what am I missing here?

Not at all ridiculous. In fact, it requires some arcane knowledge. There are 2 ways to change the GUI. From the terminal, you can use the g.gui command.

g.gui tcltk& launches the tcltk GUI
g.gui wxpython& launches the wxpython GUI

However, all module interfaces will launch in the default GUI regardless of which is started from the command line. If you launch GRASS from an x11 terminal (i.e., on Linux), you can issue a command line argument with GRASS to set the default GUI. I believe it is -tcl and -wx. For people starting GRASS on windows and Mac, however, you need to edit the .grassrc6 file (not folder) to change the default GUI. This file is normally located in your home folder.

This can be done with a standard text editor on windows (don't use a word processor that can inadvertently save this file in other than text format with wrong line feeds). On the Mac all files that start with a "." are hidden with no way built into the Mac interface to make them visible. I think this is a bad idea, but that's the way it is. To edit the .grassrc6 file, you can get utilities to make all hidden files visible ("invisibility toggler", for example), you can use TextWrangler's "open hidden" feature, or you can use a command-lined text editor like pico (hidden files are visible from the command line).

Once you are editing your .grassrc6 file, you simply need to change the GRASS_GUI line

GRASS_GUI: tcltk

OR

GRASS_GUI: wxpython

...will set the default GUI to either TclTk or wxPython.

Hope this helps you and others.

Michael

Hi,

2009/2/1 Michael Barton <michael.barton@asu.edu>:
[...]

Not at all ridiculous. In fact, it requires some arcane knowledge. There are
2 ways to change the GUI. From the terminal, you can use the g.gui command.

g.gui tcltk& launches the tcltk GUI
g.gui wxpython& launches the wxpython GUI

if you launch g.gui with '-u' flag the default GUI is updated
according your choice.

Martin

--
Martin Landa <landa.martin gmail.com> * http://gama.fsv.cvut.cz/~landa

Thanks for the useful information.

Michael

On Feb 1, 2009, at 9:24 AM, Martin Landa wrote:

Hi,

2009/2/1 Michael Barton <michael.barton@asu.edu>:
[...]

Not at all ridiculous. In fact, it requires some arcane knowledge. There are
2 ways to change the GUI. From the terminal, you can use the g.gui command.

g.gui tcltk& launches the tcltk GUI
g.gui wxpython& launches the wxpython GUI

if you launch g.gui with '-u' flag the default GUI is updated
according your choice.

Martin

--
Martin Landa <landa.martin gmail.com> * http://gama.fsv.cvut.cz/~landa

On Sun, 1 Feb 2009, Michael Barton wrote:

Not at all ridiculous. In fact, it requires some arcane knowledge. There are 2 ways to change the GUI. From the terminal, you can use the g.gui command.

g.gui tcltk& launches the tcltk GUI
g.gui wxpython& launches the wxpython GUI

However, all module interfaces will launch in the default GUI regardless of which is started from the command line. If you launch GRASS from an x11 terminal (i.e., on Linux), you can issue a command line argument with GRASS to set the default GUI. I believe it is -tcl and -wx. For people starting GRASS on windows and Mac, however, you need to edit the .grassrc6 file (not folder) to change the default GUI. This file is normally located in your home folder.

This can be done with a standard text editor on windows (don't use a word processor that can inadvertently save this file in other than text format with wrong line feeds). On the Mac all files that start with a "." are hidden with no way built into the Mac interface to make them visible. I think this is a bad idea, but that's the way it is. To edit the .grassrc6 file, you can get utilities to make all hidden files visible ("invisibility toggler", for example), you can use TextWrangler's "open hidden" feature, or you can use a command-lined text editor like pico (hidden files are visible from the command line).

Once you are editing your .grassrc6 file, you simply need to change the GRASS_GUI line

GRASS_GUI: tcltk

OR

GRASS_GUI: wxpython

...will set the default GUI to either TclTk or wxPython.

Simpler than that (and less risk of messiness with line endings) is to use g.gisenv to edit GRASS variables in the GISRC file:

g.gisenv set=GRASS_GUI=tcltk
or
g.gisenv set=GRASS_GUI=wxpython

will achieve the same as the above, or use g.gui as Martin suggested. BUT, it's not true that there is no other way to change the GUI settings, on Windows at least:
The grassXX.bat start-up script has always accepted arguments -text, -gui or -tcltk and was recently extended to also accept -wxpython.

Paul

On Sun, 1 Feb 2009, Macsurfcat wrote:

Paul Kelly wrote:

it's not true that there is no other way to change the GUI settings, on Windows at least:
The grassXX.bat start-up script has always accepted arguments -text, -gui or -tcltk and was recently extended to also accept -wxpython.

Yes, I reset default gui via g.gisenv with resultant change to GISRC file. However, at startup "tcltk' reasserts itself regardless.

Ah, the problem is that the Windows start-up script in 6.3.x doesn't know what to do with a "wxpython" GRASS_GUI setting. So it starts the Tcl/Tk GUI anyway. This was corrected a couple of weeks ago and the correct behaviour will be in 6.4.0.

Paul