Revision: 5213
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5213&view=rev
Author: jdh2358
Date: 2008-05-22 07:21:10 -0700 (Thu, 22 May 2008)
Log Message:
-----------
applied stans wx figsize patch
Modified Paths:
--------------
branches/v0_91_maint/lib/matplotlib/backends/backend_wx.py
branches/v0_91_maint/lib/matplotlib/figure.py
Modified: branches/v0_91_maint/lib/matplotlib/backends/backend_wx.py
===================================================================
--- branches/v0_91_maint/lib/matplotlib/backends/backend_wx.py 2008-05-21
16:08:26 UTC (rev 5212)
+++ branches/v0_91_maint/lib/matplotlib/backends/backend_wx.py 2008-05-22
14:21:10 UTC (rev 5213)
@@ -1286,14 +1286,15 @@
pos =wx.Point(20,20)
l,b,w,h = fig.bbox.get_bounds()
wx.Frame.__init__(self, parent=None, id=-1, pos=pos,
- title="Figure %d" % num,
- size=(w,h))
+ title="Figure %d" % num)
+ # Frame will be sized later by the Fit method
DEBUG_MSG("__init__()", 1, self)
self.num = num
statbar = StatusBarWx(self)
self.SetStatusBar(statbar)
self.canvas = self.get_canvas(fig)
+ self.canvas.SetInitialSize(wx.Size(fig.bbox.width(),
fig.bbox.height()))
self.sizer =wx.BoxSizer(wx.VERTICAL)
self.sizer.Add(self.canvas, 1, wx.TOP | wx.LEFT | wx.EXPAND)
# By adding toolbar in sizer, we are able to put it at the bottom
@@ -1412,6 +1413,11 @@
def set_window_title(self, title):
self.window.SetTitle(title)
+ def resize(self, width, height)
+ 'Set the canvas size in pixels'
+ self.canvas.SetInitialSize(wx.Size(width, height))
+ self.window.GetSizer().Fit(self.window)
+
# Identifiers for toolbar controls - images_wx contains bitmaps for the images
# used in the controls. wxWindows does not provide any stock images, so I've
# 'stolen' those from GTK2, and transformed them into the appropriate format.
Modified: branches/v0_91_maint/lib/matplotlib/figure.py
===================================================================
--- branches/v0_91_maint/lib/matplotlib/figure.py 2008-05-21 16:08:26 UTC
(rev 5212)
+++ branches/v0_91_maint/lib/matplotlib/figure.py 2008-05-22 14:21:10 UTC
(rev 5213)
@@ -327,6 +327,7 @@
from the shell
WARNING: forward=True is broken on all backends except GTK*
+ and WX*
ACCEPTS: a w,h tuple with w,h in inches
"""
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