Commit 6cc4e4b
committed
Introduce MouseButton enum for MouseEvent.
MouseButton.LEFT/MIDDLE/RIGHT is a bit less cryptic than 1/2/3 (which
remain available as MouseButton is an IntEnum).
The names LEFT/MIDDLE/RIGHT are used by both Qt and wx, with the same
inversion for left-handed mode as noted in the docstring. (Gtk uses
PRIMARY/MIDDLE/SECONDARY, which works better for left-handed mode but
seems otherwise less readable; tk just uses 1/2/3).
Changed one example to demonstrate the use; I can change the other
examples if we agree on the general approach. (That specific example
printed mouse coordinates both on move and on click, which seems a bit
redundant, so I moved the "disconnect" part to the click handler.)1 parent 921d4f4 commit 6cc4e4b
3 files changed
Lines changed: 35 additions & 18 deletions
File tree
- doc/users/next_whats_new
- examples/event_handling
- lib/matplotlib
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
7 | | - | |
| 6 | + | |
| 7 | + | |
8 | 8 | | |
9 | | - | |
| 9 | + | |
| 10 | + | |
10 | 11 | | |
11 | 12 | | |
12 | 13 | | |
| |||
19 | 20 | | |
20 | 21 | | |
21 | 22 | | |
22 | | - | |
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
29 | | - | |
30 | | - | |
31 | | - | |
32 | | - | |
33 | | - | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
34 | 32 | | |
35 | 33 | | |
36 | 34 | | |
37 | 35 | | |
38 | 36 | | |
39 | | - | |
40 | | - | |
41 | | - | |
42 | | - | |
43 | 37 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
| 36 | + | |
36 | 37 | | |
37 | 38 | | |
38 | 39 | | |
| |||
1425 | 1426 | | |
1426 | 1427 | | |
1427 | 1428 | | |
| 1429 | + | |
| 1430 | + | |
| 1431 | + | |
| 1432 | + | |
| 1433 | + | |
| 1434 | + | |
1428 | 1435 | | |
1429 | 1436 | | |
1430 | 1437 | | |
| |||
1437 | 1444 | | |
1438 | 1445 | | |
1439 | 1446 | | |
1440 | | - | |
| 1447 | + | |
| 1448 | + | |
1441 | 1449 | | |
1442 | 1450 | | |
1443 | | - | |
| 1451 | + | |
1444 | 1452 | | |
| 1453 | + | |
| 1454 | + | |
| 1455 | + | |
| 1456 | + | |
1445 | 1457 | | |
1446 | 1458 | | |
1447 | 1459 | | |
1448 | 1460 | | |
1449 | 1461 | | |
1450 | 1462 | | |
1451 | | - | |
| 1463 | + | |
1452 | 1464 | | |
1453 | 1465 | | |
1454 | | - | |
| 1466 | + | |
1455 | 1467 | | |
1456 | 1468 | | |
1457 | 1469 | | |
| |||
1470 | 1482 | | |
1471 | 1483 | | |
1472 | 1484 | | |
| 1485 | + | |
| 1486 | + | |
1473 | 1487 | | |
1474 | 1488 | | |
1475 | 1489 | | |
| |||
0 commit comments