[SciPy-dev] wxplt

Jochen Küpper jochen at jochen-kuepper.de
Wed Oct 24 00:26:15 CDT 2001


Patch against current cvs, cleaning up wildcard handling a bit and
fixing a typo.

Index: plt/wxplt.py
===================================================================
RCS file: /home/cvsroot/world/scipy/plt/wxplt.py,v
retrieving revision 1.7
diff -u -r1.7 wxplt.py
--- plt/wxplt.py        2001/08/09 20:46:07     1.7
+++ plt/wxplt.py        2001/10/24 05:25:03
@@ -564,14 +564,13 @@
 
     def OnFileSaveAs(self, event):
         import os
-        dlg = wx.wxFileDialog(self, "Save As", ".", "", "*.*", wx.wxSAVE)
         wildcard = "PNG files (*.png)|*.png|" \
                    "BMP files (*.bmp)|*.bmp|" \
                    "JPEG files (*.jpg)|*.jpg|" \
                    "PCX files (*.pcx)|*.pcx|" \
-                   "TIFF files (*.tif)|*.tif"
-        dlg.SetWildcard(wildcard)
-        dlg.SetWildcard(wildcard)
+                   "TIFF files (*.tif)|*.tif|" \
+                   "All Files |*|"
+        dlg = wx.wxFileDialog(self, "Save As", ".", "", wildcard, wx.wxSAVE)
         if dlg.ShowModal() == wx.wxID_OK:
             f = dlg.GetPath()
             dummy, ftype = os.path.splitext(f)
@@ -581,13 +580,14 @@
                 self.client.save(dlg.GetPath(),ftype)
             else:
                 msg = "Extension is currently used to determine file type." \
-                      "'%s' is not a vaild extension."  \
+                      "'%s' is not a valid extension."  \
                       "You may use one of the following extensions. %s" \
                           % (ftype,image_type_map.keys())
                 d = wx.wxMessageDialog(self,msg,style=wx.wxOK)
                 d.ShowModal()
                 d.Destroy()
-        dlg.Destroy()
+        dlg.Destroy()
+
     def OnFileExit(self, event):
         self.Close()

Greetings,
Jochen
-- 
Einigkeit und Recht und Freiheit                http://www.Jochen-Kuepper.de
    Liberté, Égalité, Fraternité                GnuPG key: 44BCCD8E
        Sex, drugs and rock-n-roll




More information about the Scipy-dev mailing list