@@ -142,10 +142,26 @@ plImgui_cleanup(PyObject* self, PyObject* args, PyObject* kwargs)
142142}
143143
144144PyObject*
145- plImgui_test (PyObject* self, PyObject* args, PyObject* kwargs )
145+ plImGui_ShowDemoWindow (PyObject* self, PyObject* arg )
146146{
147- ImGui::ShowDemoWindow ();
148- ImPlot::ShowDemoWindow ();
147+ bool * ptShow = NULL ;
148+ if (!Py_IsNone (arg))
149+ {
150+ ptShow = (bool *)PyCapsule_GetPointer (arg, " pb" );
151+ }
152+ ImGui::ShowDemoWindow (ptShow);
153+ Py_RETURN_NONE;
154+ }
155+
156+ PyObject*
157+ plImPlot_ShowDemoWindow (PyObject* self, PyObject* arg)
158+ {
159+ bool * ptShow = NULL ;
160+ if (!Py_IsNone (arg))
161+ {
162+ ptShow = (bool *)PyCapsule_GetPointer (arg, " pb" );
163+ }
164+ ImPlot::ShowDemoWindow (ptShow);
149165 Py_RETURN_NONE;
150166}
151167
@@ -154,12 +170,15 @@ plImgui_test(PyObject* self, PyObject* args, PyObject* kwargs)
154170
155171static PyMethodDef gatCommands[] =
156172{
173+ // imgui
157174 PL_PYTHON_COMMAND (plImgui_initialize, METH_VARARGS | METH_KEYWORDS, NULL ),
158175 PL_PYTHON_COMMAND (plImgui_new_frame, METH_VARARGS | METH_KEYWORDS, NULL ),
159176 PL_PYTHON_COMMAND (plImgui_render, METH_VARARGS | METH_KEYWORDS, NULL ),
160177 PL_PYTHON_COMMAND (plImgui_cleanup, METH_VARARGS | METH_KEYWORDS, NULL ),
161- PL_PYTHON_COMMAND (plImgui_test, METH_VARARGS | METH_KEYWORDS , NULL ),
178+ PL_PYTHON_COMMAND (plImGui_ShowDemoWindow, METH_O , NULL ),
162179
180+ // implot
181+ PL_PYTHON_COMMAND (plImPlot_ShowDemoWindow, METH_O, NULL ),
163182
164183 {NULL , NULL , 0 , NULL }
165184};
0 commit comments