FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Adding a flush_events method to the MacOSX backend by mdehoon · Pull Request #2245 · matplotlib/matplotlib · GitHub

Repository navigation

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension .m  (1) All 1 file type selected
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
21 changes: 20 additions & 1 deletion src/_macosx.m
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ static void _dealloc_atsui(void)

static int _draw_path(CGContextRef cr, void* iterator, int nmax)
{
double x1, y1, x2, y2, x3, y3;
double x1, y1, x2, y2;
static unsigned code = STOP;
static double xs, ys;
CGPoint current;
Expand Down Expand Up @@ -3424,6 +3424,20 @@ static void _data_provider_release(void* info, const void* data, size_t size)
return Py_None;
}

static PyObject*
FigureCanvas_flush_events(FigureCanvas* self)
{
View* view = self->view;
if(!view)
{
PyErr_SetString(PyExc_RuntimeError, "NSView* is NULL");
return NULL;
}
[view displayIfNeeded];
Py_INCREF(Py_None);
return Py_None;
}

static PyObject*
FigureCanvas_set_rubberband(FigureCanvas* self, PyObject *args)
{
Expand Down Expand Up @@ -3699,6 +3713,11 @@ static void _data_provider_release(void* info, const void* data, size_t size)
METH_NOARGS,
"Invalidates the canvas."
},
{"flush_events",
(PyCFunction)FigureCanvas_flush_events,
METH_NOARGS,
"Flush the GUI events for the figure."
},
{"set_rubberband",
(PyCFunction)FigureCanvas_set_rubberband,
METH_VARARGS,
Expand Down

Back | FazBrowse Home | New Git URL