Canvas not displayed while executing the macro hsum.C on MacOS

After each c1->Update(); add one or two calls: gSystem->ProcessEvents();