@@ -349,8 +349,10 @@ - (void)mouseDragged:(NSEvent*)event;
349
349
- (void )mouseMoved : (NSEvent *)event ;
350
350
- (void )rightMouseDown : (NSEvent *)event ;
351
351
- (void )rightMouseUp : (NSEvent *)event ;
352
+ - (void )rightMouseDragged : (NSEvent *)event ;
352
353
- (void )otherMouseDown : (NSEvent *)event ;
353
354
- (void )otherMouseUp : (NSEvent *)event ;
355
+ - (void )otherMouseDragged : (NSEvent *)event ;
354
356
- (void )setRubberband : (NSRect )rect ;
355
357
- (void )removeRubberband ;
356
358
- (const char *)convertKeyEvent : (NSEvent *)event ;
@@ -4744,6 +4746,23 @@ - (void)rightMouseUp:(NSEvent *)event
4744
4746
PyGILState_Release (gstate);
4745
4747
}
4746
4748
4749
+ - (void )rightMouseDragged : (NSEvent *)event
4750
+ {
4751
+ int x, y;
4752
+ NSPoint location = [event locationInWindow ];
4753
+ location = [self convertPoint: location fromView: nil ];
4754
+ x = location.x ;
4755
+ y = location.y ;
4756
+ PyGILState_STATE gstate = PyGILState_Ensure ();
4757
+ PyObject* result = PyObject_CallMethod (canvas, " motion_notify_event" , " ii" , x, y);
4758
+ if (result)
4759
+ Py_DECREF (result);
4760
+ else
4761
+ PyErr_Print ();
4762
+
4763
+ PyGILState_Release (gstate);
4764
+ }
4765
+
4747
4766
- (void )otherMouseDown : (NSEvent *)event
4748
4767
{
4749
4768
int x, y;
@@ -4784,6 +4803,23 @@ - (void)otherMouseUp:(NSEvent *)event
4784
4803
PyGILState_Release (gstate);
4785
4804
}
4786
4805
4806
+ - (void )otherMouseDragged : (NSEvent *)event
4807
+ {
4808
+ int x, y;
4809
+ NSPoint location = [event locationInWindow ];
4810
+ location = [self convertPoint: location fromView: nil ];
4811
+ x = location.x ;
4812
+ y = location.y ;
4813
+ PyGILState_STATE gstate = PyGILState_Ensure ();
4814
+ PyObject* result = PyObject_CallMethod (canvas, " motion_notify_event" , " ii" , x, y);
4815
+ if (result)
4816
+ Py_DECREF (result);
4817
+ else
4818
+ PyErr_Print ();
4819
+
4820
+ PyGILState_Release (gstate);
4821
+ }
4822
+
4787
4823
- (void )setRubberband : (NSRect )rect
4788
4824
{
4789
4825
if (!NSIsEmptyRect (rubberband)) [self setNeedsDisplayInRect: rubberband];
0 commit comments