DesktopApp#
- class toui.apps.DesktopApp(name='App', assets_folder=None)[source]#
Bases:
_AppA class that creates a desktop application from HTML files.
- name#
The name of the app
- Type:
str
- pages#
A list of added Page objects.
- Type:
list
- user_vars#
A normal dictionary. It was created only to make the API for the Website class and DesktopApp class similar.
- Type:
dict
Examples
Creating a desktop app:
>>> from toui import DesktopApp >>> app = DesktopApp("MyApp")
Creating a page and adding it to the app:
>>> from toui import Page >>> home_page = Page(html_str="<h1>This is the home page</h1>") >>> app.add_pages(home_page)
Running the app:
>>> if __name__ == "__main__": ... app.run()
See also
- Parameters:
name (str) – The name of the app.
Methods#
Adds pages to the app. |
|
Returns the current Page. |
|
Opens a new window that has the specified URL. |
|
Runs the app. |