trackfocus

package
v2.4.0 Latest Latest
Warning

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

Go to latest
Published: Jul 11, 2022 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

Package trackfocus provides a widget that issues callbacks when a widget loses or gains the focus.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FocusGainedCB

type FocusGainedCB struct{}

type FocusLostCB

type FocusLostCB struct{}

Markers to track the callbacks being added. These just need to be distinct from other markers.

type Widget

type Widget struct {
	gowid.IWidget
	// contains filtered or unexported fields
}

func New

func New(w gowid.IWidget) *Widget

func (*Widget) OnFocusGained

func (w *Widget) OnFocusGained(f gowid.IWidgetChangedCallback)

func (*Widget) OnFocusLost

func (w *Widget) OnFocusLost(f gowid.IWidgetChangedCallback)

Boilerplate to make the widget provide methods to add and remove callbacks.

func (*Widget) RemoveOnFocusGained

func (w *Widget) RemoveOnFocusGained(f gowid.IIdentity)

func (*Widget) RemoveOnFocusLost

func (w *Widget) RemoveOnFocusLost(f gowid.IIdentity)

func (*Widget) Render

func (w *Widget) Render(size gowid.IRenderSize, focus gowid.Selector, app gowid.IApp) gowid.ICanvas

func (*Widget) SetSubWidget

func (w *Widget) SetSubWidget(wi gowid.IWidget, app gowid.IApp)

func (*Widget) SubWidget

func (w *Widget) SubWidget() gowid.IWidget

Provide IComposite and ISettableComposite. This makes the widget cooperate with general utilities that walk the widget hierarchy, like FocusPath().

Jump to

Keyboard shortcuts

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