@@ -361,6 +361,25 @@ static CGFloat _get_device_scale(CGContextRef cr)
361
361
Py_RETURN_NONE;
362
362
}
363
363
364
+ static PyObject*
365
+ FigureCanvas_set_cursor (PyObject* unused, PyObject* args)
366
+ {
367
+ int i;
368
+ if (!PyArg_ParseTuple (args, " i" , &i)) { return NULL ; }
369
+ switch (i) {
370
+ case 1 : [[NSCursor arrowCursor ] set ]; break ;
371
+ case 2 : [[NSCursor pointingHandCursor ] set ]; break ;
372
+ case 3 : [[NSCursor crosshairCursor ] set ]; break ;
373
+ case 4 : [[NSCursor openHandCursor ] set ]; break ;
374
+ /* OSX handles busy state itself so no need to set a cursor here */
375
+ case 5 : break ;
376
+ case 6 : [[NSCursor resizeLeftRightCursor ] set ]; break ;
377
+ case 7 : [[NSCursor resizeUpDownCursor ] set ]; break ;
378
+ default : return NULL ;
379
+ }
380
+ Py_RETURN_NONE;
381
+ }
382
+
364
383
static PyObject*
365
8000
td>384
FigureCanvas_set_rubberband (FigureCanvas* self, PyObject *args)
366
385
{
@@ -489,14 +508,18 @@ static CGFloat _get_device_scale(CGContextRef cr)
489
508
(PyCFunction)FigureCanvas_flush_events,
490
509
METH_NOARGS,
491
510
NULL }, // docstring inherited
511
+ {" set_cursor" ,
512
+ (PyCFunction)FigureCanvas_set_cursor,
513
+ METH_VARARGS,
514
+ " Set the active cursor." },
492
515
{" set_rubberband" ,
493
516
(PyCFunction)FigureCanvas_set_rubberband,
494
517
METH_VARARGS,
495
- " Specifies a new rubberband rectangle and invalidates it." },
518
+ " Specify a new rubberband rectangle and invalidate it." },
496
519
{" remove_rubberband" ,
497
520
(PyCFunction)FigureCanvas_remove_rubberband,
498
521
METH_NOARGS,
499
- " Removes the current rubberband rectangle." },
522
+ " Remove the current rubberband rectangle." },
500
523
{" start_event_loop" ,
501
524
(PyCFunction)FigureCanvas_start_event_loop,
502
525
METH_KEYWORDS | METH_VARARGS,
@@ -1020,25 +1043,6 @@ -(void)save_figure:(id)sender { gil_call_method(toolbar, "save_figure"); }
1020
1043
Py_RETURN_NONE;
1021
1044
}
1022
1045
1023
- static PyObject*
1024
- set_cursor (PyObject* unused, PyObject* args)
1025
- {
1026
- int i;
1027
- if (!PyArg_ParseTuple (args, " i" , &i)) { return NULL ; }
1028
- switch (i) {
1029
- case 1 : [[NSCursor arrowCursor ] set ]; break ;
1030
- case 2 : [[NSCursor pointingHandCursor ] set ]; break ;
1031
- case 3 : [[NSCursor crosshairCursor ] set ]; break ;
1032
- case 4 : [[NSCursor openHandCursor ] set ]; break ;
1033
- /* OSX handles busy state itself so no need to set a cursor here */
1034
- case 5 : break ;
1035
- case 6 : [[NSCursor resizeLeftRightCursor ] set ]; break ;
1036
- case 7 : [[NSCursor resizeUpDownCursor ] set ]; break ;
1037
- default : return NULL ;
1038
- }
1039
- Py_RETURN_NONE;
1040
- }
1041
-
1042
1046
@implementation WindowServerConnectionManager
1043
1047
static WindowServerConnectionManager *sharedWindowServerConnectionManager = nil ;
1044
1048
@@ -1916,10 +1920,6 @@ static void context_cleanup(const void* info)
1916
1920
(PyCFunction)choose_save_file,
1917
1921
METH_VARARGS,
1918
1922
" Query the user for a location where to save a file." },
1919
- {" set_cursor" ,
1920
- (PyCFunction)set_cursor,
1921
- METH_VARARGS,
1922
- " Set the active cursor." },
1923
1923
{} /* Sentinel */
1924
1924
},
1925
1925
};