window

package
v1.2.17 Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2022 License: BSD-3-Clause Imports: 6 Imported by: 0

Documentation

Overview

Package window defines events associated with windows -- including changes in the dimensions, physical resolution and orientation of the app's window, and iconify, open and close events.

Index

Constants

This section is empty.

Variables

View Source
var KiT_Actions = kit.Enums.AddEnum(ActionsN, kit.NotBitFlag, nil)

Functions

This section is empty.

Types

type Actions

type Actions int32

Actions is the action taken on the window by the user.

const (
	// Close means that the window is about to close, but has not yet closed.
	Close Actions = iota

	// Minimize means that the window has been iconified / miniaturized / is no
	// longer visible.
	Minimize

	// Resize means that the window was resized, including changes in DPI
	// associated with moving to a new screen.  Position may have also changed
	// too.  Requires a redraw.
	Resize

	// Move means that the window was moved but NOT resized or changed in any
	// other way -- does not require a redraw, but anything tracking positions
	// will want to update.
	Move

	// Focus indicates that the window has been activated for receiving user
	// input.
	Focus

	// DeFocus indicates that the window is no longer activated for
	// receiving input.
	DeFocus

	// Paint indicates a request to repaint the window.
	Paint

	// Show is for the WindowShow event
	Show

	// ScreenUpdate occurs when any of the screen information is updated
	// This event is sent to the first window on the list of active windows
	// and it should then perform any necessary updating
	ScreenUpdate

	ActionsN
)

func (*Actions) FromString

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

func (Actions) String

func (i Actions) String() string

type Event

type Event struct {
	oswin.EventBase

	// Action taken on the window -- what has changed.  Window state fields
	// have current values.
	Action Actions
}

window.Event reports on actions taken on a window. The oswin.Window Flags and other state information will always be updated prior to this event being sent, so those should be consulted directly for the new current state.

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) String

func (ev *Event) String() string

func (*Event) Type

func (ev *Event) Type() oswin.EventType

type FocusEvent

type FocusEvent struct {
	Event
}

window.FocusEvent is for synthetic window focus event that is sent to widget consumers sent when user focus on window changes (action is Focus or DeFocus) all other window events go from OS to window consumer but are not forwarded.

func (*FocusEvent) Type

func (ev *FocusEvent) Type() oswin.EventType

type ShowEvent

type ShowEvent struct {
	Event
}

window.ShowEvent is for synthetic window show event that is sent to widget consumers sent only once when window is first created. all other window events go from OS to window consumer but are not forwarded.

func (*ShowEvent) Type

func (ev *ShowEvent) Type() oswin.EventType

Jump to

Keyboard shortcuts

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