From: Mattia B. <mb...@ds...> - 2001-10-11 19:29:00
|
> > >Any ideas why? > > > > I don't have a wxPerl at hand here, but if you draw from 'new' > > then the first paint event you get will destroy everything you painted. > > If this is just a test case, and you do the drawing from an > > event handler ( say in response to a menu/toolbar event ) then > > I need to check at home. > Eventually I indeed want to draw from an event handler, but for this > test, I'm trying to create a ScrollWindow in a frame and try to paint on > it from the constructor of the frame. The code gets executed without any > warnings or errors, but the stuff just isn't displayed. Not even after a > Refresh method or a resize ... Yes, I understood, but my explanation was not clear at all: you are doing: * create the window * draw in the window * show the window ( causes a wxEraseEvent & wxPaintEvent ) * maximize the window ( another wxEraseEvent & wxPaintEvent couple ) So whatever you draw is subsequently erased... If you do: * create the window * show the window ( causes a wxEraseEvent & wxPaintEvent ) * draw in the window Then the picture is drawn and not erased ( until you resize/refresh the window ). Hope it's clearer now Regards Mattia |