Documentation ¶
Overview ¶
Package notifications exposes functions to display messages in toast widgets.
Index ¶
Constants ¶
View Source
const Medium float32 = 4
Medium is the standard duration for a notification
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Notification ¶
Notification is a message that will be displayed on the screen during a certain time.
func Display ¶
func Display(severity Severity, message string, duration float32) *Notification
Display creates a new notification.
func DisplayAndLog ¶
func DisplayAndLog(severity Severity, prefix, message string, vars ...interface{}) *Notification
DisplayAndLog creates a new notification and also logs the message to stdout.
func (*Notification) Update ¶ added in v0.9.9
func (n *Notification) Update(severity Severity, message string, vars ...interface{})
Update the message of a given notification. Also resets the delay before disapearing.
type Severity ¶ added in v0.2.8
type Severity uint8
Severity represents the severity of a notification message. It will affect the color of the notification text in the UI.
const ( // Info is for informative message, when everything is fine Info Severity = iota // Success is for successful actions Success // Warning is also for informative messages, when something is not right // for example, if a menu entry has not been implemented. Warning // Error is for failed actions. For example, trying to load a game that // doesn't exists. Error )
Click to show internal directories.
Click to hide internal directories.