Notification
###Notification class
The Notification
class provides a way to create a notification that appears in the notification menu. Each notification has a title, a text description, and an optional callback application and optional icon. If the callback application is provided, then clicking the notification will activate the app.
Notification ( str title, str text, **data )
A list of all current notifications is accessible via state.getNotificationQueue()
. The notification menu GUI component is accessible via state.getFunctionBar().notificationMenu
.
Data
-
source = ( Application or None )
The application from which the notification originated. -
image = ( str or pygame.Surface or None )
The image to display. Either the path to the image, or the Surface, or the "unknown" icon if nothing is provided. -
method onSelected
An alternative tosource
. The method to call when the notification is clicked. -
tuple onSelectedData
The data to pass toonSelected
when it is called.
Object Variables
-
str title
The title of the notification. -
str text
The text of the notification. -
bool active
Whether the notification is active. Inactive notifications are cleared from the menu. -
Application source
The app that sent the notification. Can beNone
. -
GUI.Image image
The Image created from the data passed to the constructor. -
onSelectedMethod
The method to run when the user clicks the notification. Set to theactivate
method ofsource
ifsource
is provided andonSelected
is not. Otherwise, this is theonSelected
method (see Data). -
tuple onSelectedData
The data to pass toonSelected
when it is run.
Methods
-
onSelected ()
Runs theonSelected
method, passingonSelectedData
. Also clears the notification. -
clear ()
Deactivates the notification and sweeps it from the menu. -
getContainer ( c_width=200, c_height=40 )
Creates the container for the notification with the specified height and width. Called by the NotificationMenu class.
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