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

tkSimpleDialog Window Flashing #46890

Closed
Longorh mannequin opened this issue Apr 15, 2008 · 7 comments
Closed

tkSimpleDialog Window Flashing #46890

Longorh mannequin opened this issue Apr 15, 2008 · 7 comments

Comments

@Longorh
Copy link
Mannequin

Longorh mannequin commented Apr 15, 2008

BPO 2638
Files
  • tkSimpleDialog.py
  • issue_2638.diff
  • 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 2009-03-07.02:19:22.431>
    created_at = <Date 2008-04-15.15:44:12.257>
    labels = ['expert-tkinter']
    title = 'tkSimpleDialog Window Flashing'
    updated_at = <Date 2009-03-07.02:19:22.429>
    user = 'https://bugs.python.org/Longorh'

    bugs.python.org fields:

    activity = <Date 2009-03-07.02:19:22.429>
    actor = 'gpolo'
    assignee = 'none'
    closed = True
    closed_date = <Date 2009-03-07.02:19:22.431>
    closer = 'gpolo'
    components = ['Tkinter']
    creation = <Date 2008-04-15.15:44:12.257>
    creator = 'Longorh'
    dependencies = []
    files = ['10035', '10931']
    hgrepos = []
    issue_num = 2638
    keywords = ['patch']
    message_count = 7.0
    messages = ['65519', '65525', '69874', '69920', '69961', '78640', '83270']
    nosy_count = 3.0
    nosy_names = ['gpolo', 'Longorh', 'ronLongo']
    pr_nums = []
    priority = 'normal'
    resolution = 'fixed'
    stage = None
    status = 'closed'
    superseder = None
    type = None
    url = 'https://bugs.python.org/issue2638'
    versions = ['Python 3.1', 'Python 2.7']

    @Longorh
    Copy link
    Mannequin Author

    Longorh mannequin commented Apr 15, 2008

    When a Tkinter window comes up that uses tkSimpleDialog to construct a
    dialog box, the window first flashes on the screen as an unpopulated
    top-level window, before being drawn in its completed state.

    This problem is easily corrected by adding two lines of code to the
    constructor for class Dialog in tkSimpleDialog.py. The first line of
    the constructor reads Toplevel.__init__( self, parent ). After this
    line insert self.overrideredirect( True ). The second line from the
    last in this constructor reads self.initial_focus.focus_set(), just
    before this line insert self.overrideredirect( False). That's it.
    I've attached the revised version of this file.

    @Longorh Longorh mannequin added the topic-tkinter label Apr 15, 2008
    @gpolo
    Copy link
    Mannequin

    gpolo mannequin commented Apr 15, 2008

    Isn't overrideredirect only used to enable/disable borders in the window
    ? Why doing this fix what you described ?
    Also, make a patch against python-trunk instead of sending the entire file.

    @ronLongo
    Copy link
    Mannequin

    ronLongo mannequin commented Jul 17, 2008

    Correct. overrideredirect only enables/disables borders. However,
    what appears as a "flash" when the dialog box first appears is actually
    a window with only borders being drawn (no contents). Disabling
    borders BEFORE drawing anything prevents this "flash". I cannot say if
    this "flash" occurs on all platforms, but it does occur on all windows
    XP platforms that I've tried it on. In each of these cases the "fixed"
    tkSimpleDialog.py prevents this "flash". While not vital to
    application reliability, this fix does make applications appear more
    professional.

    @gpolo
    Copy link
    Mannequin

    gpolo mannequin commented Jul 17, 2008

    It would be more appropriate to properly use withdraw and deiconify
    then. I'm attaching a patch that uses them.

    @ronLongo
    Copy link
    Mannequin

    ronLongo mannequin commented Jul 18, 2008

    Excellent! That solution works as well.

    @gpolo
    Copy link
    Mannequin

    gpolo mannequin commented Dec 31, 2008

    Dropped for inclusion in python 2.5, but should still be considered for
    trunk and py3k.

    @gpolo
    Copy link
    Mannequin

    gpolo mannequin commented Mar 7, 2009

    Fixed in r70223 and r70225.

    Thanks for reporting.

    @gpolo gpolo mannequin closed this as completed Mar 7, 2009
    @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
    Projects
    None yet
    Development

    No branches or pull requests

    0 participants