Re: [Boa Constr] newbie question -- using Boa for creating a drawing canvas
Status: Beta
Brought to you by:
riaan
From: Riaan B. <riaan@e.co.za> - 2002-07-05 20:57:02
|
Hi John, John Boik wrote: > > Hello Riaan, John, and all. The wraparound for the wxShapeCanvas widget > still seems to have one problem in it. I created the custom canvas, as we > discussed, but it does not seem to handle mouse events. Using wxBell() as a > test, I can get a mousedown event to ring the bell on a regular wxPanel, but > on the new canvas it causes python to crash. No message is given, just a > python crash. The applicable code is: <snipped> The problem is that you are using a wxShapeCanvas that has not been initialised properly. When it's initialised properly, it behaves and does not crash. Add the following code to your __init__ method beneath _init_ctrls: self.diagram = wxDiagram() self.diagram.SetCanvas(self.scrolledWindow1) self.scrolledWindow1.SetDiagram(self.diagram) I see you almost got this in the next mail you sent, close ;) Cheers, Riaan. |