Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit eaf2c33

Browse files
committed
updated keypress examples
svn path=/trunk/matplotlib/; revision=829
1 parent 6eb3395 commit eaf2c33

4 files changed

Lines changed: 20 additions & 1 deletion

File tree

TODO

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -614,4 +614,6 @@ ZeroDivisionError: SeparableTransformation::eval_scalars yin interval is zero; c
614614

615615
-- DONE mathtext color is wrong in PS
616616

617-
-- reverse pie rotation
617+
-- CLOSED reverse pie rotation
618+
619+
-- check keypress event handling on tooggle_images.

examples/keypress_demo.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,10 @@
1+
"""
2+
Show how to connect to keypress events
13
4+
Note, on the wx backend on some platforms (eg linux), you have to
5+
first click on the figure before the keypress events are activated.
6+
If you know how to fix this, please email us!
7+
"""
28
from pylab import *
39

410
def press(event):

examples/toggle_images.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,11 @@
99
1010
As usual, we'll define some random images for demo. Real data is much more
1111
exciting!
12+
13+
Note, on the wx backend on some platforms (eg linux), you have to
14+
first click on the figure before the keypress events are activated.
15+
If you know how to fix this, please email us!
16+
1217
"""
1318

1419
from pylab import *

lib/matplotlib/backends/backend_template.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -265,6 +265,12 @@ class FigureCanvasTemplate(FigureCanvasBase):
265265
Public attribute
266266
267267
figure - A Figure instance
268+
269+
Note GUI templates will want to connect events for button presses,
270+
mouse movements and key presses to functions that call the base
271+
class methods button_press_event, button_release_event,
272+
motion_notify_event, key_press_event, and key_release_event. See,
273+
eg backend_gtk.py, backend_wx.py and backend_tkagg.py
268274
"""
269275

270276
def draw(self):

0 commit comments

Comments
 (0)