Categorygithub.com/gen2brain/dlgs
modulepackage
0.0.0-20220603100644-40c77870fa8d
Repository: https://github.com/gen2brain/dlgs.git
Documentation: pkg.go.dev

# README

dlgs

TravisCI Build Status AppVeyor Build Status GoDoc Go Report Card

dlgs is a cross-platform library for displaying dialogs and input boxes.

NOTE: This repository is archived and will not be maintained anymore. See https://github.com/ncruces/zenity for cgo-free dialogs, also check https://github.com/gen2brain/iup-go for full-blown UI.

Installation

go get -u github.com/gen2brain/dlgs

Documentation

Documentation on GoDoc.

Examples

item, _, err := dlgs.List("List", "Select item from list:", []string{"Bug", "New Feature", "Improvement"})
if err != nil {
    panic(err)
}
passwd, _, err := dlgs.Password("Password", "Enter your API key:")
if err != nil {
    panic(err)
}
yes, err := dlgs.Question("Question", "Are you sure you want to format this media?", true)
if err != nil {
    panic(err)
}

More

For cross-platform notifications and alerts see beeep.

# Functions

Color displays a color selection dialog, returning the selected color and a bool for success.
Date displays a calendar dialog, returning the date and a bool for success.
Entry
Entry displays input dialog, returning the entered value and a bool for success.
Error displays error dialog.
File displays a file dialog, returning the selected file or directory, a bool for success, and an error if it was unable to display the dialog.
FileMulti displays a file dialog that allows for selecting multiple files.
Info displays information dialog.
List displays a list dialog, returning the selected value and a bool for success.
ListMulti displays a multiple list dialog, returning the selected values and a bool for success.
MessageBox displays message box and ok button without icon.
Password displays a dialog, returning the entered value and a bool for success.
Question displays question dialog.
Warning displays warning dialog.

# Variables

ErrNotImplemented is returned when function is not implemented.
ErrUnsupported is returned when operating system is not supported.