1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 15:48:12 +00:00

LibGUI: Add GWidget::for_each_child_widget(callback).

This commit is contained in:
Andreas Kling 2019-05-27 03:52:33 +02:00
parent 906fde8f8c
commit 723ba91f74
6 changed files with 43 additions and 40 deletions

View file

@ -185,6 +185,16 @@ public:
void register_local_shortcut_action(Badge<GAction>, GAction&);
void unregister_local_shortcut_action(Badge<GAction>, GAction&);
template<typename Callback>
void for_each_child_widget(Callback callback)
{
for_each_child([&] (auto& child) {
if (child.is_widget())
return callback(static_cast<GWidget&>(child));
return IterationDecision::Continue;
});
}
virtual bool is_radio_button() const { return false; }
private: