~ubuntu-branches/ubuntu/wily/grass/wily

« back to all changes in this revision

Viewing changes to doc/gui/wxpython/example/README

Tags: 7.0.0~rc1+ds1-1~exp1
* New upstream release candidate.
* Repack upstream tarball, remove precompiled Python objects.
* Add upstream metadata.
* Update gbp.conf and Vcs-Git URL to use the experimental branch.
* Update watch file for GRASS 7.0.
* Drop build dependencies for Tcl/Tk, add build dependencies:
  python-numpy, libnetcdf-dev, netcdf-bin, libblas-dev, liblapack-dev
* Update Vcs-Browser URL to use cgit instead of gitweb.
* Update paths to use grass70.
* Add configure options: --with-netcdf, --with-blas, --with-lapack,
  remove --with-tcltk-includes.
* Update patches for GRASS 7.
* Update copyright file, changes:
  - Update copyright years
  - Group files by license
  - Remove unused license sections
* Add patches for various typos.
* Fix desktop file with patch instead of d/rules.
* Use minimal dh rules.
* Bump Standards-Version to 3.9.6, no changes.
* Use dpkg-maintscript-helper to replace directories with symlinks.
  (closes: #776349)
* Update my email to use @debian.org address.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
Motivation
 
2
----------
 
3
Example Tool should help new GRASS GUI programmers who are interested in
 
4
adding or improving GRASS GIS functionality or writing GRASS GIS GUI-based
 
5
application for their own purposes.
 
6
 
 
7
How to use Example Tool
 
8
-----------------------
 
9
Example Tool is a simple template for applications which are
 
10
supposed to display maps and make computations using GRASS modules.
 
11
It covers several often occurring tasks. It can be helpful for all
 
12
new developers who are interested in wxGUI programming.
 
13
Run Example Tool, have a look at wxGUI.Example.html and than
 
14
look at the source code to see how it works.
 
15
 
 
16
Run Example Tool
 
17
----------------
 
18
To run Example Tool can run as a standalone application (in GRASS environment)
 
19
or it can be launched from the console.
 
20
 
 
21
1. Go to GRASS root directory
 
22
 
 
23
2. Copy directory ./doc/gui/wxpython/example to ./gui/wxpython/example
 
24
 
 
25
3. Edit ./gui/wxpython/Makefile:
 
26
 
 
27
 SRCFILES := $(wildcard icons/*.* scripts/* xml/*) \
 
28
-       $(wildcard core/* dbmgr/* gcp/* gmodeler/* ... \
 
29
+       $(wildcard core/* dbmgr/* example/* gcp/* gmodeler/* ... \
 
30
 
 
31
-PYDSTDIRS := $(patsubst %,$(ETCDIR)/%,core dbmgr gcp gmodeler ... \
 
32
+PYDSTDIRS := $(patsubst %,$(ETCDIR)/%,core dbmgr example gcp gmodeler ... \
 
33
 
 
34
4. Run make (in ./gui/wxpython)
 
35
 
 
36
Now you can start the application by running
 
37
 
 
38
$ g.gui.example
 
39
 
 
40
from terminal or wxGUI command console. Try also g.gui.example --help.
 
41
 
 
42
If you want to access Example Tool from Layer Manager menu, there are
 
43
a few more things to be done.
 
44
 
 
45
5. Edit ./gui/wxpython/xml/menudata.xml. Add following code to appropriate place:
 
46
 
 
47
    <menuitem>
 
48
      <label>Example</label>
 
49
      <help>Example help (for statusbar)</help>
 
50
      <keywords>raster</keywords>
 
51
      <handler>OnExample</handler>
 
52
    </menuitem>
 
53
    
 
54
6. Add folowing event handler to class GMFrame in ./gui/wxpython/lmgr/frame.py:
 
55
 
 
56
    def OnExample(self, event):
 
57
        """!Launch ExampleTool"""
 
58
        from example.frame import ExampleMapFrame
 
59
        win = ExampleMapFrame(parent=self, giface=self._giface)
 
60
        win.CentreOnScreen()
 
61
        
 
62
        win.Show()
 
63
 
 
64
7. Run make again.
 
65
 
 
66
 
 
67
Note
 
68
----
 
69
Feel free to improve Example Tool or suggest possible improvements.