Gobox 💬
Gobox is a simple library used for creating popup dialogs on Windows,Linux and Mac.
Getting started:
go get github.com/jexlor/gobox
import( "github.com/jexlor/gobox" ) //import library
Usage:
func main() {
gobox.DialogBox() //this is the function which popups dialog box. let's configure it..
}
func main() {
gobox.DialogBox("Error") //title of a box
}
func main() {
gobox.DialogBox("Error", gobox.Error, ) //add icon (there are also Question,Info and Warning icons)
}
func main() {
gobox.DialogBox("Error", gobox.Error, "Error while loading files!") //add message
}
func main() {
gobox.DialogBox("Error", gobox.Error, "Error while loading files!", "Ok") //add button text
}
func main() {
gobox.DialogBox("Error", gobox.Error, "Error while loading files!", "Ok", gobox.StandardSize) //standard fontsize for your os (you can change it manually though)
}
func main() {
gobox.DialogBox("Error", gobox.Error, "Error while loading files!", "Ok", gobox.StandardSize, 0, 0) //add height and width(0 0 is a default size)
}
Result: