Revision: 5256
          http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5256&view=rev
Author:   jdh2358
Date:     2008-05-24 18:30:32 -0700 (Sat, 24 May 2008)

Log Message:
-----------
added tonys wx loan icon patch

Modified Paths:
--------------
    trunk/matplotlib/lib/matplotlib/backends/backend_wx.py

Modified: trunk/matplotlib/lib/matplotlib/backends/backend_wx.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/backends/backend_wx.py      2008-05-24 
21:05:14 UTC (rev 5255)
+++ trunk/matplotlib/lib/matplotlib/backends/backend_wx.py      2008-05-25 
01:30:32 UTC (rev 5256)
@@ -1383,9 +1383,6 @@
     matplotlib library is installed. The filename parameter should not
     contain any path information as this is determined automatically.
 
-    Bitmaps should be in XPM format, and of size 16x16 (unless you change
-    the code!). I have converted the stock GTK2 16x16 icons to XPM format.
-
     Returns a wx.Bitmap object
     """
 
@@ -1395,27 +1392,9 @@
     if not os.path.exists(bmpFilename):
         raise IOError('Could not find bitmap file "%s"; dying'%bmpFilename)
 
-    bmp =wx.Bitmap(bmpFilename, wx.BITMAP_TYPE_XPM)
+    bmp = wx.Bitmap(bmpFilename)
     return bmp
 
-def _load_pngicon(filename):
-    """
-    Load a png icon file from the backends/images subdirectory in which the
-    matplotlib library is installed. The filename parameter should not
-    contain any path information as this is determined automatically.
-
-    Returns a wx.Bitmap object
-    """
-
-    basedir = os.path.join(rcParams['datapath'],'images')
-
-    pngFilename = os.path.normpath(os.path.join(basedir, filename))
-    if not os.path.exists(pngFilename):
-        raise IOError('Could not find bitmap file "%s"; dying'%pngFilename)
-
-    png =wx.Bitmap(pngFilename, wx.BITMAP_TYPE_PNG)
-    return png
-
 class MenuButtonWx(wx.Button):
     """
     wxPython does not permit a menu to be incorporated directly into a toolbar.
@@ -1576,24 +1555,24 @@
 
         self.SetToolBitmapSize(wx.Size(24,24))
 
-        self.AddSimpleTool(_NTB2_HOME, _load_pngicon('home.png'),
+        self.AddSimpleTool(_NTB2_HOME, _load_bitmap('home.png'),
                            'Home', 'Reset original view')
-        self.AddSimpleTool(self._NTB2_BACK, _load_pngicon('back.png'),
+        self.AddSimpleTool(self._NTB2_BACK, _load_bitmap('back.png'),
                            'Back', 'Back navigation view')
-        self.AddSimpleTool(self._NTB2_FORWARD, _load_pngicon('forward.png'),
+        self.AddSimpleTool(self._NTB2_FORWARD, _load_bitmap('forward.png'),
                            'Forward', 'Forward navigation view')
         # todo: get new bitmap
-        self.AddCheckTool(self._NTB2_PAN, _load_pngicon('move.png'),
+        self.AddCheckTool(self._NTB2_PAN, _load_bitmap('move.png'),
                            shortHelp='Pan',
                            longHelp='Pan with left, zoom with right')
-        self.AddCheckTool(self._NTB2_ZOOM, _load_pngicon('zoom_to_rect.png'),
+        self.AddCheckTool(self._NTB2_ZOOM, _load_bitmap('zoom_to_rect.png'),
                            shortHelp='Zoom', longHelp='Zoom to rectangle')
 
         self.AddSeparator()
-        self.AddSimpleTool(_NTB2_SUBPLOT, _load_pngicon('subplots.png'),
+        self.AddSimpleTool(_NTB2_SUBPLOT, _load_bitmap('subplots.png'),
                            'Configure subplots', 'Configure subplot 
parameters')
 
-        self.AddSimpleTool(_NTB2_SAVE, _load_pngicon('filesave.png'),
+        self.AddSimpleTool(_NTB2_SAVE, _load_bitmap('filesave.png'),
                            'Save', 'Save plot contents to file')
 
         if wx.VERSION_STRING >= '2.5':


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Matplotlib-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-checkins

Reply via email to