[GRASS-dev] d.rast.edit in wxgrass

Glynn Clements glynn at gclements.plus.com
Wed Jun 27 00:38:25 EDT 2007


Daniel Calvelo wrote:

> > How do we invoke the wxPython UI as a stand-alone process?
> >
> > For the Tcl/Tk UI, G_gui() essentially does:
> >
> >         fp = popen("$GRASS_WISH", "w");
> >         fprintf(fp, "source $env(GISBASE)/etc/gui.tcl\n");
> >         generate_tcl(fp);
> >
> > We need an equivalent sequence for wxPython, e.g.:
> >
> >         fp = popen("python", "w");
> >         fprintf(fp, /* WHAT GOES HERE ? */);
> >         generate_xml(fp);
> >
> > [There isn't a generate_xml() function at present; it's called
> > G_usage_xml() and has stdout hardcoded, so that needs to be
> > re-factored.]
> 
> Currently, menuform.py if run standalone will accept one argument, the
> grass command, and will call it on its own to get back the
> --xml-description. So an execve() should be enough, I think.

IOW:
	sprintf(script, "%s/etc/wx/gui_modules/menuform.py", G_gisbase());
	execlp(script, "menuform.py", pgm_name, NULL);
	G_fatal_error(_("Unable to invoke wxPython GUI"));
?

-- 
Glynn Clements <glynn at gclements.plus.com>




More information about the grass-dev mailing list