Is it 'fine' to instantiate a widget without parent parameter?

jfong at ms4.hinet.net jfong at ms4.hinet.net
Tue Sep 10 06:26:22 EDT 2019


Terry Reedy於 2019年9月10日星期二 UTC+8下午5時16分19秒寫道:
> On 9/10/2019 12:02 AM, jfong at ms4.hinet.net wrote:
> 
> > Got it. The first Tk object is always the default one no matter where it was  created. The default one is always the one which the widget constructor refer to when required.
> 
> Or one can call tkinter.NoDefaultRoot() and not worry about default roots.
> 
> -- 
> Terry Jan Reedy

May I say this call has to be at the very beginning, before any widget was created using default root? And after this call, the 'parent' argument has to be explicitly assigned in the widget constructor?

--Jach



More information about the Python-list mailing list