Excellent.
Looking at your videos, there is a significant delay in some cases between the button being pushed and the graph being refreshed. You might want to add something like this to the call backs that take a while to refresh the screen.
module demo
use clrwin
integer control_temp_win ! Control variable for temp window
contains
integer function do_long_calc()
integer i
print*, 'Beginning long calc'
i = temp_window()
! Do some long calc - here just sleep for 10 s
call sleep1@(10.d0)
print*, 'Completed long calc'
! All done, close temp_window, by setting control_temp_win = 0 and calling window_update@(control_temp_win)
control_temp_win = 0
call window_update@(control_temp_win)
do_long_calc = 1
end function do_long_calc
integer function temp_window()
integer, save :: iw
iw = winio@('%ww[no_caption,no_maxminbox,topmost]&')
iw = winio@('%fn[Tahoma]&')
iw = winio@('%ts&',1.2d0)
iw = winio@('%bg[grey]&')
iw = winio@('%ws&','Processing')
iw = winio@('%nl%ws&','Please wait')
iw = winio@('%lw&', control_temp_win) ! This automatically sets control_temp_win to -1
iw = winio@(' ')
temp_window = 2
end function temp_window
end module
program main
use demo
i = do_long_calc()
end program main
](