Application
###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 fromapps/apps.json
. -
chainRefreshCurrent ()
Runs the active application'srefresh
method. -
setActiveApp ( app="prev" )
Sets the active application. Use a specific app'sactivate
method instead! -
fullCloseApp ( app )
Fully deactivates an app and activates the most recent one from the stack. -
fullCloseCurrent ()
CallsfullCloseApp
on the current active app. -
install ( packageloc )
Installs the app package atpackageloc
to the system. This should be a ZIP file. -
registerDebugApp ( path )
Adds an app to the system frompath
without a ZIP file. Useful for debugging. -
registerDebugAppAsk ()
Presents a folder selection dialog that pipes data toregisterDebugApp
. This is activated by long pressing the State Shell button in the About app.
Object Variables
-
dict parameters
Contains the application parameters from themore
entry inapp.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 thefiles
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 toApplication.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'smodule
parameter. See Object Variables -> module. -
chainRefresh ()
Runsrefresh ()
on the entire GUI stack. -
onStart ()
Called automatically on activation. -
loadColorScheme ()
Loads the color scheme fromparameters
and sets it as the current scheme by callingstate.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.
Wiki and documentation by Adam Furman. Find an error or have a suggestion? Send it to furmada (at) gmail dot com.
Documentation
-
Application
class -
ApplicationList
class -
Notification
class-
PermanentNotification
class
-
-
NotificationQueue
class -
DataStore
class -
ImmersionUI
class
-
State
class
-
GUI
class
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
-
-
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