File: readme.txt

package info (click to toggle)
python-enable 4.1.0-1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 7,220 kB
  • sloc: cpp: 57,417; python: 28,437; makefile: 314; sh: 43
file content (41 lines) | stat: -rw-r--r-- 1,529 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
[Importing Kiva]

To import kiva, you need to get the constants (which includes pen styles,
cap styles, lines styles, etc.), the font stuff, and a backend.  You can
import these all together with a wildcard:

    from kiva import *

If you prefer to get the constants by themselves, you can also do a:

    import kiva

and this will allow you to refer to them as kiva.JOIN_MITER, kiva.CAP_ROUND,
etc.

If you don't wish to do a wildcard import, you can also just grab the
following by themselves:

    from kiva import Font, CompiledPath, GraphicsContext,
                               Canvas, CanvasWindow

This will auto-detect what backend is appropriate based on the OS platform,
available libraries, and the order of backends listed in the KIVA_WISHLIST
environment variable.  If this environment variable is not defined, then the
default ordering of backends is in __init__.py.

If you want to choose what backend gets used, you can do the following:

    from kiva.backend_<backend> import GraphicsContext, Canvas, CanvasWindow

<backend> is one of:
    image   - in-memory GraphicsContext, uses Agg to raster, can save out to any PIL format
    wx    - uses Agg to raster to a platform-dependent wx window
    wx_gl - uses Agg to raster into a platform-dependent wx.glcanvas
    gl    - uses OpenGL module to draw into a GL window
    mac   - calls Quartz drawing routines into an OS X window/GraphicsContext
    ps    - PostScript file output
    svg   - SVG file output
    pdf   - PDF file output (uses ReportLab)