From: John Hunter <jdh2358@gm...> - 2010-10-05 14:43:22
On Mon, Oct 4, 2010 at 10:46 AM, Ademir Francisco da Silva
> Hi John ..., I hope everything goes well ...
> ( This message is only for you ... )
> I have decided to wrote this email to know if you have been working in "
> widget module " ..., as you know by 2 months ago I asked you about this and
> nothing happend since it yet. I have got the latest version of the
> matplotlib and numpy directly of the Christoph's site and after installed
> all of them my insight about it is that nothing changed, so I kindly ask you
> about your advance in resolve those problems. Just see my last 4 emails sent
> to you and matplotlib list.
> Summary ...
> ( snippet of my original code - Before they work fine but now the " cursor "
> just disappear and the " on_clicked " is not works )
> widgets.Cursor( axe, useblit = True, color = self.cor[ 477 ][ 1 ], lw = 2 )
> widgets.Button( pyplot.axes( [ .91, .1, .08, .06 ] ), self.textName[ 19 ],
> color = self.cor[ 403 ][ 1 ], hovercolor = self.cor[ 46 ][ 1 ]
> on_clicked( lambda: pyplot.close( "all" ) )
There is a recent fix in matplotlib svn that fixes the bug you may be
seeing. Specifically, if you do not save the names of the widgets you
are creating, the callbacks can disappear. So you will want to do
mycursor = widgets.Cursor( axe, useblit = True, color = self.cor[
477 ][ 1 ], lw = 2 )
mybutton = widgets.Button( pyplot.axes( [ .91, .1, .08, .06 ] ),
self.textName[ 19 ], ...)
Basically, if the names of the classes go out of scope, they are
garbage collected because we are using weak references internally to
make sure callbacks get cleaned up when they go out of scope. So if
you are creating these variables and module level, make sure they are
names with a local variable, and if you are creating them at the class
level, make sure they are saved as an instance variable.
Get latest updates about Open Source Projects, Conferences and News.