[GRASS-SVN] r54837 - grass/trunk/doc/gui/wxpython/example
svn_grass at osgeo.org
svn_grass at osgeo.org
Sat Feb 2 07:14:10 PST 2013
Author: lucadelu
Date: 2013-02-02 07:14:09 -0800 (Sat, 02 Feb 2013)
New Revision: 54837
Modified:
grass/trunk/doc/gui/wxpython/example/README
grass/trunk/doc/gui/wxpython/example/frame.py
Log:
update example of wxpython gui
Modified: grass/trunk/doc/gui/wxpython/example/README
===================================================================
--- grass/trunk/doc/gui/wxpython/example/README 2013-02-02 13:08:33 UTC (rev 54836)
+++ grass/trunk/doc/gui/wxpython/example/README 2013-02-02 15:14:09 UTC (rev 54837)
@@ -16,16 +16,23 @@
Run Example Tool
----------------
To run Example Tool can run as a standalone application (in GRASS environment)
-or it can be launched from Layer Manager menu.
+or it can be launched from the console.
1. Go to GRASS root directory
2. Copy directory ./doc/gui/wxpython/example to ./gui/wxpython/example
-3. Move file ./gui/wxpython/example/wxGUI.Example.html to ./gui/wxpython/docs/
+3. Now you should be able to run Example Tool as a standalone
+application in GRASS environment. Start GRASS GIS and start application:
-4. Edit ./gui/wxpython/Makefile:
+ > python ./gui/wxpython/example/frame.py
+If you want to add Example Tool in the compilation.
+
+4. Move file ./gui/wxpython/example/wxGUI.Example.html to ./gui/wxpython/docs/
+
+5. Edit ./gui/wxpython/Makefile:
+
SRCFILES := $(wildcard icons/*.* scripts/* xml/*) \
- $(wildcard core/* dbmgr/* gcp/* gmodeler/* ... \
+ $(wildcard core/* dbmgr/* example/* gcp/* gmodeler/* ... \
@@ -33,13 +40,8 @@
-PYDSTDIRS := $(patsubst %,$(ETCDIR)/%,core dbmgr gcp gmodeler ... \
+PYDSTDIRS := $(patsubst %,$(ETCDIR)/%,core dbmgr example gcp gmodeler ... \
-5. Run make (in ./gui/wxpython)
-
-6. Now you should be able to run Example Tool as a standalone
-application in GRASS environment. Start GRASS GIS and start application:
-
- > python ./gui/wxpython/example/frame.py
-
+6. Run make (in ./gui/wxpython)
+
If you want to access Example Tool from Layer Manager menu, there are
a few more things to be done.
Modified: grass/trunk/doc/gui/wxpython/example/frame.py
===================================================================
--- grass/trunk/doc/gui/wxpython/example/frame.py 2013-02-02 13:08:33 UTC (rev 54836)
+++ grass/trunk/doc/gui/wxpython/example/frame.py 2013-02-02 15:14:09 UTC (rev 54837)
@@ -22,15 +22,14 @@
# this enables to run application standalone (> python example/frame.py )
if __name__ == "__main__":
sys.path.append(os.path.join(os.environ['GISBASE'], "etc", "gui", "wxpython"))
-
-from gui_core.mapdisp import SingleMapFrame
-from gui_core.forms import GUI
-from mapdisp.mapwindow import BufferedWindow
-from mapdisp import statusbar as sb
-from core.render import Map
-from core.debug import Debug
-from core.gcmd import RunCommand
+from gui_core.mapdisp import SingleMapFrame
+from mapdisp.mapwindow import BufferedWindow
+from mapdisp import statusbar as sb
+from core.render import Map
+from core.debug import Debug
+from core.gcmd import RunCommand
+
import grass.script as grass
from toolbars import ExampleMapToolbar, ExampleMiscToolbar, ExampleMainToolbar
@@ -117,7 +116,7 @@
# create map window
- self.MapWindow = BufferedWindow(self, Map = self.GetMap(), frame = self)
+ self.MapWindow = BufferedWindow(self, Map = self.GetMap(), frame = self, giface = self)
# create whatever you want, here it is a widget for displaying raster info
self.info = ExampleInfoTextManager(self)
@@ -262,9 +261,9 @@
self.GetMap().DeleteAllLayers()
cmdlist = ['d.rast', 'map=%s' % name]
# add layer to Map instance (core.render)
- newLayer = self.GetMap().AddLayer(type = 'raster', command = cmdlist, l_active = True,
- name = name, l_hidden = False, l_opacity = 1.0,
- l_render = True)
+ newLayer = self.GetMap().AddLayer(ltype = 'raster', command = cmdlist, active = True,
+ name = name, hidden = False, opacity = 1.0,
+ render = True)
self.GetWindow().ZoomToMap(layers = [newLayer,], render = True)
self.currentRaster = name
More information about the grass-commit
mailing list