isselected

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Jul 9, 2022 License: MIT Imports: 2 Imported by: 6

Documentation

Overview

Package isselected provides a widget that acts differently if selected (or focused)

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Widget

type Widget struct {
	Not      gowid.IWidget // Must not be nil
	Selected gowid.IWidget // If nil, then Not used
	Focused  gowid.IWidget // If nil, then Selected used
}

func New

func New(w1, w2, w3 gowid.IWidget) *Widget

func (*Widget) Render

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

func (*Widget) RenderSize

func (w *Widget) RenderSize(size gowid.IRenderSize, focus gowid.Selector, app gowid.IApp) gowid.IRenderBox

func (*Widget) Selectable

func (w *Widget) Selectable() bool

TODO - this isn't right. Should Selectable be conditioned on focus?

func (*Widget) String added in v1.3.0

func (w *Widget) String() string

func (*Widget) UserInput

func (w *Widget) UserInput(ev interface{}, size gowid.IRenderSize, focus gowid.Selector, app gowid.IApp) bool

type WidgetExt

type WidgetExt struct {
	*Widget
}

For uses that require IComposite

func NewExt

func NewExt(w1, w2, w3 gowid.IWidget) *WidgetExt

func (*WidgetExt) SubWidget

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

Return Focused because UserInput operations that change state will apply when the widget is in focus - so this is likely the one we want. But this looks like a rich source of bugs...

Jump to

Keyboard shortcuts

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