diff options
author | Andreas Kling <kling@serenityos.org> | 2021-11-24 22:23:26 +0100 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-11-24 23:07:31 +0100 |
commit | a18631c5e765d7f3148e13a66341b3499c69bf4a (patch) | |
tree | 59ac252c02de9781da4fa391d775d501eb4a8e72 /Userland/Libraries/LibGUI/Menu.h | |
parent | 1682cd10bee10210dfdce772c1d029f227418500 (diff) | |
download | serenity-a18631c5e765d7f3148e13a66341b3499c69bf4a.zip |
LibGUI: Add GUI::Menu::try_add_submenu()
This is a fallible variant of add_submenu() that returns ErrorOr.
Diffstat (limited to 'Userland/Libraries/LibGUI/Menu.h')
-rw-r--r-- | Userland/Libraries/LibGUI/Menu.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/Userland/Libraries/LibGUI/Menu.h b/Userland/Libraries/LibGUI/Menu.h index 8b2b8dccea..de83bdb167 100644 --- a/Userland/Libraries/LibGUI/Menu.h +++ b/Userland/Libraries/LibGUI/Menu.h @@ -34,10 +34,11 @@ public: ErrorOr<void> try_add_action(NonnullRefPtr<Action>); ErrorOr<void> try_add_separator(); + ErrorOr<NonnullRefPtr<Menu>> try_add_submenu(String name); void add_action(NonnullRefPtr<Action>); void add_separator(); - Menu& add_submenu(const String& name); + Menu& add_submenu(String name); void popup(const Gfx::IntPoint& screen_position, const RefPtr<Action>& default_action = nullptr); void dismiss(); |