|
@@ -648,16 +648,27 @@ namespace matplotlibcpp {
|
|
|
// if PyDeCRFF, the function doesn't work on Mac OS
|
|
|
}
|
|
|
|
|
|
- inline void show()
|
|
|
- {
|
|
|
- PyObject* res = PyObject_CallObject(
|
|
|
- detail::_interpreter::get().s_python_function_show,
|
|
|
- detail::_interpreter::get().s_python_empty_tuple);
|
|
|
-
|
|
|
- if (!res) throw std::runtime_error("Call to show() failed.");
|
|
|
-
|
|
|
- Py_DECREF(res);
|
|
|
- }
|
|
|
+ inline void show(const bool block = true)
|
|
|
+ {
|
|
|
+ PyObject* res;
|
|
|
+ if(block)
|
|
|
+ {
|
|
|
+ res = PyObject_CallObject(
|
|
|
+ detail::_interpreter::get().s_python_function_show,
|
|
|
+ detail::_interpreter::get().s_python_empty_tuple);
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ PyObject *kwargs = PyDict_New();
|
|
|
+ PyDict_SetItemString(kwargs, "block", Py_False);
|
|
|
+ res = PyObject_Call( detail::_interpreter::get().s_python_function_show, detail::_interpreter::get().s_python_empty_tuple, kwargs);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ if (!res) throw std::runtime_error("Call to show() failed.");
|
|
|
+
|
|
|
+ Py_DECREF(res);
|
|
|
+ }
|
|
|
|
|
|
inline void draw()
|
|
|
{
|