You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The API for Documents and document types has been finalized. Document handling behavior is now controlled by declaring document types as part of your ``toga.App`` definition.
The API for Documents and Document-based apps has been significantly modified. Unfortunately, these changes are not backwards compatible; any existing Document-based app will require modification.
2
+
3
+
The ``DocumentApp`` base class is no longer required. Apps can subclass ``App`` directly, passing the document types as a ``list`` of ``Document`` classes, rather than a mapping of extension to document type.
4
+
5
+
The API for ``Document`` subclasses has also changed:
6
+
7
+
* A path is no longer provided as an argument to the Document constructor;
8
+
9
+
* The ``document_type`` is now specified as a class property called ``description``; and
10
+
11
+
* Extensions are now defined as a class property of the ``Document``; and
12
+
13
+
* The ``can_close()`` handler is no longer honored. Documents now track if they are modified, and have a default ``on_close`` handler that uses the modification status of a document to control whether a document can close. Invoking ``touch()`` on document will mark a document as modified. This modification flag is cleared by saving the document.
0 commit comments