...
Tawesoft Logo

Package dialog

import "tawesoft.co.uk/go/dialog"
Overview
Index

Overview ▾

Package dialog implements simple cross platform native MessageBox/Alert dialogs for Go.

Currently, only supports Windows and Linux targets.

On Linux, uses (in order of preference) `zenity`, `xmessage`, or stdio.

Example

Usage is quite simple:

package main

import "tawesoft.co.uk/go/dialog"

func main() {
    dialog.Alert("Hello world!")
    dialog.Alert("There are %d lights", 4)
}

Package Information

License: MIT-0 (see LICENSE.txt)

Stable: yes

For more information, documentation, source code, examples, support, links, etc. please see https://www.tawesoft.co.uk/go and https://www.tawesoft.co.uk/go/dialog

2019-11-16

    * Fix incorrect formatting of multiple arguments in Linux stdio fallback

2019-10-16

    * Remove title argument from Alert function

2019-10-01

    * Fix string formatting bug in Windows build

2019-10-01

    * Support Unicode in UTF16 Windows dialogs
    * Use "golang.org/x/sys/windows" to provide WinAPI
    * Removes CGO and windows.h implementation
    * Linux stdio fallback alert no longer blocks waiting for input

2019-09-30

    * First release

func Alert

func Alert(message string, args ...interface{})

Alert displays a modal message box with message. The message string can be a printf-style format string for an optional sequence of additional arguments of any type.