Added list and tuple to grid sticky option.#15508
Open
melassa wants to merge 5 commits intopython:mainfrom
Open
Added list and tuple to grid sticky option.#15508melassa wants to merge 5 commits intopython:mainfrom
melassa wants to merge 5 commits intopython:mainfrom
Conversation
Collaborator
|
This is not the only place where If you need help figuring out which |
This comment has been minimized.
This comment has been minimized.
Collaborator
|
For example, |
Contributor
Author
|
Notebook add() requires it. Layout do not accept list or tuple. |
Contributor
Author
|
I must open a new PR for Notebook? |
Contributor
Author
|
All done, for me. |
Contributor
|
According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉 |
Akuli
reviewed
Mar 14, 2026
| *, | ||
| state: Literal["normal", "disabled", "hidden"] = ..., | ||
| sticky: str = ..., # consists of letters 'n', 's', 'w', 'e', no repeats, may be empty | ||
| sticky: str | list[str] | tuple[str, ...] = ..., # consists of letters 'n', 's', 'w', 'e', no repeats, may be empty |
Collaborator
There was a problem hiding this comment.
This doesn't work on my system:
>>> from tkinter import ttk
>>> nb = ttk.Notebook()
>>> label = ttk.Label(nb)
>>> nb.add(label, sticky=list('nswe'))
Traceback (most recent call last):
File "<python-input-3>", line 1, in <module>
nb.add(label, sticky=list('nswe'))
~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.13/tkinter/ttk.py", line 824, in add
self.tk.call(self._w, "add", child, *(_format_optdict(kw)))
~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
_tkinter.TclError: Bad -sticky specification n s w e
Maybe this has to do with Tk version? What's yours?
>>> import tkinter
>>> tkinter.TkVersion
8.6
Contributor
Author
There was a problem hiding this comment.
You are right. Do not work. I made a mistake when testing it. Seems that grid is the only one.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Added list and tuple to grid sticky option.