add MwGetName

This commit is contained in:
Nishi 2025-12-07 04:14:02 +09:00
commit 2782277d06
Signed by: nishi
GPG key ID: 27EF69B208EB9343
2 changed files with 11 additions and 0 deletions

View file

@ -315,6 +315,13 @@ MWDECL void MwReparent(MwWidget handle, MwWidget new_parent);
*/
MWDECL MwClass MwGetClass(MwWidget handle);
/*!
* @brief Gets name of widget
* @param handle Widget
* @return Name
*/
MWDECL const char* MwGetName(MwWidget handle);
/*!
* @brief Gets children of widget
* @param handle Widget

View file

@ -725,6 +725,10 @@ MwClass MwGetClass(MwWidget handle) {
return handle->widget_class;
}
const char* MwGetName(MwWidget handle) {
return handle->name;
}
MwWidget* MwGetChildren(MwWidget handle) {
MwWidget* c = malloc(sizeof(*c) * (arrlen(handle->children) + 1));
int i;