Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
bpo-13553: Document tkinter.Tk args #4786
bpo-13553: Document tkinter.Tk args #4786
Changes from 6 commits
fdc96ed
35c6465
df696bb
0f468bc
c25db70
9068406
0054844
57553df
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So about baseName and className...
My understanding is that className is the equivalent of wish's "-name" option. So this provides the default title for the root window, the class of the root window (which can be used in bindings and option database), and would be what is returned by "tk appname" (sometimes used for inter-application communication).
It appears that baseName isn't passed into Tcl/Tk at all.
About those profile files that can be read in... does anyone know what they're intended to be used for, if they've ever been documented, and if they're actually used at all? It reads like a per-application 'automatically inject your own code' which seems a bit strange.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried out specifying className on a call and it seems to lower case the first letter:
creates a window with the name
tEST
androot.tk.call('tk', 'appname')
returnstEST
. Should I document that behavior? Since fileName in thewish
documentation is used to find the script, I think it might be lowercased for that reason?Looking through the documentation, it looks like
interp
is used for inter-application communication, which is the value stored inTk.tk
.However, the send command in tkinter has:
As far as the profile files, there was a security patch in the past.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure why the first letter is lowercased - it's Tkinter that's doing it, though for what reason I can't guess. From the Tcl side it's perfectly ok with the first letter of argv0 capitalized. My instinct therefore is not to document it.
Note that the classname for the window will lowercase everything except for uppercasing the first letter, e.g. "Test" with your example. I think the first letter uppercase is used for user class names vs. builtin ones like 'button' etc. I was playing around with different things using this:
I'd suggest not documenting this conversion either. Anyone who needs to get the exact capitalization of the classname will know how to get it through introspection. I also don't imagine that 'send' would be used much by Tkinter apps (it was a useful thing a long while ago, not so much now).
Any suggestions how to proceed with regard to the readprofile() thing, i.e. what on earth it is for and if it should still be there? @serhiy-storchaka ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be "Specifies the id of the window". This whole piece was used for application embedding (think web browser plugins). Therefore, it would be almost always the case that you'd embed inside a specific subwindow somewhere, not directly in the "main" window of the application (which I'd read as toplevel)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you. I think I had taken this from the wish man page and unintentionally changed the meaning slightly with my edit.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
While we are documenting the Tk class. Would it be worth it to document Tk attributes? master, children and tk.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The current page reads more like a 'getting started' or 'how to', so I wasn't sure how much detail to add. I know there's a separate bug issue where Terry figured out the difference between master and parent, so maybe it would be worthwhile to include that here?