activate/deactivate RectangleSelector

Hello list,

refering to the thread 'activate/deactivate RectangleSelector' of the
developer-mailing-list I thought a bit about the problem because I found it
quite irritating that the RS couldn't be stopped during zooming.

I attached a patch including Martin's example and my proposal to (de)activate
RectangleSelector including deactivation during zoom mode.

I hope this is helpful for others too and can be part of matplotlib.

best regards,
Matthias

PS: Should I send those mails to developer mailing list?

RS_activate.patch (3.74 KB)

Hello everybody,

first of all: Sorry for posting to my own thread.
But I really like this new feature and may be the last message got lost among
the lots of mpl-mails. So I ask you once more for comments on this issue
(please).

Is this new feature a bug to some of the RectangleSelector-users or a real
feature?
Could it be part of mpl?

Thanks in advance for any comments.
Matthias Michler

···

On Thursday 03 May 2007 18:22, Matthias Michler wrote:

Hello list,

refering to the thread 'activate/deactivate RectangleSelector' of the
developer-mailing-list I thought a bit about the problem because I found it
quite irritating that the RS couldn't be stopped during zooming.

I attached a patch including Martin's example and my proposal to
(de)activate RectangleSelector including deactivation during zoom mode.

I hope this is helpful for others too and can be part of matplotlib.

best regards,
Matthias

PS: Should I send those mails to developer mailing list?

Thanks for reminding us on this one. Making these widgets work well
together can be a pain. I wrote some locking functionality to help
coordinate them, is any of this functionality useful to you?

The patch looks mostly correct, but the code trying to get the toolbar
state is problematic

+ # If zoom mode was activated
+ if not (Gcf.get_active().toolbar.mode == ''):
+ return True

···

On 6/26/07, Matthias Michler <MatthiasMichler@...361...> wrote:

Hello everybody,

first of all: Sorry for posting to my own thread.
But I really like this new feature and may be the last message got lost among
the lots of mpl-mails. So I ask you once more for comments on this issue
(please).

Is this new feature a bug to some of the RectangleSelector-users or a real
feature?
Could it be part of mpl?

+

Gcf is a pylab construct, and code in widgets must not be dependent on
pylab. Also, using the mode string here looks a bit hackish since it
is designed to communicate to the user rather than represent state.
See if you can use the lock functionality to achieve the same purpose
-- eg look at how widgetlock is used in the toolbar in backend_bases.
If this is not viable, let me know why and we'll figure a better way
for these widgets to communicate.

JDH

Hello John,

thank you for your reply.
I'm not sure I really understood the widgetlock, but I think the following
lines seem to do what I want - (Am I right?):

+ # If canvas was locked
+ if not self.canvas.widgetlock.available(self):
+ return True

I attached once more my patch including these new lines.

best regards,
Matthias

RS_activate_2.patch (3.55 KB)

···

On Tuesday 26 June 2007 16:35, John Hunter wrote:

On 6/26/07, Matthias Michler <MatthiasMichler@...361...> wrote:
> Hello everybody,
>
> first of all: Sorry for posting to my own thread.
> But I really like this new feature and may be the last message got lost
> among the lots of mpl-mails. So I ask you once more for comments on this
> issue (please).
>
> Is this new feature a bug to some of the RectangleSelector-users or a
> real feature?
> Could it be part of mpl?

Thanks for reminding us on this one. Making these widgets work well
together can be a pain. I wrote some locking functionality to help
coordinate them, is any of this functionality useful to you?

The patch looks mostly correct, but the code trying to get the toolbar
state is problematic

+ # If zoom mode was activated
+ if not (Gcf.get_active().toolbar.mode == ''):
+ return True
+

Gcf is a pylab construct, and code in widgets must not be dependent on
pylab. Also, using the mode string here looks a bit hackish since it
is designed to communicate to the user rather than represent state.
See if you can use the lock functionality to achieve the same purpose
-- eg look at how widgetlock is used in the toolbar in backend_bases.
If this is not viable, let me know why and we'll figure a better way
for these widgets to communicate.

JDH

Hello developers,

I'm sorry for reposting again. I really would like to have this feature in
mpl.
Please let me know if there is anything I can do to change my proposal to make
it match with matplotlib.

thanks in advance and best regards,
Matthias

Committed to svn revision 3867 -- thanks for the patch and reminder.

JDH

···

On 9/20/07, Matthias Michler <MatthiasMichler@...361...> wrote:

Hello developers,

I'm sorry for reposting again. I really would like to have this feature in
mpl.
Please let me know if there is anything I can do to change my proposal to make
it match with matplotlib.