Mercurial > dwindows
diff dwtest.c @ 1844:1558f5e14f83
Added code and comment to the test program demonstrating trapping application quit on Mac.
Also update readme, and other distribution files in preparation for 2.5 release.
Added a dedication to my late father.
author | bsmith@81767d24-ef19-dc11-ae90-00e081727c95 |
---|---|
date | Tue, 18 Dec 2012 21:51:09 +0000 |
parents | b35e041fc114 |
children | b5e1ccc76e58 |
line wrap: on
line diff
--- a/dwtest.c Thu Dec 13 07:48:30 2012 +0000 +++ b/dwtest.c Tue Dec 18 21:51:09 2012 +0000 @@ -1791,6 +1791,14 @@ dw_window_default(mainwindow, copypastefield); dw_signal_connect(mainwindow, DW_SIGNAL_DELETE, DW_SIGNAL_FUNC(exit_callback), DW_POINTER(mainwindow)); + /* + * The following is a special case handler for the Mac and other platforms which contain + * an application object which can be closed. It function identically to a window delete/close + * request except it applies to the entire application not an individual window. If it is not + * handled or you allow the default handler to take place the entire application will close. + * On platforms which do not have an application object this line will be ignored. + */ + dw_signal_connect(DW_DESKTOP, DW_SIGNAL_DELETE, DW_SIGNAL_FUNC(exit_callback), DW_POINTER(mainwindow)); timerid = dw_timer_connect(2000, DW_SIGNAL_FUNC(timer_callback), 0); dw_window_set_size(mainwindow, 640, 550); dw_window_show(mainwindow);