Skip to content

Commit 19b5e8e

Browse files
gh-75952: Document negative offsets in tkinter geometry strings (GH-152531)
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>
1 parent 820b6ca commit 19b5e8e

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
@@ -2074,6 +2074,7 @@ Base and mixin classes
20742074

20752075
Return the geometry of the widget, in the form ``widthxheight+x+y``.
20762076
All dimensions are in pixels.
2077+
An offset can be negative; see :meth:`~Wm.geometry`.
20772078

20782079
.. method:: winfo_height()
20792080

@@ -2544,6 +2545,8 @@ Base and mixin classes
25442545
*width* and *height* are in pixels (or grid units for a gridded window);
25452546
a position preceded by ``+`` is measured from the left or top edge of the
25462547
screen and one preceded by ``-`` from the right or bottom edge.
2548+
An offset can be negative, as in ``'200x100+-9+-8'``, when the window
2549+
edge is positioned beyond the corresponding screen edge.
25472550
An empty string cancels any user-specified geometry, letting the window
25482551
revert to its natural size.
25492552
With no argument, return the current geometry as a string of the form

0 commit comments

Comments
 (0)