diff options
author | David Robillard <d@drobilla.net> | 2016-09-01 22:26:22 -0400 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2016-09-01 22:26:22 -0400 |
commit | 02d2704a0be7443907f5752c00b71feb58cc11dd (patch) | |
tree | f2d22fd08c10b2ff1f7762d0dc8feb3561aafa5d /pugl/pugl_osx.m | |
parent | 252421757e4e8ca9f482f2885ef9c09492c06757 (diff) | |
download | pugl-02d2704a0be7443907f5752c00b71feb58cc11dd.tar.gz pugl-02d2704a0be7443907f5752c00b71feb58cc11dd.tar.bz2 pugl-02d2704a0be7443907f5752c00b71feb58cc11dd.zip |
Add PUGL_CLOSE event
This allows purely event-driven applications to handle window close.
Something more extensible for WM message seems like it might be a good
idea here, but I can't think of specific uses, so this will do.
Diffstat (limited to 'pugl/pugl_osx.m')
-rw-r--r-- | pugl/pugl_osx.m | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/pugl/pugl_osx.m b/pugl/pugl_osx.m index ecf9373..72e4da9 100644 --- a/pugl/pugl_osx.m +++ b/pugl/pugl_osx.m @@ -82,8 +82,13 @@ struct PuglInternalsImpl { - (BOOL)windowShouldClose:(id)sender { - if (puglview->closeFunc) - puglview->closeFunc(puglview); + const PuglEventClose ev = { + PUGL_CLOSE, + puglview, + 0 + }; + puglDispatchEvent(puglview, (PuglEvent*)&ev); + return YES; } |