|
From: <lee...@us...> - 2010-01-11 19:54:40
|
Revision: 8077
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=8077&view=rev
Author: leejjoon
Date: 2010-01-11 19:54:32 +0000 (Mon, 11 Jan 2010)
Log Message:
-----------
Tk backend supports Figure.set_size_inches with the forward parameter.
Modified Paths:
--------------
trunk/matplotlib/lib/matplotlib/backends/backend_tkagg.py
Modified: trunk/matplotlib/lib/matplotlib/backends/backend_tkagg.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/backends/backend_tkagg.py 2010-01-11 19:23:13 UTC (rev 8076)
+++ trunk/matplotlib/lib/matplotlib/backends/backend_tkagg.py 2010-01-11 19:54:32 UTC (rev 8077)
@@ -367,11 +367,24 @@
self.canvas.figure.show = lambda *args: self.show()
- def resize(self, event):
- width, height = event.width, event.height
- self.toolbar.configure(width=width) # , height=height)
+ def resize(self, width, height=None):
+ # before 09-12-22, the resize method takes a single *event*
+ # parameter. On the other hand, the resize method of other
+ # FigureManager class takes *width* and *height* parameter,
+ # which is used to change the size of the window. For the
+ # Figure.set_size_inches with forward=True work with Tk
+ # backend, I changed the function signature but tried to keep
+ # it backward compatible. -JJL
+ # when a single parameter is given, consider it as a event
+ if height is None:
+ width = width.width
+ else:
+ self.canvas._tkcanvas.master.geometry("%dx%d" % (width, height))
+ self.toolbar.configure(width=width)
+
+
def show(self):
"""
this function doesn't segfault but causes the
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|