CursorTool set position

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

CursorTool set position

Barth
Hello,

...still with my questions about CursorTools.

I am working on a set of tools to control and use two cursors on a plot.

I create two cursors thanks to a toolbar button:

csr1 = CursorTool(img_plot,drag_button="right",color='blue')
self.cursor1 = csr1
csr1.current_position = min(x)+1.0/3.0*(max(x)-min(x)),
min(y)+1.0/3.0*(max(y)-min(y))
img_plot.overlays.append(csr1)

csr2 = CursorTool(img_plot,drag_button="right",color='white')
self.cursor2 = csr2
csr2.current_position = min(x)+2.0/3.0*(max(x)-min(x)),
min(y)+2.0/3.0*(max(y)-min(y))
img_plot.overlays.append(csr2)

When i do this, it draws on the image plot "img_plot" the two cursors, at a
certain position.
I also create a new window that serves as a set of tools to use this
cursors.
In this window i want to place a button that sets a new value for the
"current_position" of the cursors.

I tried:
csr1.current_position=new_position

but it did not modify the position of the cursors on the plot. Can someone
tell me how i could force the plot to redraw the cursors at the new
position ?

Thanks a lot

Pierre
_______________________________________________
Enthought-Dev mailing list
[hidden email]
https://mail.enthought.com/mailman/listinfo/enthought-dev