Message228523
My first message discussed two different issues. The first, generalized, is that unconditionally using tkinter._default_root, which can be either None or absent, as a backup for master=None in __init__ functions, seems a bit sloppy. Image.__init__ does this check
if not master:
master = _default_root
if not master:
raise RuntimeError('Too early to create image')
but that will fail if _default_root has been deleted. Also, the message is wrong in that it is not 'too early' if an explicit master is passed. I am thinking that all uses of _default_root should raise something like WhateverError("An explicit master is required when _default_root is None or deleted.") Serhiy, what do you think?
The second issue noted that while widgets often have a container widget as master, the non-graphics classes like Variable and Font should have a Tk and not a widget as master. I have corrected idlelib.configHandler and there is a tkinter patch on another issue (applied yet?) to automatically replace master=widget by master-widget.tk. So Variable calls are no longer part of this issue. |
|
Date |
User |
Action |
Args |
2014-10-05 01:36:49 | terry.reedy | set | recipients:
+ terry.reedy, gpolo, BreamoreBoy, martin.panter, serhiy.storchaka |
2014-10-05 01:36:49 | terry.reedy | set | messageid: <1412473009.26.0.557516854472.issue18131@psf.upfronthosting.co.za> |
2014-10-05 01:36:49 | terry.reedy | link | issue18131 messages |
2014-10-05 01:36:48 | terry.reedy | create | |
|