diff --git a/doc/users/event_handling.rst b/doc/users/event_handling.rst index 0b4fdddb7e97..58154411a04c 100644 --- a/doc/users/event_handling.rst +++ b/doc/users/event_handling.rst @@ -4,7 +4,7 @@ Event handling and picking ************************** -matplotlib works with a number of user interface toolkits (wxpython, +Matplotlib works with a number of user interface toolkits (wxpython, tkinter, qt4, gtk, and macosx) and in order to support features like interactive panning and zooming of figures, it is helpful to the developers to have an API for interacting with the figure via key @@ -47,14 +47,16 @@ disconnect the callback, just call:: fig.canvas.mpl_disconnect(cid) .. note:: - The canvas retains only weak references to the callbacks. Therefore - if a callback is a method of a class instance, you need to retain - a reference to that instance. Otherwise the instance will be - garbage-collected and the callback will vanish. + The canvas retains only weak references to instance methods used as + callbacks. Therefore, you need to retain a reference to instances owning + such methods. Otherwise the instance will be garbage-collected and the + callback will vanish. + + This does not affect free functions used as callbacks. Here are the events that you can connect to, the class instances that -are sent back to you when the event occurs, and the event descriptions +are sent back to you when the event occurs, and the event descriptions: ======================= ============================================================================================= diff --git a/examples/event_handling/README.txt b/examples/event_handling/README.txt index 0f99de02dace..165cb66cb15a 100644 --- a/examples/event_handling/README.txt +++ b/examples/event_handling/README.txt @@ -1,13 +1,12 @@ .. _event_handling_examples: -Event Handling +Event handling ============== -Matplotlib supports event handling with a GUI neutral event model, so -you can connect to Matplotlib events without knowledge of what user -interface Matplotlib will ultimately be plugged in to. This has two -advantages: the code you write will be more portable, and Matplotlib -events are aware of things like data coordinate space and which axes -the event occurs in so you don't have to mess with low level -transformation details to go from canvas space to data space. Object -picking examples are also included. +Matplotlib supports :doc:`event handling` with a GUI +neutral event model, so you can connect to Matplotlib events without knowledge +of what user interface Matplotlib will ultimately be plugged in to. This has +two advantages: the code you write will be more portable, and Matplotlib events +are aware of things like data coordinate space and which axes the event occurs +in so you don't have to mess with low level transformation details to go from +canvas space to data space. Object picking examples are also included.