classification
Title: IDLE: add docstrings to grep.py
Type: enhancement Stage: commit review
Components: IDLE Versions: Python 3.7, Python 3.6
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: terry.reedy Nosy List: csabella, louielu, terry.reedy
Priority: normal Keywords:

Created on 2017-06-15 12:27 by csabella, last changed 2017-06-16 23:03 by csabella.

Pull Requests
URL Status Linked Edit
PR 2213 open csabella, 2017-06-15 12:29
Messages (6)
msg296199 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2017-06-16 15:18
On PR 2213, Cheryl said "One other question -- when I run this, the dialog box always opens way on the bottom of my screen. Has anyone requested a change to this before? Or would it be worth mentioning on idle-dev?"  Louie sees top left on Mac, I see same on Windows.

Same is true for me for all search boxes.  Cheryl, only grep box or others?  I would find bottom surprising and likely annoying.  Feel free to open issue with detail.  Louie, what do you see on Linux?
msg296200 - (view) Author: Louie Lu (louielu) * Date: 2017-06-16 15:22
On Linux, it stick to the top-right of the IDLE, that says I can't reproduce the bump-out at the bottom :(
msg296206 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2017-06-16 15:38
Are you two using different Linux distributions with different graphics managers?  Could tk act different on different distributions?
msg296211 - (view) Author: Cheryl Sabella (csabella) * Date: 2017-06-16 16:46
Thanks.  It seems like my windows pop-up all over the place.  It's probably a Ubuntu thing.  

I was used to looking at help_about and textview, which cascade over the current window (I think because of self.geometry) and that's what prompted my initial question.  But, the search dialogs aren't even all the same.  

If IDLE is in the middle of the screen,
- 'Find' and 'replace' pin to the top left of my screen, as far top and as far left as it could go.
- 'Find in files' pins to the bottom left, as far to the bottom as possible.

If I move the IDLE window, it generally stays the same as above, but if IDLE is in the top left, then the find and replace are to the right of it and find in files is still at the bottom.

I was going to ask this anyway, but help_about and those dialogs inherit from Toplevel and have a parent, but searchbase doesn't.  I don't understand why there's a difference.  The search dialogs are modal, even though the Output Window isn't.  Maybe it would help to control where they display in relation to a parent window?
msg296217 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2017-06-16 19:09
Since all three search boxes call the same open, they use the same hidden placement algorithm.  On Windows, the last position when closed is re-used for the next open for the duration of the IDLE session.  When IDLE is closed and reopened, the initial position is reset to a 'cascade' position.  What about Ubuntu?  Is it remembering across IDLE sessions? 

The 'difference' you noticed concerns 'is-a' relationships (via inheritance) versus 'has-a' relationships (via composition).  It is a perennial debate among some in the OOP community, with no resolution.  Python allows both.

IDLE uses both.  Different people? Same person, different times? Some perceived specific reason for each? I slightly prefer 'is-a' because it seems simpler, and inheritance does not bother me.  When we 'framify' the search widgets, I expect to use Frame subclasses.

Perhaps more important is grab-bag or kitchen-sink classes versus focused classes.  EditorWindow has a TopLevel, a Frame placed within the Toplevel, and, among other things, a Multicall-wrapped Text placed within the frame.  A method can be about any of them, and there are methods not about any of them, or about editing (open turtledemo).  There should be separate window, frame, and text classes with the methods appropriate to each.  I am sure that this would make the editor easier to learn, test and patch.

Modal or not is a separate debate.  Most recent opinions have been to make fewer things modal.  #24813 would make About IDLE non-modal. #24039 and #24760 include search dialogs.
msg296220 - (view) Author: Cheryl Sabella (csabella) * Date: 2017-06-16 23:03
Thanks, Terry.  It seems that it *is* the hidden placement algorithm and I just never noticed it before.  I opened a bunch of terminal windows and they opened top left, bottom left, top right, bottom right, then continuing to follow a pattern.  IDLE did the same thing.  However, it isn't always opening the search dialogs in the same place even when I open the three in a row.  Maybe it's the size of the windows or something else that is causing the algorithm to render them differently.  Even though I can now understand the behavior, it's still frustrating because I'd expect the search box to pop up where I'm looking and not somewhere else on the screen entirely.

I have Windows 7 on my work laptop with 2 monitors and behavior was better.  The search dialogs opened more in the middle of the screen, near the IDLE window.  Although, if I put IDLE on the left monitor, the search dialog still opened in the same place on the right monitor, but it was easy to notice.

Thanks for explaining all that about the windows and dialogs.  At this point, I would say that consitency within the app would make it easier to understand for me as a newcomer.  If everything followed the pattern of window, frame, and text, then I wouldn't wonder about the differences, especially if there really isn't any intended difference.  And thank you for the links to those other issues and discussions.
History
Date User Action Args
2017-06-16 23:03:54csabellasetmessages: + msg296220
2017-06-16 19:09:04terry.reedysetmessages: + msg296217
2017-06-16 16:46:55csabellasetmessages: + msg296211
2017-06-16 15:38:38terry.reedysetmessages: + msg296206
2017-06-16 15:22:19louielusetnosy: + louielu
messages: + msg296200
2017-06-16 15:18:27terry.reedysetstage: commit review
versions: + Python 3.6
2017-06-16 15:18:03terry.reedysetmessages: + msg296199
2017-06-15 12:29:25csabellasetpull_requests: + pull_request2257
2017-06-15 12:27:17csabellacreate