window

package
v12.46.0 Latest Latest
Warning

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

Go to latest
Published: May 16, 2022 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package window provides methods for working terminal window

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetHeight

func GetHeight() int

GetHeight returns window height

Example
height := GetHeight()

if height == -1 {
	fmt.Println("Can't detect window size")
	return
}

fmt.Printf("Window height: %d\n", height)
Output:

func GetSize

func GetSize() (int, int)

GetSize returns window width and height

Example
width, height := GetSize()

if width == -1 && height == -1 {
	fmt.Println("Can't detect window size")
	return
}

fmt.Printf("Window size: %d x %d\n", width, height)
Output:

func GetWidth

func GetWidth() int

GetWidth returns window width

Example
width := GetWidth()

if width == -1 {
	fmt.Println("Can't detect window size")
	return
}

fmt.Printf("Window width: %d\n", width)
Output:

Types

This section is empty.

Jump to

Keyboard shortcuts

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