Skip to content

Commit

Permalink
Final tweaks to app API docs.
Browse files Browse the repository at this point in the history
  • Loading branch information
freakboy3742 committed Jun 20, 2024
1 parent 05b74c4 commit 3cbb993
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions docs/reference/api/app.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,9 @@ Usage
-----

The App class is the top level representation of all application activity. It is a
singleton object - any given process can only have a single App. That
application may manage multiple windows, but it is guaranteed to have at least one
window (called the :attr:`~toga.App.main_window`); when the App's
:attr:`~toga.App.main_window` is closed, the application will exit.
singleton object - any given process can only have a single App. That application may
manage multiple windows, but it will generally have at least one window (called the
:attr:`~toga.App.main_window`).

The application is started by calling :meth:`~toga.App.main_loop()`. This will invoke
the :meth:`~toga.App.startup()` method of the app.
Expand Down Expand Up @@ -46,8 +45,11 @@ that will be added to the main window of the app.
This approach to app construction is most useful with simple apps. For most complex
apps, you should subclass :class:`toga.App`, and provide an implementation of
:meth:`~toga.App.startup()`. This implementation *must* create and assign a
``main_window`` for the app.
:meth:`~toga.App.startup()`. This implementation *must* assign a value to
:attr:`~toga.App.main_window` for the app. The value that is assigned controls the type
of app that is created. The possible values that can be assigned to
:attr:`~toga.App.main_window` is :ref:`discussed below <assigning-main-window>`; the
most common type of app will assign an instance of :any:`toga.MainWindow`:

.. code-block:: python
Expand Down Expand Up @@ -78,6 +80,8 @@ method is invoked *after* :meth:`~toga.App.startup()`, but *before* menus are po
for the first time. If you wish to customize the menu items exposed by your app, you should
override the :meth:`~toga.App.create_app_commands()` method.

.. _assigning-main-window:

Assigning a main window
-----------------------

Expand Down

0 comments on commit 3cbb993

Please sign in to comment.