Hi Chris, I checked : EVT_SIZE *is* triggered when maximizing, so there is no need to Bind with EVT_MAXIMIZE. But still the problem is there : the image is not resized when maximing (with ScaledBitmap2Demo.py that you sent me). Could you try if you have the same problem on your platform ?
I may have an idea for the reason : when maximing, there is a *delay* for self.Canvas to be resized. When maximing, OnSize is called and : * print self.GetSize() shows the new full size of the Frame * print self.Canvas.GetSize() still shows the old size ! * then the resizing of the image cannot be done properly because at this time, self.Canvas stil has the "old" size. So the problem might me linked with the "delay" problem that we discussed in the other topic today : https://dl.dropboxusercontent.com/u/83031018/slowresize.gif. Do you think it could be this ? Thank you, Jo ----------------------------------- Here is the latest code : import wx from floatcanvas import FloatCanvas class DrawFrame(wx.Frame): def __init__(self, *args, **kwargs): wx.Frame.__init__(self, *args, **kwargs) self.Canvas = FloatCanvas.FloatCanvas(self, ProjectionFun = None, BackgroundColor = "LIGHT GREY") image = wx.Image("background.png") img = FloatCanvas.ScaledBitmap2( image, (0,0), Height=image.GetHeight(), Position = 'tl') self.Canvas.AddObject(img) self.Bind(wx.EVT_SIZE, self.OnSize) self.Show() self.Canvas.ZoomToBB() def OnSize(self, event): print self.GetSize() print self.Canvas.GetSize() self.Canvas.ZoomToBB() event.Skip() app = wx.App(False) F = DrawFrame(None, title="FloatCanvas Demo App", size=(700,700) ) app.MainLoop() 2014-01-28 Chris Barker <[email protected]> > On Tue, Jan 28, 2014 at 4:10 AM, Joseph Basquin > <[email protected]>wrote: > >> Thanks a lot for the example. It now works perfectly, except when I >> maximize / restore the window. It seems that maximizing the window doesn't >> trigger EVT_SIZE. What should I bind for that in your opinion ? >> >> I"ve never used it, but it looks like there is an EVT_MAXIMIZE > > Odd that EVT_SIZE doesn't get triggered, though.... > > -Chris >
_______________________________________________ FloatCanvas mailing list [email protected] http://mailman.paulmcnett.com/cgi-bin/mailman/listinfo/floatcanvas
