I can prevent the empty toplevel from appearing by adding a global variable which is initially <code>false</code> but then set to <code>true</code> by the first <code>drawRect:</code> call, and only entering the temporary idle event loops in tkMacOSXNotify.c when the variable is <code>true</code>.