From 71a9fbf296928d3599743e88f72390ff827c5ab3 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sun, 1 Nov 2020 13:17:59 +0100 Subject: Make event handling in C++ more flexible --- examples/pugl_cxx_demo.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'examples/pugl_cxx_demo.cpp') diff --git a/examples/pugl_cxx_demo.cpp b/examples/pugl_cxx_demo.cpp index 4dab35c..9767345 100644 --- a/examples/pugl_cxx_demo.cpp +++ b/examples/pugl_cxx_demo.cpp @@ -29,14 +29,16 @@ #include -class CubeView : public pugl::View +class CubeView : public pugl::View { public: explicit CubeView(pugl::World& world) - : pugl::View{world} - {} + : pugl::View{world} + { + setEventHandler(*this); + } - using pugl::View::onEvent; + using pugl::View::onEvent; static pugl::Status onEvent(const pugl::ConfigureEvent& event) noexcept; pugl::Status onEvent(const pugl::UpdateEvent& event) noexcept; -- cgit v1.2.1