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
bpo-42685: Improve placing of simple query windows. #23856
bpo-42685: Improve placing of simple query windows. #23856
Conversation
* 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.
|
When checking code, IDLE changed focus to Shell in case there are warning messages. (I want to change this, but...) If there is a syntax error, current code calls messagebox.showerror and tries to put focus on the editor. The latter raised the editor over Shell but focus remains on the modal messagebox until it is dismissed. Error box is centered. After I put the focus line first, nothing changes. Should it? Is not a visible focused parent 'mapped'? idlelib.runscript 206/7. Edit: After reading the patch and tkinter.messagebox, the error box should not be changed as it is a commondialog rather than simple dialog. Do you plan to change the commondialogs also? To me, they need it more. The only easily trigger simpledialog in IDLE is askinteger('Tab width') for Format => Tabify and Untabify. If I select either of those with a mouse and want to click [OK] to accept the default of 4, I actually prefer the box where it is, up near the menu. Either way, entering a value out of the range puts an error messagebox in the center of the screen. Edit2: IDLE's query.Query boxes put error messages in red in the entry box. I think that this would be an improvement for askinteger. |
|
I have read the code but not checked it in detail. It does center 'Tab width' and I consider this a better default position even if not the best for this particular box. The 5 types of query.Query boxes are centered and I am satisfied with that and have never considered moving any of them. |
|
Dialogs in This PR just adds the code used to place native Tk dialogs rewritten to Python. |
|
Moved the code to separate function (which corresponds Tk private function It can be reused also in IDLE, but I left this to separate PR. |
|
If I decide to use _place_window before 3.8 or 3.9 leave maintenance, I will put a copy in idlelib for those versions. |
* 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.
centered at the center of parent. Its position and size
can be corrected so that it fits in the virtual root window.
https://bugs.python.org/issue42685