@@ -81,8 +81,8 @@ class FigureCanvasQT( qt.QWidget, FigureCanvasBase ):
8181 buttond = {1 :1 , 2 :3 , 4 :2 }
8282 def __init__ ( self , figure ):
8383 if DEBUG : print 'FigureCanvasQt: ' , figure
84- FigureCanvasBase .__init__ ( self , figure )
8584 qt .QWidget .__init__ ( self , None , "QWidget figure" )
85+ FigureCanvasBase .__init__ ( self , figure )
8686 self .figure = figure
8787 self .setMouseTracking ( True )
8888
@@ -220,7 +220,7 @@ def _get_toolbar(self, canvas, parent):
220220 toolbar = None
221221 return toolbar
222222
223- def set_canvas_size (self , width , height ):
223+ def resize (self , width , height ):
224224 'set the canvas size in pixels'
225225 self .window .resize (width , height )
226226
@@ -329,7 +329,7 @@ def draw_rubberband( self, event, x0, y0, x1, y1 ):
329329 self .canvas .drawRectangle ( rect )
330330
331331 def configure_subplots (self ):
332- self .adj_window = qt .QMainWindow ()
332+ self .adj_window = qt .QMainWindow (None , None , qt . Qt . WDestructiveClose )
333333 win = self .adj_window
334334 win .setCaption ("Subplot Configuration Tool" )
335335
@@ -339,6 +339,7 @@ def configure_subplots(self):
339339 h = int (toolfig .bbox .height ())
340340
341341 canvas = self ._get_canvas (toolfig )
342+ self .canvas .figure .canvas = self .canvas # Weirdness but needed
342343 tool = SubplotTool (self .canvas .figure , toolfig )
343344 centralWidget = qt .QWidget (win )
344345 canvas .reparent (centralWidget , qt .QPoint (0 , 0 ))
0 commit comments