gobox

package module
v0.0.0-...-26d2021 Latest Latest
Warning

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

Go to latest
Published: Jul 24, 2024 License: MIT Imports: 9 Imported by: 0

README

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:

Screenshot from 2024-07-16 17-37-23

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// icons
	Info     string
	Question string
	Error    string
	Warning  string

	// standard fontsize for every OS
	StandardSize float32
	IconHeight   float32
	IconWidth    float32
)

Functions

func DialogBox

func DialogBox(title string, icon string, message string, btntext string, fontsize float32, w float32, h float32)

DialogBox displays a modal dialog box with an icon, message, and button.

Types

This section is empty.

Jump to

Keyboard shortcuts

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