PyGUI - Application class

# class `Application(MessageHandler)`

Each application has exactly one Application object, which looks after application-wide concerns such as maintaining the set of windows and documents, running the event loop, and handling global menu commands.

## Global Functions

`application()`
  Returns the Application instance. The first time an instance of Application or a subclass of Application is created, a global reference to it is stored; the `application` function returns this reference.
  If this function is called before any Application object has been created, it creates an instance of class Application automatically.

## Properties

> `menus`
>   List of application-wide Menu instances. These menus will always be available regardless of which window is active.
>   Do not modify the contents of this list directly. If you want to add or remove menus, build a new list of menus and assign the whole list to the `menus` property. Otherwise, the displayed menus may not be updated properly.
> `windows`
>   Read-only. List of all currently existing Window instances.
> `documents`
>   Read-only. List of all currently existing Document instances.
> `std_menu_bar`
>   Read-only. List of menus containing all the framework-defined menu commands in their standard positions according to platform conventions. The standard menu items and their command names are:
> - New (`new_cmd`)
> - Open... (`open_cmd`)
> - Close (`close_cmd`)
> - Save (`save_cmd`)
> - Save As... (`save_as_cmd`)
> - Revert (`revert_cmd`)
> - Quit (`quit_cmd`)
> - Undo (`undo_cmd`)
> - Cut (`cut_cmd`)
> - Copy (`copy_cmd`)
> - Paste (`paste_cmd`)
> - Clear (`clear_cmd`)

## Methods

> `run()`
>   The main event loop. A program calls this method after initialisation, and it retains control until a `Quit` exception is raised. Catches any other unhandled exceptions and reports them to the user with a default alert box.
> `handle_next_event()`
>   Waits for the next input event to occur and handles it. A custom event loop may be constructed by calling this method repeatedly until some condition is met.
> `new_cmd()`
>   Implements the standard New command. Calls `make_new_document` to create a new document, initialises it as an empty document, and calls `make_window` to create an initial window for it.
> `open_cmd()`
>   Implements the standard Open... command. Requests a file name from the user, calls `make_file_document` to create a document, loads the document from the file, and calls `make_window` to create an initial window for it.
> `quit_cmd()`
>   Implements the standard Quit command. Asks the user whether to save changes to any changed documents, and if the user doesn't cancel, raises a `Quit` exception.
> `query_clipboard()`
>   Returns true if the clipboard contains any data. This is likely to be more efficient than testing the result of `get_clipboard()`.
> `get_clipboard()`
>   Returns the current contents of the clipboard as a string, or an empty string if the clipboard contains no data.

> `set_clipboard(`data`)`
>   Replaces the contents of the clipboard with the given data, which should be a string.

## Abstract Methods

> `make_new_document()`
>   Should create a new Document object of the appropriate class in response to a New command.
> `make_file_document(fileref)`
>   Should create a new Document object of the appropriate class for the file represented by the given FileRef. May examine the file name, read the beginning of the file or do whatever else is necessary to determine what class of object to create.
> `make_window(document)`
>   Should create a Window containing a component hierarchy suitable for viewing the given Document object.

---