David Poundall wrote:
> Thanks for getting back to me Stef ...
> 
> It turns out that the dxy parameter I was passing back was a delta, not an
> absolute. 

beat me to it!


However:

> I have all canvas objects with default and extended properties being 
> tracked using a
> 
> properties dictionary attached to each object instance.

I've been thinking about this myself. I should probably re-factor so 
that all the Properties that one might want to alter (really all the 
ones that get passed in) are all stored in a single dict inside the 
object. This would present a more unified interface for this sort of 
thing. I'm also thinking about using Enthought traits for this -- and 
that would give us a GUI for free:

http://code.enthought.com/traits/


> is destroyed and rebuilt on a canvas redraw as the objects themselves are 
> similarly 
> destroyed and redrawn.

The Objects shouldn't be destroyed on each re-draw! Not in the least -- 
they just have their _draw methods called --a little coordinate 
conversion and drawing is it.


> Each objects property dictionary is built when the new object is placed 
> on the canvas.

That makes sense.

> For this reason, my properties dictionary effectively holds the ‘args’ 
> and ‘kwargs’ that are
> 
> used to generate the FloatCanvas object in the first place. 

Right. One thing to think about. Even without a re-factor, internally, 
all an Objects attributes are stored in  dict. You may be able to work 
with that, rather than mirroring it in a properties dict. You also may 
be able to define the interface of each object without haveing a 
properties dict either.


> This works well and allows me to throw up a properties frame for each 
> object.  This will end up being a VB style property control for all of the 
> object on the 
> canvas.

I"m not familar with VB -- but I think I get the idea.

> print object_Instance.props[‘XY’] would show as (5,5) say.  Not 
> [5.0000000 5.0000000]

Why would you want that? One of the points of FloatCanvas is that the it 
uses floating point coordinates.

> I am using the movingelements.py code to generate a new target position

A note here -- it may be a good idea to use GUIModes to define this sort 
of stuff -- I'm working on refactoring this kind of thing. I like the 
idea, as it puts eveything in one place for a given type of interaction 
-- and avoids a lot of if .. elif... structures.

See Tests/EditingModes in SVN to see what I'm up to.

>  and I send this to my new class to using
>                 self.DL.ObjMove(self.MovingObject, dxy)                    

> My DL (DrawingList) class handles canvas redraw using any revised
> object information passed through the properties dictionary. 

hmmm -- it handles the re-draw? Or does it jsut change the properties 
that need changing, then call FloatCanvas.Draw(force=True)?

> In the above case there will be new XY information sent for the move.

Oh, and you may want:

DrawObject.SetPoint()

Though only XYObjects have that, and they all should have a Move() method.

-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

Reply via email to