Skip to content

Commit 67d782c

Browse files
miss-islingtonserhiy-storchakaclaude
authored
[3.15] gh-75952: Document negative offsets in tkinter geometry strings (GH-152531) (GH-153101)
Tk geometry strings can contain a negative offset (e.g. 200x100+-9+-8) when a window edge is positioned beyond the corresponding screen edge. Note this in the geometry() and winfo_geometry() documentation. (cherry picked from commit 19b5e8e) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com> Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
1 parent 88baea8 commit 67d782c

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

Doc/library/tkinter.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2020,6 +2020,7 @@ Base and mixin classes
20202020

20212021
Return the geometry of the widget, in the form ``widthxheight+x+y``.
20222022
All dimensions are in pixels.
2023+
An offset can be negative; see :meth:`~Wm.geometry`.
20232024

20242025
.. method:: winfo_height()
20252026

@@ -2480,6 +2481,8 @@ Base and mixin classes
24802481
*width* and *height* are in pixels (or grid units for a gridded window);
24812482
a position preceded by ``+`` is measured from the left or top edge of the
24822483
screen and one preceded by ``-`` from the right or bottom edge.
2484+
An offset can be negative, as in ``'200x100+-9+-8'``, when the window
2485+
edge is positioned beyond the corresponding screen edge.
24832486
An empty string cancels any user-specified geometry, letting the window
24842487
revert to its natural size.
24852488
With no argument, return the current geometry as a string of the form

0 commit comments

Comments
 (0)