window

package
v0.0.0-...-5f41422 Latest Latest
Warning

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

Go to latest
Published: Jul 29, 2018 License: BSD-3-Clause Imports: 5 Imported by: 0

Documentation

Overview

Package window defines an event associated with windows -- including changes in the dimensions, physical resolution and orientation of the app's window, and iconify, open and close events (see also lifecycle events, which pertain to the main app window -- these window events are for all windows including dialogs and popups)

Index

Constants

This section is empty.

Variables

View Source
var KiT_Action = kit.Enums.AddEnum(ActionN, false, nil)
View Source
var KiT_Visibility = kit.Enums.AddEnum(VisibilityN, false, nil)

Functions

This section is empty.

Types

type Action

type Action int32

Action is the action taken on the window by the user

const (
	Open Action = iota
	Close
	Iconify

	// Resize includes changes in DPI
	Resize

	Maximize
	Minimize

	Move

	// Enter indicates that the user focus / mouse has entered the window
	Enter

	// Leave indicates that the user focus / mouse has left the window
	Leave

	ActionN
)

func (*Action) FromString

func (i *Action) FromString(s string) error

func (Action) String

func (i Action) String() string

type Event

type Event struct {
	oswin.EventBase

	// Size is the window's new dimensions in raw physical pixels.
	Size image.Point

	// DPI is the window's current logical dots-per-inch -- can change if
	// moved to different screen
	LogicalDPI float32

	// ScreenNumber contains index of the current physical or logical screen
	// on which the window is being displayed -- see App.Screen() for
	// the accessing the data associated with this screen
	ScreenNumber int

	// Visibility is the visibility status of the window: Closed, NotVisible,
	// Visible, Iconified
	Visibility Visibility

	// Action taken on the window -- what has changed
	Action Action
}

window.Event holds the dimensions, physical resolution, orientation, visibility status of a given window, and actions taken on the window

func (Event) Bounds

func (e Event) Bounds() image.Rectangle

Bounds returns the window's bounds in raw display dots (pixels), at the time this size event was sent.

The top-left pixel is always (0, 0).

func (Event) HasPos

func (ev Event) HasPos() bool

func (Event) OnFocus

func (ev Event) OnFocus() bool

func (Event) Pos

func (ev Event) Pos() image.Point

func (Event) Screen

func (e Event) Screen() *oswin.Screen

ScreenData returns the screen data associated with the screen on which this window is displayed

func (Event) Type

func (ev Event) Type() oswin.EventType

type Visibility

type Visibility int32

Visibility is the visibility status of the window

const (
	// Closed means the window is closed -- has not been opened yet or is now closed
	Closed Visibility = iota

	// NotVisible means the window is not visible for various reasons (occluded by other windows, off the screen), but not specifically Iconfied
	NotVisible

	// Visible means the window has been opened and is visible
	Visible

	// Iconified means the window has been iconified
	Iconified

	VisibilityN
)

func (*Visibility) FromString

func (i *Visibility) FromString(s string) error

func (Visibility) String

func (i Visibility) String() string

Jump to

Keyboard shortcuts

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