LibGUI: Add Window::on_close hook

This will be invoked when the window is closed, which is helpful if you
want to remove the window from some kind of owner after it's closed.
This commit is contained in:
Andreas Kling 2021-01-02 00:32:26 +01:00
commit c381e7f5a0
Notes: sideshowbarker 2024-07-19 00:14:00 +09:00
2 changed files with 3 additions and 0 deletions

View file

@ -94,6 +94,8 @@ Window::~Window()
void Window::close()
{
hide();
if (on_close)
on_close();
}
void Window::move_to_front()

View file

@ -84,6 +84,7 @@ public:
Close,
};
Function<void()> on_close;
Function<CloseRequestDecision()> on_close_request;
Function<void(bool is_active_input)> on_active_input_change;
Function<void(const bool is_active)> on_activity_change;