mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 19:38:12 +00:00
LibCore: Add CObject::for_each_child_of_type<T>()
Use this to iterate over all the GRadioButtons in a group.
This commit is contained in:
parent
0c85d3dba9
commit
3873c51781
3 changed files with 21 additions and 5 deletions
|
@ -55,9 +55,7 @@ void GRadioButton::for_each_in_group(Callback callback)
|
|||
{
|
||||
if (!parent())
|
||||
return;
|
||||
for_each_child_widget([&] (auto& child) {
|
||||
if (!child.is_radio_button())
|
||||
return IterationDecision::Continue;
|
||||
parent()->for_each_child_of_type<GRadioButton>([&] (auto& child) {
|
||||
return callback(static_cast<GRadioButton&>(child));
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue