summaryrefslogtreecommitdiff
path: root/src/ui/widget.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/ui/widget.c')
-rw-r--r--src/ui/widget.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/ui/widget.c b/src/ui/widget.c
index f3e73ee7..1d2aecf0 100644
--- a/src/ui/widget.c
+++ b/src/ui/widget.c
@@ -728,6 +728,17 @@ size_t childIndex_Widget(const iWidget *d, const iAnyObject *child) {
728 return iInvalidPos; 728 return iInvalidPos;
729} 729}
730 730
731iAny *hitChild_Widget(const iWidget *d, iInt2 coord) {
732 iConstForEach(ObjectList, i, d->children) {
733 iAny *found = hitChild_Widget(constAs_Widget(i.object), coord);
734 if (found) return found;
735 }
736 if (contains_Widget(d, coord)) {
737 return iConstCast(iWidget *, d);
738 }
739 return NULL;
740}
741
731iAny *findChild_Widget(const iWidget *d, const char *id) { 742iAny *findChild_Widget(const iWidget *d, const char *id) {
732 if (cmp_String(id_Widget(d), id) == 0) { 743 if (cmp_String(id_Widget(d), id) == 0) {
733 return iConstCast(iAny *, d); 744 return iConstCast(iAny *, d);