title: In SmartGWT, what event tells you if something is being drawn?
body: <p>For example, I have a <code>TreeGrid</code> and I have added a <code>ContextMenu</code> to the <code>TreeGrid</code>. Now I want to draw the <code>ContextMenu</code> only when the user right-click a Leaf Node. My idea is to detect when the <code>ContextMenu</code> is about to be drawn and check if the right-clicked node is a Leaf node:</p>
  
  <ul>
  <li>If the node is a leaf, draw the <code>ContextMenu</code></li>
  <li>If the node is <strong>NOT</strong> a leaf, cancel the draw</li>
  </ul>
  
  <p>But what event handles the drawing of a component?</p>
  
  <p><strong>UPDATE:</strong></p>
  
  <p>The <code>showContextMenuHandler</code> would not work. Actually this is a <code>SmartGWT</code> bug, because if I say contextMenu.show(), I actually get 2 context menus: one from <code>SmartGWT</code> (the one I made) and the second one of the <strong>browser</strong> which contains elements such as (next page, previous page, select All, page source, ..). the same goes for <code>LeafContextClickHandler</code>, ...</p>
  
  <p>This is why I want to add a draw handler for the ContextMenu itself to prevent it from drawing in special cases.</p>
  
  <p>Here is an image explaining the bug:</p>
  
  <p><img src="https://i.stack.imgur.com/jzNBy.png" alt="enter image description here"></p>