window

package
v0.1.5 Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2024 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

Package Windows holds the dimensions of the container window. The offsets communicate parts of the window that are already in use. This component is used by shell to adjust child components based on the window size minus the offsets.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Model

type Model struct {
	Width      int
	Height     int
	TopOffset  int
	SideOffset int
}

func New

func New(width, height, topOffset int, sideOffset int) Model

New creates a new window model the dimensions are usualy the starter default with future tea.WindowSizeMsg messages updating the height and width dimensions.

func (Model) GetWindowSizeMsg

func (m Model) GetWindowSizeMsg() tea.WindowSizeMsg

GetWindowSizeMsg returns a tea.WindowSizeMsg with the current window size minus the offsets.

func (Model) Init

func (m Model) Init() tea.Cmd

func (Model) Update

func (m Model) Update(msg tea.Msg) (Model, tea.Cmd)

Update updates the window model with the new window size.

func (Model) View

func (m Model) View() string

There is no default view.

Jump to

Keyboard shortcuts

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