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:
parent
906fde8f8c
commit
723ba91f74
6 changed files with 43 additions and 40 deletions
|
@ -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:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue