alert

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 1, 2017 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package alert implements basic alerts.

alert.Alert("Title", "Message") // Has an OK button by default.
alert.Alert("Title", "Message", &Button{
    Title:"Cancel",
    OnPress: func() {
        // Do something
    }
})

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Alert

func Alert(title, message string, buttons ...*Button)

Alert displays an alert with the given title, message and buttons. If no buttons are passed, a default OK button is created.

Types

type Button

type Button struct {
	Title   string
	Style   ButtonStyle
	OnPress func()
}

Button represents an alert button.

type ButtonStyle

type ButtonStyle int

Alert button styles.

const (
	ButtonStyleDefault ButtonStyle = iota
	ButtonStyleCancel
	ButtonStyleDestructive
)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL