I just wanted to note some unpleasant behavior I’ve noticed while writing Eto windows using the Rhino Python Editor (on both Windows OS and MacOS). I have found that if an Exception is thrown as the result of button press, (just as an example, using the template script but adding a
raise exception call when you click ‘Ok’ ) :
You get a warning window from Rhino, as expected:
but as soon as you click ‘OK’, you get stuck without any way to recover:
- If you click
Okin the custom Eto window a second time, the entire Application crashes.
- If you click either the
Cancelbutton in the Eto window, or the ‘Close Window’ button in the title bar, everything seems to get ‘stuck’. All the Rhino application commands go greyed out, and you cannot do anything except force-quite the entire application.
This is the case for both the Python editor window, as well as the main Rhino window:
I feel like this is not appropriate behavior. Its not that uncommon to get exceptions every once and while when developing windows and plugins, and I think it is a real drag to have to close the entire application every time you accidentally add a syntax error within some command.
Is there a way to avoid / fix this so that simple exceptions can get handled without crashing the entire App? Is there a code pattern that I should be using for these Eto dialogs to improve resilience? Nesting everything inside
try...except blocks seems less than ideal, and also doesn’t really seem to fix the issue?
thanks very much,