From: Christian M. <mee...@un...> - 2005-05-31 07:37:41
|
One - hopefully final - update: As some might remember my original snippet was this: class SAXS_wx(wx.Frame): def __init__(self,parent,id,title): wx.Frame.__init__(self,None,-1,"SPlot") <snip> self.fig = Figure(figsize=(5,4),dpi=100) self.axes = self.fig.add_subplot(111) self.canvas = FigureCanvas(self, -1, self.fig) self.parent = self.canvas.GetParent() self.canvas.mpl_connect('motion_notify_event',self.mouse_move) sizer = wx.BoxSizer(wx.VERTICAL) self.sizer = sizer sizer.Add(self.canvas, 1, wx.LEFT|wx.TOP|wx.GROW|wx.EXPAND) self.add_splot_toolbar() self.SetSizer(self.sizer) self.Fit() The problem was that changing the figsize parameter had no effect on the frame size. Changing to self.SetSizer(self.sizer) self.Fit() self.add_splot_toolbar() solved the problem, where add_splot_toolbar() - a toolbar function very much like the 2nd toolbar in the wx examples - is added only just after arranging the sizer. I was unable to arrange the toolbar with the sizer - regardless of the sizer and the layout I used. Hence the problem is definitively wx-related, possibly together with a problem in Panther's framework, since I find the old sequence of commands in the examples and the misbehaving canvas there as well. May I suggest adding a comment in the examples for OSX users so that they are aware of a possible conflict there? Thanks once more, Christian |