]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-75952: Document negative offsets in tkinter geometry strings (GH-152531)
authorSerhiy Storchaka <storchaka@gmail.com>
Sun, 5 Jul 2026 11:07:49 +0000 (14:07 +0300)
committerGitHub <noreply@github.com>
Sun, 5 Jul 2026 11:07:49 +0000 (14:07 +0300)
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.

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
Doc/library/tkinter.rst

index b84d76b72d2e5b5d0da2498f200e22d8aaaa5c16..6c22f9a8020b269d8c0ba7c5f9e1e0807ccd9402 100644 (file)
@@ -2074,6 +2074,7 @@ Base and mixin classes
 
       Return the geometry of the widget, in the form ``widthxheight+x+y``.
       All dimensions are in pixels.
+      An offset can be negative; see :meth:`~Wm.geometry`.
 
    .. method:: winfo_height()
 
@@ -2544,6 +2545,8 @@ Base and mixin classes
       *width* and *height* are in pixels (or grid units for a gridded window);
       a position preceded by ``+`` is measured from the left or top edge of the
       screen and one preceded by ``-`` from the right or bottom edge.
+      An offset can be negative, as in ``'200x100+-9+-8'``, when the window
+      edge is positioned beyond the corresponding screen edge.
       An empty string cancels any user-specified geometry, letting the window
       revert to its natural size.
       With no argument, return the current geometry as a string of the form