Here are a couple more wx documentation glitches:
The correct Metafile DC class name is "wxMetaFileDC" with a capital F. The
documentation uses a small f, but wxPython 2.1.15 does not recognize the
name when it is spelled that way.
I get an attribute error trying to invoke wxMakeMetafilePlaceable(), even
if I spell it with a capital F, but I can still insert my picture file into
an MS Word document and view it anyway.
The code looks like this:
def saveAsFile(self, filename=_DEFAULT_FILENAME):
"""Save once-drawn graphics to file"""
if self.LastDrawn is not None:
try:
dc = wx.wxMetaFileDC(filename)
except:
print "Failed to create Metafile DC for ", filename
dc = None
return
if dc.Ok:
apply(self.draw, self.LastDrawn + (dc,))
(x0, y0, x1, y1) = (dc.MinX(), dc.MinY(), dc.MaxX(),
dc.MaxY())
mf = dc.Close()
mf = None
### wx.wxMakeMetafilePlaceable(filename, x0, y0, x1, y1)
dc = None
Jim Dukarm
DELTA-X RESEARCH