|
From: Matthias M. <Mat...@gm...> - 2007-06-26 18:31:37
|
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 On Tuesday 26 June 2007 16:35, John Hunter wrote: > On 6/26/07, Matthias Michler <Mat...@gm...> 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 |