comparison dwtest.c @ 1559:bc3a11fe9a46

Don't use _dw_pool_drain() in dw_exit() on Mac... that drains and recreates the pool. Just drain the pool during exit. Also switched to using dw_exit() and dw_main_quit() in dwtest.
author bsmith@81767d24-ef19-dc11-ae90-00e081727c95
date Tue, 17 Jan 2012 16:10:47 +0000
parents 030e9bddc1c9
children ee47bda26916
comparison
equal deleted inserted replaced
1558:9c5d3ac5bec5 1559:bc3a11fe9a46
569 return 0; 569 return 0;
570 } 570 }
571 571
572 int DWSIGNAL exit_callback(HWND window, void *data) 572 int DWSIGNAL exit_callback(HWND window, void *data)
573 { 573 {
574 dw_taskbar_delete(textbox1, fileicon); 574 if(dw_messagebox("dwtest", DW_MB_YESNO | DW_MB_QUESTION, "Are you sure you want to exit?"))
575 dw_window_destroy((HWND)data); 575 {
576 exit(0); 576 dw_taskbar_delete(textbox1, fileicon);
577 return -1; 577 dw_window_destroy((HWND)data);
578 } 578 dw_main_quit();
579 579 }
580 int DWSIGNAL test_callback(HWND window, void *data) 580 return TRUE;
581 {
582 dw_window_destroy((HWND)data);
583 if ( current_file )
584 dw_free( current_file );
585 exit(0);
586 return -1;
587 } 581 }
588 582
589 int DWSIGNAL browse_file_callback(HWND window, void *data) 583 int DWSIGNAL browse_file_callback(HWND window, void *data)
590 { 584 {
591 char *tmp; 585 char *tmp;
1696 dw_window_set_size(mainwindow, 640, 520); 1690 dw_window_set_size(mainwindow, 640, 520);
1697 dw_window_show(mainwindow); 1691 dw_window_show(mainwindow);
1698 1692
1699 dw_main(); 1693 dw_main();
1700 1694
1701 return 0; 1695 dw_debug("dwtest exiting...");
1702 } 1696 dw_exit(0);
1697 return 0;
1698 }