buggins / dlangui

Cross Platform GUI for D programming language
Boost Software License 1.0
816 stars 122 forks source link

Widget.child throws if there is no child #691

Open whitebyte opened 1 week ago

whitebyte commented 1 week ago
auto widget = parent.childById("nonexistent"); // returns null
auto widget2 =parent.child(1000); // throws exception

Expected behavior: .child(x) should return null if there is no child with such index (or no children at all). I can open a PR if maintainers agree

GrimMaple commented 1 week ago

According to this the base class already returns null. I think that "return null" is intended behavior, so I don't mind such PR at all :) If you're at it -- please make sure that it's consistent across all subclasses