[GRASS-dev] 'g.gui wxpython' won't work in wingrass as wxgui is a shell script

Martin Landa landa.martin at gmail.com
Wed Feb 27 15:05:49 EST 2008


Hi,

2008/2/21, Glynn Clements <glynn at gclements.plus.com>:

>  Moritz Lennert wrote:
>  > as wxgui is a shell script, g.gui wxpython (which does:
>  >
>  >  else if (strcmp(type->answer, "wxpython") == 0) {
>  >         sprintf (progname, "%s/etc/wxpython/scripts/wxgui", G_gisbase());
>  >         if (rc_file->answer) {
>  >             G_spawn(progname, "wxgui", rc_file->answer, NULL);
>  > )
>  >
>  > will not work.

since gis.m and d.m are also shell scripts, g.gui tcltk|oldtcktk will
not work too(?)

>  > I don't really see the need for this script and it is a nuisance for
>  > wingrass ot require a shell to launch the python gui...
>
>
> Right; it may as well just do:
>
>         sprintf(progname, "%s/etc/wxpython/wxgui.py", G_gisbase());
>         if (rc_file->answer) {
>             G_spawn("python", "wxgui", progname, "--workspace", rc_file->answer, NULL);
>         }
>         else {
>             G_spawn("python", "wxgui", progname, NULL);
>         }
>
>  AFAICT, the only reason for making g.gui a C program rather than a
>  script is so that you don't need a Bourne shell (MSys etc) to start
>  the GUI.

There is one problem, when you run `g.gui wxpython`, the program is
waiting for thread termination. So you cannot use xterm when wxGUI is
running. I am not sure how to fix it since I am not so familiar with
G_spawn*.

Martin

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


More information about the grass-dev mailing list