Add more arguments for edit string popups#129
Add more arguments for edit string popups#129MattRoyle wants to merge 4 commits intonion-software:masterfrom
Conversation
cc4574c to
5d0e5a5
Compare
cmeyer
left a comment
There was a problem hiding this comment.
On macOS, it looks like this.
On Windows, it looks like this.
On both platforms, the Escape key no longer works - as expected since the self.__request_close_fn() was removed.
Tested from console with this script:
from nion.ui import Dialog
Dialog.pose_edit_string_pop_up("X", lambda x: None, window=_window)
I would recommend:
- switch back to the old style window that does not have close/min/max buttons.
- model it after .Net MessageBox function
- restore the escape handling.
I cannot reproduce the escape-triggering-console message problem - so let's try to reproduce that reliably and fix it separately before this PR.
The script you ran was hadn't set the window_style so it was defaulting to a window vs if you pass in a "default" it will be the modeless style. The modeless style would throw the console error when return was pressed, while the window would behave properly. I updated the code to check that the window style is not "default" before running the close function which means the escape now should work again in your tests. If there are any other dialog options that cause that error, i.e. that don't make a window, then it should check those too, but I haven't done that yet. |
Adds arguments for the window style and Cancel and Done buttons.
Remove unnecessary call to __request_close_fn in reject that caused a console error when clicking escape.
If either button is a string then it will display the buttons, otherwise it will have the existing behavior of not having buttons.