Aki Koskinen wrote: > now I'm here:) Welcome.
> it might be that previously I was doing > something like this: > > R = FloatCanvas.Rectangle((x,y), (w, h)) > R.Bind(FloatCanvas.EVT_FC_LEFT_DOWN, someHandler) > ...and got an exception in the Bind method about _Canvas being None. That could be -- I don't think you can bind an event to an object that is not on a Canvas -- though I would like to clean that up some day. >> I wonder if that's the best approach, or if I should create a Null >> bounding box object.... I've created a Null Bounding box constructor: BBox.NullBBox() What it creates is a BBox with all NaN entries. I've also added special case code in the various BBox methods to handle it correctly, and added test cases to test. I then did some cleaning up of the FloatCanvas code to work with these. I also added an InfBBox() that is infinitely large, but I'm not sure if that will be useful. I started out with a special class for the NullBBox, but then I couldn't figure out how to change it into a non-Null BBox when .Merge() was called. If anyone knows how I could do that, it may be a better way to go -- that way it could be a singleton, and it would be easier to test for it: if BB is BBox.NullBBox: would be better than: if BB.IsNull() or at least faster! > Maybe I went ahead of myself telling how things should be done. Not at all -- a suggested patch is always welcome! We just might use it, but even if not it makes it very clear what the problem is you're running in to, and that you've put the effort in to figure it out -- that makes me far more willing to dig into the problem. I'm Looking forward to further contributions! -Chris -- Christopher Barker, Ph.D. Oceanographer Emergency Response Division NOAA/NOS/OR&R (206) 526-6959 voice 7600 Sand Point Way NE (206) 526-6329 fax Seattle, WA 98115 (206) 526-6317 main reception [email protected] _______________________________________________ FloatCanvas mailing list [email protected] http://mail.mithis.com/cgi-bin/mailman/listinfo/floatcanvas
