Porting EasyDialogs to Micropython 68k#32
Draft
smallsco wants to merge 1 commit intom68k-micropython:mainfrom
Draft
Porting EasyDialogs to Micropython 68k#32smallsco wants to merge 1 commit intom68k-micropython:mainfrom
smallsco wants to merge 1 commit intom68k-micropython:mainfrom
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.

Summary
This is a port of MacPython's EasyDialogs library to Micropython 68k.
It's still in progress, but some early feedback would be great as it's not quite working yet.
Testing
Tested on Mac OS 7.6.1 using Basilisk II.
Right now we raise an exception because this doesn't work:
which is probably just me calling the struct function incorrectly rather than a problem with micropython itself.
Also, the Control Manager is required in order to set the text of the "OK" button, so that doesn't work at the moment either.
Setting the default dialog item doesn't seem to work - but I suspect that it actually does work, and the dialog just isn't being redrawn by the OS after we set this (since we immediately throw an exception in ModalDialog right after).
Only the
Message()function is currently implemented. I'll work on the others once this one is working.You'll need to decompress the
EasyDialogs.rsrcfile and place it in the same location as the Micropython application, or the app will bomb when trying to load resources. I need to research how to do error handling for Toolbox functions so we can catch it (and raise a Python exception instead). This isn't a priority though.Trade-offs and Alternatives
For the simplest of dialogs you can use the built-in Toolbox functions. This goes one step further and implements some additional common dialog types (and eventually it will implement a progress bar window as well).