stop modal runloop when window closes
add sample makefile