Add the FloatCanvas demo modules

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxPython/Phoenix/trunk@73860 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robin Dunn
2013-04-26 07:04:14 +00:00
parent e31baa0d8e
commit c7cd5d5fe9
41 changed files with 6278 additions and 0 deletions

43
samples/floatcanvas/NonGUI.py Executable file
View File

@@ -0,0 +1,43 @@
#!/usr/bin/env python
"""
Demo of a FloatCanvas App that will create an image, without
actually showing anything on screen. It seems to work, but you do need
to have an X-server running on *nix for this to work.
Note: you need to specify the size in the FloatCanvas Constructor.
hmm -- I wonder if you'd even need the frame?
"""
import wx
## import the installed version
from wx.lib.floatcanvas import FloatCanvas
## import a local version
#import sys
#sys.path.append("../")
#from floatcanvas import NavCanvas, FloatCanvas
app = wx.PySimpleApp()
f = wx.Frame(None)
Canvas = FloatCanvas.FloatCanvas(f,
BackgroundColor = "Cyan",
size=(500,500)
)
Canvas.AddRectangle((0,0), (16,20))
Canvas.AddRectangle((1,1), (6,8.5))
Canvas.AddRectangle((9,1), (6,8.5))
Canvas.AddRectangle((9,10.5), (6,8.5))
Canvas.AddRectangle((1,10.5), (6,8.5))
Canvas.ZoomToBB()
print "Saving the image:", "junk.png"
Canvas.SaveAsImage("junk.png")