[GRASS-dev] question about gui switching menu item

Martin suggested I forward this to the list.

Michael

Begin forwarded message:

From: Martin Landa <landa.martin@gmail.com>
Date: February 27, 2009 5:59:09 AM GMT-07:00
To: Michael Barton <michael.barton@asu.edu>
Subject: Re: question about gui switching menu item

Michael,

this is question for ML especially for Hamish who added this item to the menu.

Martin

2009/2/27 Michael Barton <michael.barton@asu.edu>:

Hi Martin,

Why does the menu item to change the gui have to run a script instead of

just run g.gui tcltk -un?

That is, why…

Change default GUI

Changes the default GRASS graphical user interface (GUI) setting.

self.OnMenuCmd

g.change.gui.py

instead of …

Change default GUI

Changes the default GRASS graphical user interface (GUI) setting.

self.OnMenuCmd

g.gui tcltk -gn

??

Michael


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

Michael wrote:

>> Why does the menu item to change the gui have to run a script instead
>> of just run g.gui tcltk -un?

because for 6.4 there is a choice of text,d.m,gis.m, and wxPython.

I added a wrapper script instead of just opening a GUI for g.gui to
enforce that the -u and -n flags are used and make it a bit more obvious.

see http://trac.osgeo.org/grass/ticket/500

I initially added some text about "will take effect next time you start
grass" but removed it after I noticed that module popup guis use the new
gui immediately. so maybe say "will take *full* effect next time..." or so.
?

"""""
Running it from the wxPython GUI still needs to be tested by someone please. Config -> Working enviro -> Change default GUI

Also, I was thinking it could be useful to add an entry after 'Help->About system' like 'Help->Show system environment' which would run "set" and dump the results to the Output window. It would help in debugging.
"""""
prob add a sep line in the help menu for that and 'About System'.

Hamish

I've tested it in wxPython and it works on the Mac.

The script is more than I had in mind, but is indeed nice.

I was only able to follow the discussion in parts. I remember some talk about windows not having a command line. But in fact it does have a command line in both TclTk and wxPython, even if it does not have a full terminal. The lack of a terminal, however, means that text and old d.m are not available for Windows. It only can run the TclTk gis.m and wxPython GUI's. I'm not sure what will happen in Windows if someone selects text or d.m. Linux and the Mac, with terminal can run these other modes, but this makes a nice menu item less important too.

Michael

On Feb 28, 2009, at 7:48 PM, Hamish wrote:

Michael wrote:

Why does the menu item to change the gui have to run a script instead
of just run g.gui tcltk -un?

because for 6.4 there is a choice of text,d.m,gis.m, and wxPython.

I added a wrapper script instead of just opening a GUI for g.gui to
enforce that the -u and -n flags are used and make it a bit more obvious.

see #500 (GUI menu item to swtich GUIs) – GRASS GIS

I initially added some text about "will take effect next time you start
grass" but removed it after I noticed that module popup guis use the new
gui immediately. so maybe say "will take *full* effect next time..." or so.
?

"""""
Running it from the wxPython GUI still needs to be tested by someone please. Config -> Working enviro -> Change default GUI

Also, I was thinking it could be useful to add an entry after 'Help->About system' like 'Help->Show system environment' which would run "set" and dump the results to the Output window. It would help in debugging.
"""""
prob add a sep line in the help menu for that and 'About System'.

Hamish

Michael wrote:

I've tested it in wxPython and it works on the Mac.

thanks.

I remember some talk about windows not having a command line.

one is available. just not at the same time as the gui.

from the OSGeo4W DOS box shell run "grass64 -text" and you get one
in the same dos box. (but no xmons) Handy for batch jobs or experts.

But in fact it does have a command line in both TclTk and
wxPython, even if it does not have a full terminal.

[internal one, see "d.mon not implemented" error window from wxPy seen
in i.class thread when a user tries to follow old-way examples]

The lack of a terminal, however, means that text and old d.m are not
available for Windows.

ok, d.m is not available in windows because of no monitors and it uses
xmons. hmm. "d.m" from the command prompt actually does launch it.
(more below)

It only can run the TclTk gis.m and wxPython GUI's.

(and stand-alone text)

I'm not sure what will happen in Windows if someone selects text or
d.m.

If you select text, next time you start grass by double clicking the
desktop icon you get the normal esc-enter screen in the dos box and
text mode.

if you select oldtcltk it opens gis.m and resets the GRASS_GUI setting to
be tcltk. (tcltk is written to be the default fail-over in init.bat)
no -help option either FWTW.

from text mode in a dos box if you type "d.m" at the command line grass
prompt d.m actually loads up. it just gives an error when you try and open
a new monitor for display. from the grass/dos prompt in text mode "g.gui tcltk" or "g.gui wxpython" do nothing.

"python %GISBASE%/etc/wxpython/wxgui.py" from text mode successfully opens
the wxPython GUI.

"gis.m" from the dos prompt gives an error that it doesn't know what to do
with .tcl files -> pick an app dialog. presumably you could associate .tcl
files with wish.exe and then it would open.

Hamish