Phoenix Logo

phoenix_title wx.lib.floatcanvas.NavCanvas

Combines FloatCanvas with Navigation controls onto a Panel

In the following very simple sample self is a frame, but it could be another container type control:

from wx.lib.floatcanvas import NavCanvas, FloatCanvas

#Add the Canvas
self.Canvas = NavCanvas.NavCanvas(self, -1,
                             size=(500, 500),
                             ProjectionFun=None,
                             Debug=0,
                             BackgroundColor="White",
                             ).Canvas

# add a circle
cir = FloatCanvas.Circle((10, 10), 100)
self.Canvas.AddObject(cir)

# add a rectangle
rect = FloatCanvas.Rectangle((110, 10), (100, 100), FillColor='Red')
self.Canvas.AddObject(rect)

self.Canvas.Draw()

Many samples are available in the wxPhoenix/samples/floatcanvas folder.

class_summary Classes Summary

NavCanvas NavCanvas encloses a