Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR is one step of an attempt at breaking #28 up into chunks. This chunk contains the widget toolkit logic necessary for implementing events. Notably, this logic is mostly sitting on the sidelines and does not affect the existing example code.
The
scenex.apppackageThis new package mostly contains functionality adapted from ndv. The
NDVAppclass has been renamed toApp, and the correct app for a given python environment can be retrieved fromscenex.app.app(). The returnedAppcan start an event loop, call functions on the main thread, etc. etc. We only need some of this functionality here in scenex (the rest is needed for ndv), but the design favors centralizing all that logic into one package that could be easily split out later.The
scenex.app.eventspackageThis package contains dataclasses designed to abstract the event functionality of the various widget toolkits, inspired by similar classes in ndv. Without the rest of #28 they don't get much use here, although I did migrate their test suite as well. It may be nice to evaluate their design in an abstract sense as well.
@tlambert03 please let me know if you'd rather review this chunk of functionality instead of #28 as a whole. It's not quite ready for merge because there are a few more bugs to work out: