From 474e6b28cfb96e1f42e75e3029f706d31acab4d5 Mon Sep 17 00:00:00 2001 From: nvglucifer <77535212+nvglucifer@users.noreply.github.com> Date: Sat, 10 May 2025 09:09:47 +0700 Subject: [PATCH] feat (configure_item): add move_item's functionality to configure_item Able to use kwargs parent/before in configure_item. --- src/dearpygui_commands.h | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/dearpygui_commands.h b/src/dearpygui_commands.h index 457f2884b..d808f05d1 100644 --- a/src/dearpygui_commands.h +++ b/src/dearpygui_commands.h @@ -4093,6 +4093,17 @@ configure_item(PyObject* self, PyObject* args, PyObject* kwargs) if (appitem) { + //adding move_item functionality to configure_item + //mvUUID before = 0, parent = 0; + PyObject* beforeObj = PyDict_GetItemString(kwargs, "before"); + PyObject* parentObj = PyDict_GetItemString(kwargs, "parent"); + if (beforeObj && parentObj) + MoveItem((*GContext->itemRegistry), item, GetIDFromPyObject(parentObj), GetIDFromPyObject(beforeObj)); + else if (beforeObj) + MoveItem((*GContext->itemRegistry), item, 0, GetIDFromPyObject(beforeObj)); + else if (parentObj) + MoveItem((*GContext->itemRegistry), item, GetIDFromPyObject(parentObj), 0); + //appitem->checkArgs(args, kwargs); appitem->handleKeywordArgs(kwargs, GetEntityCommand(appitem->type)); } @@ -4326,4 +4337,4 @@ get_platform(PyObject* self, PyObject* args, PyObject* kwargs) #else return ToPyInt(2L); #endif -} \ No newline at end of file +}