Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve placing of simple query windows. #86851

Closed
serhiy-storchaka opened this issue Dec 19, 2020 · 3 comments
Closed

Improve placing of simple query windows. #86851

serhiy-storchaka opened this issue Dec 19, 2020 · 3 comments
Labels
3.10 only security fixes topic-tkinter type-feature A feature request or enhancement

Comments

@serhiy-storchaka
Copy link
Member

BPO 42685
Nosy @terryjreedy, @serhiy-storchaka
PRs
  • bpo-42685: Improve placing of simple query windows. #23856
  • 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 = <Date 2020-12-25.11:48:40.263>
    created_at = <Date 2020-12-19.15:29:47.696>
    labels = ['type-feature', 'expert-tkinter', '3.10']
    title = 'Improve placing of simple query windows.'
    updated_at = <Date 2020-12-25.11:48:40.263>
    user = 'https://github.com/serhiy-storchaka'

    bugs.python.org fields:

    activity = <Date 2020-12-25.11:48:40.263>
    actor = 'serhiy.storchaka'
    assignee = 'none'
    closed = True
    closed_date = <Date 2020-12-25.11:48:40.263>
    closer = 'serhiy.storchaka'
    components = ['Tkinter']
    creation = <Date 2020-12-19.15:29:47.696>
    creator = 'serhiy.storchaka'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 42685
    keywords = ['patch']
    message_count = 3.0
    messages = ['383382', '383673', '383699']
    nosy_count = 2.0
    nosy_names = ['terry.reedy', 'serhiy.storchaka']
    pr_nums = ['23856']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'enhancement'
    url = 'https://bugs.python.org/issue42685'
    versions = ['Python 3.10']

    @serhiy-storchaka
    Copy link
    Member Author

    Currently simple query windows in Tkinter (such as tkinter.simpledialog.askinteger()) are placed at position 50 pixels right and 50 pixels below of the top left corner of the parent widget (even if it is not visible). If the parent is not specified, the initial position was determined by a windows manager before bpo-1538878, after bpo-1538878 it was placed at position 50 pixels right and 50 pixels below the default root widget (even if it is not visible).

    bpo-42630 restored the pre-issue1538878 behavior, but it is still has many quirks.

    The proposed patch makes the placing algorithm similar to native Tk dialogs.

    • If parent is specified and mapped, the query widget is centered at the center of parent. Its position and size can be corrected so that it fits in the virtual root window.
    • Otherwise it is centered at the center of the screen.

    @serhiy-storchaka serhiy-storchaka added 3.10 only security fixes topic-tkinter type-feature A feature request or enhancement labels Dec 19, 2020
    @terryjreedy
    Copy link
    Member

    I took a look at the somewhat messy popup placement in IDLE. The query.Query subclasses are centered over their parent. Some others are over the window but up and to the left. Maybe they have a custom geometry setting that I should delete. Search and replace dialogs are at the upper left of the screen. Bad if window is at the right edge. Editor SyntaxError boxes, with no placement specified, are centered on the screen. Centered on the text frame would be much better (as long as it did not cover the error). Same would be true of most anything else currently centered.

    • If parent is specified and mapped, the query widget is centered at the center of parent.

    I am not sure what 'mapped' means. With patch, SyntaxError continues to be centered on screen even with editor visible and focused. Will say more on the PR.

    Its position and size can be corrected so that it fits in the virtual root window.
    I don't understand this. Will check the code.

    @serhiy-storchaka
    Copy link
    Member Author

    New changeset c6c43b2 by Serhiy Storchaka in branch 'master':
    bpo-42685: Improve placing of simple query windows. (GH-23856)
    c6c43b2

    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    3.10 only security fixes topic-tkinter type-feature A feature request or enhancement
    Projects
    None yet
    Development

    No branches or pull requests

    2 participants