Skip to content

Application

Adam Furman edited this page Jul 8, 2016 · 5 revisions

###Application class

The Application class is the basis of the programmable Python OS application. It is instantiated from an application's app.json manifest. A list of all and all active applications is accessible through the state.

Application ( location ) Note: You should not call the constructor.

A list of all applications and running apps is accessible via state.getApplicationList(). The current running application is accessible via state.getActiveApplication().

Static Methods

  • dummy ( *args, **kwargs ) Used as a dummy or default method in many callbacks and event handlers.
  • getListings () Returns a dictionary of app listings loaded from apps/apps.json.
  • chainRefreshCurrent () Runs the active application's refresh method.
  • setActiveApp ( app="prev" ) Sets the active application. Use a specific app's activate method instead!
  • fullCloseApp ( app ) Fully deactivates an app and activates the most recent one from the stack.
  • fullCloseCurrent () Calls fullCloseApp on the current active app.
  • install ( packageloc ) Installs the app package at packageloc to the system. This should be a ZIP file.
  • registerDebugApp ( path ) Adds an app to the system from path without a ZIP file. Useful for debugging.
  • registerDebugAppAsk () Presents a folder selection dialog that pipes data to registerDebugApp. This is activated by long pressing the State Shell button in the About app.

Object Variables

  • dict parameters Contains the application parameters from the more entry in app.json.
  • str location The location of the application on the system.
  • str name The name as specified in the manifest.
  • str title The title as specified in the manifest.
  • float version The version as specified in the manifest.
  • str author The author as specified in the manifest.
  • module The module loaded from the class path in the manifest.
  • str file = None The filepath to open. Used by the files app to pass the location of the file to open to the app.
  • mainMethod The method specified in the manifest. If it does not exist, it is set to Application.dummy.
  • dict eventHandlers Contains the event handler methods loaded from the manifest.
  • Thread thread The application's thread, used to execute the applications events as well as run the main method.
  • AppContainer ui The AppContainer for the application. Positioned at (0,0) and used as the root of the GUI.
  • DataStore dataStore The DataStore for the application.

Methods

  • getModule () Returns the app's module parameter. See Object Variables -> module.
  • chainRefresh () Runs refresh () on the entire GUI stack.
  • onStart () Called automatically on activation.
  • loadColorScheme () Loads the color scheme from parameters and sets it as the current scheme by calling state.getColorPalette.setScheme.
  • activate () Activates the application, pausing the currently active one.
  • pygame.Surface getIcon () Returns the application's icon as a Surface.
  • deactivate ( pause=True ) Pauses or completely closes the application and reactivates the most recent one from the stack.
  • uninstall () Completely removes and uninstalls the app. Do not run while the app is active.

Home

Getting Started

Documentation

Threads and Tasks

Applications and Notifications

The State Class and Variable

The GUI, Events, Resources, and Dialogs

The following classes are all under the GUI class, e.g. Font is actually accessed as GUI.Font.

  • Font class
  • Icons class
  • ColorPalette class
  • LongClickEvent class
  • IntermediateUpdateEvent class
  • EventQueue class
  • FunctionBar class
  • Keyboard class
  • Overlay class
  • Dialog class
    • OKDialog dialog
    • ErrorDialog dialog
    • WarningDialog dialog
    • YNDialog dialog
    • OKCancelDialog dialog
    • AskDialog dialog
    • CustomContentDialog dialog
  • NotificationMenu overlay
    • RecentAppSwitcher overlay
    • Selector overlay

GUI Components and Containers

  • Component class

The following classes are all Components, they inherit from that class.

  • Container component
  • AppContainer container
  • Button container
  • KeyboardButton container
  • TextEntryField container
  • PagedContainer container
    • GriddedPagedContainer container
    • ListedPagedContainer container
  • ButtonRow container
  • ScrollableContainer container
    • ListScrollableContainer container
    • TextScrollableContainer container
    • MultiLineTextEntryField container
  • Text component
  • MultiLineText component
  • ExpandingMultiLineText component
  • Image component
  • Slider component
  • Checkbox component
  • Switch component
  • Canvas component
  • ScrollIndicator component
Clone this wiki locally