New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Tkinter Variables require a proper master #62331
Comments
The signature for tkinter class Variable and its subclasses StringVar, IntVar, DoubleVar, BooleanVar is If Variables must have a gui widget parent, then they cannot be used in gui-free tests, even though they have no graphic representation. Moveover, not everything is a proper master. configSectionNameDialog.py . GetCfgSectionNameDialog(Toplevel) . Create.Widgets(self) has these lines: After fixing the dialog test at the bottom of the file, and running it with 3.3 python_d -m idlelib.configSectionNameDialog (bpo-18130), and adding the gc flag, I repeatedly got Running the test multiple times within a session, by repeatedly creating new dialogs with the [dialog] button in the test window, multiplied the uncollected objects. Replacing 'self' with 'self.parent' solved the problem, at least in the test situation. |
Just a gentle reminder. |
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 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. |
Technically all works (raises some exception), but I agree that error message And now we came to the way how to create default root window. bpo-4343 looks Second issue was fixed in bpo-22068. |
And the first issue was fixed in bpo-42630. |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: