So far I've just implemented the bare minimum to get the calculator example working. This includes:
PyScript-based backends for the Toga Box, Button and TextInput widgets.
Custom widget subclasses for Page, Row and Column.
An implementation of from_datastore in terms of Toga's ValueSource interface. This is only supported by the TextInput.value property so far, but from the linked Toga PR you can see how easy it would be to extend it to every property of every widget.
A to_channel wrapper to redirect a Toga event to an Invent channel. The event name is currently hardcoded as "press" because Toga doesn't provide that information at the time the event is fired, but that could easily be fixed.
I also changed the calculator layout from a Grid to multiple Rows, since Toga doesn't have a Grid widget yet This could easily be added as a custom widget in the same way as Page, Row and Column, and we'd be happy to adopt it in Toga itself.
Corresponding Toga PR:
So far I've just implemented the bare minimum to get the calculator example working. This includes:
from_datastore
in terms of Toga'sValueSource
interface. This is only supported by theTextInput.value
property so far, but from the linked Toga PR you can see how easy it would be to extend it to every property of every widget.to_channel
wrapper to redirect a Toga event to an Invent channel. The event name is currently hardcoded as "press" because Toga doesn't provide that information at the time the event is fired, but that could easily be fixed.I also changed the calculator layout from a Grid to multiple Rows, since Toga doesn't have a Grid widget yet This could easily be added as a custom widget in the same way as Page, Row and Column, and we'd be happy to adopt it in Toga itself.