Skip to content

idle help is modal #40321

Closed
Closed

Description

@doko42
BPO 964437
Nosy @terryjreedy, @doko42, @kbkaiser, @ned-deily, @serwy, @merwok
Files
  • help_nonmodal.diff
  • help_nonmodal_updated.patch
  • help_nonmodal_updated2.patch
  • help_nonmodal_revision.patch
  • 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 2012-02-05.20:33:49.608>
    created_at = <Date 2004-06-01.18:05:03.000>
    labels = ['expert-IDLE', 'type-feature']
    title = 'idle help is modal'
    updated_at = <Date 2012-02-05.20:48:44.400>
    user = 'https://github.com/doko42'

    bugs.python.org fields:

    activity = <Date 2012-02-05.20:48:44.400>
    actor = 'roger.serwy'
    assignee = 'none'
    closed = True
    closed_date = <Date 2012-02-05.20:33:49.608>
    closer = 'terry.reedy'
    components = ['IDLE']
    creation = <Date 2004-06-01.18:05:03.000>
    creator = 'doko'
    dependencies = []
    files = ['9819', '24421', '24423', '24427']
    hgrepos = []
    issue_num = 964437
    keywords = ['patch']
    message_count = 16.0
    messages = ['54173', '54174', '54175', '64340', '122631', '151425', '152641', '152646', '152647', '152651', '152659', '152663', '152695', '152704', '152705', '152708']
    nosy_count = 8.0
    nosy_names = ['terry.reedy', 'doko', 'kbk', 'gpolo', 'ned.deily', 'roger.serwy', 'eric.araujo', 'python-dev']
    pr_nums = []
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'enhancement'
    url = 'https://bugs.python.org/issue964437'
    versions = ['Python 2.7', 'Python 3.2', 'Python 3.3']

    Activity

    1. doko42 commented on Jun 1, 2004

      @doko42
      MemberAuthor

      [forwarded from http://bugs.debian.org/252130]

      the idle online help is unfortunately modal so that one cannot have the
      help window open and read it, and at the same time work in idle. One
      must close the help window before continuing in idle which is a
      nuisance.

    2. kbkaiser commented on Jun 4, 2004

      @kbkaiser
      Contributor

      Logged In: YES
      user_id=149084

      Making this an RFE. If you have time to work up a patch,
      that would be a big help.

    3. kbkaiser commented on Jun 17, 2004

      @kbkaiser
      Contributor

      Logged In: YES
      user_id=149084

      Raymond, I'm not planning on working on this now.
      Please don't assign it to me again.

    4. gpolo commented on Mar 22, 2008

      gpolomannequin
      Mannequin

      Hi,

      This patch makes Help dialog executes as nonmodal. I added a new button
      at textView.py to demonstrate the behavior, also, I created a decorator
      called _singledialog at EditorWindow so just one Help window executes at
      a time, trying to start a new brings the current one to the front.

      I hope this issue is not totally dead, so someone could review and
      possible apply.

    5. merwok commented on Nov 28, 2010

      @merwok
      Member

      Making the help window non-modal sounds like a great change to me.

    6. terryjreedy commented on Jan 17, 2012

      @terryjreedy
      Member

      I agree that modal is a nuisance. Another problem with the help text window is that, on my system, it opens too narrow -- about 2/3rds the width of a shell or edit window. So many line are wrapped. Is this easy to fix and include with this patch, or does it need a new issue?

      This patch fails to apply to 2.7 or 3.2: (t)hg messages are:
      applying F:\Python\dev\help_nonmodal.diff
      unable to find 'idlelib/textView.py' for patching
      patching file idlelib/textView.py
      6 out of 6 hunks FAILED -- saving rejects to file idlelib/textView.py.rej
      abort: patch failed to apply
      I redownloaded and tried again with same result.

    7. serwy commented on Feb 4, 2012

      serwymannequin
      Mannequin

      Attached is an updated version of Guilherme's patch against 3.3a0. It does make the help window non-modal.

    8. ned-deily commented on Feb 4, 2012

      @ned-deily
      Member

      Thanks, Roger. I did a quick smoke test of the patch on OS X 10.7 with Cocoa Tk. I didn't see any obvious problems. Of course, it needs to be tested on Windows and with X11 on a Unix platform. Note, that there are some spurious spaces at a few ends-of-lines. The main repositories on hg.python.org have whitespace prehooks that check for and reject patches with extra whitespace. There's a script (reindent.py) included in Tools/scripts that will check for this and other problems.
      http://docs.python.org/devguide/committing.html

    9. serwy commented on Feb 4, 2012

      serwymannequin
      Mannequin

      I ran reindent and resubmitted the patch.

      The patch works fine on Ubuntu 11.04. One very subtle design issue with the patch is that the help window is tied to the calling EditorWindow instance. If the editor (or shell) closes, so does the help window, even if other editors are open.

    10. terryjreedy commented on Feb 5, 2012

      @terryjreedy
      Member

      Download, tested on W7, 3.2.2. Started help, brought to front, stopped, restarted, in both shell and edit window and all fine *except* when I closed edit window with help attached, which closes help also, and tried to open help in shell, idle 'silently' crashes. Reproduced same after restart idle. If I reopen an edit window, and reopen help from an edit window, it works ok. So the side-effect close seems to leave something behind that is a problem for reopening from shell but not from another edit window.

      I am also still curious why window opens too narrow and if that can be fixed.

    11. serwy commented on Feb 5, 2012

      serwymannequin
      Mannequin

      Attached is a reworked patch to handle the nonmodal help dialog.

      It replaces the decorator _singledialog with a call to a singleton HelpDialog class. The class creates the textView widget using as its parent the root Tk window instance instead of the EditorWindow's Toplevel.
      Any EditorWindow instance calling "help_dialog" will cause the existing help dialog to be repositioned on top of it.

    12. terryjreedy commented on Feb 5, 2012

      @terryjreedy
      Member

      I retried and get same behavior: help closes with closing of edit window and trying to reopen from shell closes idle with about 2 second delay.
      Does this
      + if self.root:
      + parent = self.root
      + else:
      + parent = self.top
      really do what you claimed? (always attach to root rather than toplevel)?

    13. serwy commented on Feb 5, 2012

      serwymannequin
      Mannequin

      Those four lines are present just in case self.root is not initialized.
      Even if you short-circuit the behavior and set parent=self.top, the patch still works, only that closing the calling EditorWindow instance also closes the help dialog.

      I tested the patch against 3.3a0 on Ubuntu and 3.2.2 on Vista and it does attach to root, not self.top.

      It sounds like remnants of "_singledialog" are present in EditorWindow.py. Did you back out of the previous patch before applying help_nonmodal_revision.patch?

    14. python-dev commented on Feb 5, 2012

      python-devmannequin
      Mannequin

      New changeset 5452c881bd2d by Terry Jan Reedy in branch '2.7':
      bpo-964437 Make IDLE help window non-modal.
      http://hg.python.org/cpython/rev/5452c881bd2d

      New changeset a949956a80cc by Terry Jan Reedy in branch '3.2':
      bpo-964437 Make IDLE help window non-modal.
      http://hg.python.org/cpython/rev/a949956a80cc

      New changeset 2b841adbae81 by Terry Jan Reedy in branch 'default':
      Merge with 3.2 bpo-964437
      http://hg.python.org/cpython/rev/2b841adbae81

    15. terryjreedy commented on Feb 5, 2012

      @terryjreedy
      Member

      I was sure I had reverted, but did again, redownloaded, applied, and tested, and all well, so committed and pushed. 2.7 required hand-patching of ', modal' for chunk 5 due to 3rd argument being 'textFile.read()' instead of 'contents'. I presume I got it right, though could not test.

    16. serwy commented on Feb 5, 2012

      serwymannequin
      Mannequin

      I pulled the latest repo with the patch for 2.7. It works.

    17. transferred this issue fromon Apr 9, 2022
    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