title: Why does TCanvas not draw during the execution of a macro in the root shell?
body: <p>Suppose I have a macro that contains two <strong>TGraphs</strong>: <strong>T1</strong> and <strong>T2</strong> and I have a canvas "<strong>C</strong>" divided into two parts:</p>
  
  <pre><code>TCanvas *C = new TCanvas("","",0,0,400,400);
  C-&gt;Divide(2,1);
  </code></pre>
  
  <p>when this part gets executed the blanc canvas appears on my screen but it's grayed out.. inactive! But that's okay, then it proceeds..</p>
  
  <p>The program has two distinct parts, in the first part it completes calculations enters the first half of the canvas and draws the first <strong>TGraph</strong>:</p>
  
  <pre><code>C-&gt;cd(1);
  T1-&gt;Draw("AP");
  </code></pre>
  
  <p>at this point I expect to already see the graph on the first half of the canvas but unfortunately nothing appears, the canvas remains inactive! The program proceeds to the next part:</p>
  
  <pre><code>C-&gt;cd(2);
  T2-&gt;Draw("AP");
  </code></pre>
  
  <p>same story nothing appears on the canvas yet, but then the execution finishes and I am back to the root shell as in like this:</p>
  
  <pre><code>root[#]
  </code></pre>
  
  <p>and now I can see the two graphs! What I want is that the parts that have been executed like <code>T1-&gt;Draw("AP")</code> should already appear on the <code>cd(1)</code> and then later the graph on <code>cd(2)</code> should appear. Is there a way to achieve that?</p>