Skip to content

tkinter geometry string +- when window ovelaps left or top of screen #75952

Description

@8baWnoVi
mannequin
BPO 31771
Nosy @serhiy-storchaka

Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

Show more details

GitHub fields:

assignee = None
closed_at = None
created_at = <Date 2017-10-12.13:26:16.602>
labels = ['3.7', 'type-feature', 'expert-tkinter', 'docs']
title = 'tkinter geometry string +- when window ovelaps left or top of screen'
updated_at = <Date 2017-10-12.13:37:55.646>
user = 'https://bugs.python.org/8baWnoVi'

bugs.python.org fields:

activity = <Date 2017-10-12.13:37:55.646>
actor = 'serhiy.storchaka'
assignee = 'docs@python'
closed = False
closed_date = None
closer = None
components = ['Documentation', 'Tkinter']
creation = <Date 2017-10-12.13:26:16.602>
creator = '8baWnoVi'
dependencies = []
files = []
hgrepos = []
issue_num = 31771
keywords = []
message_count = 2.0
messages = ['304232', '304234']
nosy_count = 3.0
nosy_names = ['docs@python', 'serhiy.storchaka', '8baWnoVi']
pr_nums = []
priority = 'normal'
resolution = None
stage = None
status = 'open'
superseder = None
type = 'enhancement'
url = 'https://bugs.python.org/issue31771'
versions = ['Python 2.7', 'Python 3.6', 'Python 3.7']

Linked PRs

Activity

  1. 8baWnoVi commented on Oct 12, 2017

    8baWnoVimannequin
    MannequinAuthor

    the root.geometry() top-level window method returns strings like "212x128+-9+-8" when the window is located in the top left corner. The documentation only describes geometry strings containing + or - location coordinates. If this is correct behaviour, the documentation should provide a better description of the syntax - perhaps a regular expression such as: "\d+x\d+(\+|-|\+-)\d+(\+|-|\+-)\d+" and some text indicating that a +- coordinate indicates a value to the left of or above the screen.

    Tested Linux Mint 18, Python 3.5.3, tkinter 8.6

    Behaviour is consistent with python 2.7 Tkinter 8.6

  2. serhiy-storchaka commented on Oct 12, 2017

    @serhiy-storchaka
    Member

    Tkinter is just a wrapper around the Tk library. It returns what Tk returns. See Tk documentation:

    https://www.tcl.tk/man/tcl8.6/TkCmd/winfo.htm#M15
    https://www.tcl.tk/man/tcl8.6/TkCmd/wm.htm#M42

    If you want to improve Tkinter documentation, patches are welcome.

  3. added
    type-featureA feature request or enhancement
    and removed
    type-bugAn unexpected behavior, bug, or error
    on Oct 12, 2017
  4. transferred this issue fromon Apr 10, 2022
  5. added 4 commits that reference this issue on Jul 5, 2026
  6. serhiy-storchaka commented on Jul 5, 2026

    @serhiy-storchaka
    Member

    Documented in #152531: the geometry-string docs now explain the ±x±y form and that an offset itself goes negative when the window overlaps the left or top edge (e.g. +-9). Closing as fixed — thanks for the report!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions