ui

package
v0.0.0-...-ffc0a70 Latest Latest
Warning

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

Go to latest
Published: Mar 5, 2020 License: Zlib Imports: 19 Imported by: 0

README

NanoGUI.go
================

This is a golang port of `NanoGUI <https://github.com/wjakob/nanogui>`_. NanoGUI is a a minimalistic cross-platform widget library for OpenGL. 

Default Font Customize Guide
--------------------------------

TBD

Copyrights
----------------

It contains the following fonts:

* Roboto Fonts

  * Genshin Bold
  * Genshin Regular

* Material Design Icon: https://www.google.com/design/icons/

  * Material Design Icon is developed by Google and it is released under Creative Commons 4.0 CC-BY.

License
----------

zlib license

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Asset

func Asset(name string) ([]byte, error)

Asset loads and returns the asset for the given name. It returns an error if the asset could not be found or could not be loaded.

func AssetDir

func AssetDir(name string) ([]string, error)

AssetDir returns the file names below a certain directory embedded in the file by go-bindata. For example if you run go-bindata on data/... and data contains the following hierarchy:

data/
  foo.txt
  img/
    a.png
    b.png

then AssetDir("data") would return []string{"foo.txt", "img"} AssetDir("data/img") would return []string{"a.png", "b.png"} AssetDir("foo.txt") and AssetDir("notexist") would return an error AssetDir("") will return []string{"data"}.

func AssetInfo

func AssetInfo(name string) (os.FileInfo, error)

AssetInfo loads and returns the asset info for the given name. It returns an error if the asset could not be found or could not be loaded.

func AssetNames

func AssetNames() []string

AssetNames returns the names of the assets.

func GetTime

func GetTime() float32

func InitWidget

func InitWidget(child, parent Widget)

func MustAsset

func MustAsset(name string) []byte

MustAsset is like Asset but panics when Asset would return an error. It simplifies safe initialization of global variables.

func RestoreAsset

func RestoreAsset(dir, name string) error

RestoreAsset restores an asset under the given directory

func RestoreAssets

func RestoreAssets(dir, name string) error

RestoreAssets restores an asset under the given directory recursively

func SetDebug

func SetDebug(d bool)

Types

type AdvancedGridLayout

type AdvancedGridLayout struct {
	// contains filtered or unexported fields
}

func NewAdvancedGridLayout

func NewAdvancedGridLayout(sizes ...[]int) *AdvancedGridLayout

func (*AdvancedGridLayout) Anchor

func (a *AdvancedGridLayout) Anchor(widget Widget) Anchor

func (*AdvancedGridLayout) AppendCol

func (a *AdvancedGridLayout) AppendCol(size int, defaultStretch ...float32)

func (*AdvancedGridLayout) AppendRow

func (a *AdvancedGridLayout) AppendRow(size int, defaultStretch ...float32)

func (*AdvancedGridLayout) ColCount

func (a *AdvancedGridLayout) ColCount() int

func (*AdvancedGridLayout) Margin

func (a *AdvancedGridLayout) Margin() int

func (*AdvancedGridLayout) OnPerformLayout

func (a *AdvancedGridLayout) OnPerformLayout(widget Widget, ctx *vg.Context)

func (*AdvancedGridLayout) PreferredSize

func (a *AdvancedGridLayout) PreferredSize(widget Widget, ctx *vg.Context) (int, int)

func (*AdvancedGridLayout) RowCount

func (a *AdvancedGridLayout) RowCount() int

func (*AdvancedGridLayout) SetAnchor

func (a *AdvancedGridLayout) SetAnchor(widget Widget, anchor Anchor)

func (*AdvancedGridLayout) SetColStretch

func (a *AdvancedGridLayout) SetColStretch(index int, stretch float32)

func (*AdvancedGridLayout) SetMargin

func (a *AdvancedGridLayout) SetMargin(m int)

func (*AdvancedGridLayout) SetRowStretch

func (a *AdvancedGridLayout) SetRowStretch(index int, stretch float32)

func (*AdvancedGridLayout) String

func (a *AdvancedGridLayout) String() string

type Alignment

type Alignment uint8
const (
	Middle Alignment = iota
	Minimum
	Maximum
	Fill
)

func (Alignment) String

func (a Alignment) String() string

type Anchor

type Anchor struct {
	// contains filtered or unexported fields
}

func NewAnchor

func NewAnchor(x, y int, aligns ...Alignment) Anchor

func NewAnchorWithSize

func NewAnchorWithSize(x, y, w, h int, aligns ...Alignment) Anchor

func (*Anchor) String

func (a *Anchor) String() string

type App

type App struct {
	// contains filtered or unexported fields
}

App is a window manager and pumps events to windows

func NewApp

func NewApp(name string) *App

func (*App) NewWindow

func (app *App) NewWindow(width, height int, caption string, resizable, fullScreen bool) *Window

One Window contains one OpenGL render goroutine and event goroutine

func (*App) Run

func (app *App) Run()

type BoxLayout

type BoxLayout struct {
	// contains filtered or unexported fields
}

func NewBoxLayout

func NewBoxLayout(orientation Orientation, alignment Alignment, setting ...int) *BoxLayout

func (*BoxLayout) Alignment

func (b *BoxLayout) Alignment() Alignment

func (*BoxLayout) Margin

func (b *BoxLayout) Margin() int

func (*BoxLayout) OnPerformLayout

func (b *BoxLayout) OnPerformLayout(widget Widget, ctx *vg.Context)

func (*BoxLayout) Orientation

func (b *BoxLayout) Orientation() Orientation

func (*BoxLayout) PreferredSize

func (b *BoxLayout) PreferredSize(widget Widget, ctx *vg.Context) (int, int)

func (*BoxLayout) SetAlignment

func (b *BoxLayout) SetAlignment(a Alignment)

func (*BoxLayout) SetMargin

func (b *BoxLayout) SetMargin(m int)

func (*BoxLayout) SetOrientation

func (b *BoxLayout) SetOrientation(o Orientation)

func (*BoxLayout) SetSpacing

func (b *BoxLayout) SetSpacing(s int)

func (*BoxLayout) Spacing

func (b *BoxLayout) Spacing() int

func (*BoxLayout) String

func (b *BoxLayout) String() string

type Button

type Button struct {
	WidgetImplement
	// contains filtered or unexported fields
}

func NewButton

func NewButton(parent Widget, captions ...string) *Button

func NewToolButton

func NewToolButton(parent Widget, icon Icon) *Button

func NewToolButtonByImage

func NewToolButtonByImage(parent Widget, img int) *Button

func (*Button) BackgroundColor

func (b *Button) BackgroundColor() vg.Color

func (*Button) ButtonGroup

func (b *Button) ButtonGroup() []*Button

ButtonGroup returns the button group

func (*Button) Caption

func (b *Button) Caption() string

func (*Button) Draw

func (b *Button) Draw(self Widget, ctx *vg.Context)

func (*Button) Flags

func (b *Button) Flags() ButtonFlags

func (*Button) FontSize

func (b *Button) FontSize() int

func (*Button) Icon

func (b *Button) Icon() Icon

func (*Button) IconPosition

func (b *Button) IconPosition() ButtonIconPosition

func (*Button) ImageIcon

func (b *Button) ImageIcon() int

func (*Button) MouseButtonEvent

func (b *Button) MouseButtonEvent(self Widget, x, y int, button glfw.MouseButton, down bool, modifier glfw.ModifierKey) bool

func (*Button) PreferredSize

func (b *Button) PreferredSize(self Widget, ctx *vg.Context) (int, int)

func (*Button) Pushed

func (b *Button) Pushed() bool

func (*Button) SetBackgroundColor

func (b *Button) SetBackgroundColor(c vg.Color)

func (*Button) SetButtonGroup

func (b *Button) SetButtonGroup(group []*Button)

SetButtonGroup set the button group (for radio buttons)

func (*Button) SetCallback

func (b *Button) SetCallback(callback func())

SetCallback set the push callback (for any type of button)

func (*Button) SetCaption

func (b *Button) SetCaption(caption string)

func (*Button) SetChangeCallback

func (b *Button) SetChangeCallback(callback func(bool))

SetChangeCallback set the change callback (for toggle buttons)

func (*Button) SetFlags

func (b *Button) SetFlags(f ButtonFlags)

func (*Button) SetFontSize

func (b *Button) SetFontSize(size int)

func (*Button) SetIcon

func (b *Button) SetIcon(i Icon)

func (*Button) SetIconPosition

func (b *Button) SetIconPosition(p ButtonIconPosition)

func (*Button) SetImageIcon

func (b *Button) SetImageIcon(i int)

func (*Button) SetPushed

func (b *Button) SetPushed(p bool)

func (*Button) SetTextColor

func (b *Button) SetTextColor(c vg.Color)

func (*Button) String

func (b *Button) String() string

func (*Button) TextColor

func (b *Button) TextColor() vg.Color

type ButtonFlags

type ButtonFlags int
const (
	NormalButtonType ButtonFlags = 1
	RadioButtonType  ButtonFlags = 2
	ToggleButtonType ButtonFlags = 4
	PopupButtonType  ButtonFlags = 8
)

type ButtonIconPosition

type ButtonIconPosition int
const (
	ButtonIconLeft ButtonIconPosition = iota
	ButtonIconLeftCentered
	ButtonIconRight
	ButtonIconRightCentered
)

type CheckBox

type CheckBox struct {
	WidgetImplement
	// contains filtered or unexported fields
}

func NewCheckBox

func NewCheckBox(parent Widget, caption string) *CheckBox

func (*CheckBox) Caption

func (c *CheckBox) Caption() string

func (*CheckBox) Checked

func (c *CheckBox) Checked() bool

func (*CheckBox) Draw

func (c *CheckBox) Draw(self Widget, ctx *vg.Context)

func (*CheckBox) MouseButtonEvent

func (c *CheckBox) MouseButtonEvent(self Widget, x, y int, button glfw.MouseButton, down bool, modifier glfw.ModifierKey) bool

func (*CheckBox) PreferredSize

func (c *CheckBox) PreferredSize(self Widget, ctx *vg.Context) (int, int)

func (*CheckBox) Pushed

func (c *CheckBox) Pushed() bool

func (*CheckBox) SetCallback

func (c *CheckBox) SetCallback(callback func(bool))

func (*CheckBox) SetCaption

func (c *CheckBox) SetCaption(caption string)

func (*CheckBox) SetChecked

func (c *CheckBox) SetChecked(checked bool)

func (*CheckBox) SetPushed

func (c *CheckBox) SetPushed(pushed bool)

func (*CheckBox) String

func (c *CheckBox) String() string

type CloseEvent

type CloseEvent struct{}

type ColorPicker

type ColorPicker struct {
	PopupButton
	// contains filtered or unexported fields
}

func NewColorPicker

func NewColorPicker(parent Widget, colors ...vg.Color) *ColorPicker

func (*ColorPicker) Color

func (c *ColorPicker) Color() vg.Color

func (*ColorPicker) SetCallback

func (c *ColorPicker) SetCallback(callback func(color vg.Color))

func (*ColorPicker) SetColor

func (c *ColorPicker) SetColor(color vg.Color)

func (*ColorPicker) String

func (c *ColorPicker) String() string

type ColorWheel

type ColorWheel struct {
	WidgetImplement
	// contains filtered or unexported fields
}

func NewColorWheel

func NewColorWheel(parent Widget, colors ...vg.Color) *ColorWheel

func (*ColorWheel) Color

func (c *ColorWheel) Color() vg.Color

func (*ColorWheel) Draw

func (c *ColorWheel) Draw(self Widget, ctx *vg.Context)

func (*ColorWheel) MouseButtonEvent

func (c *ColorWheel) MouseButtonEvent(self Widget, x, y int, button glfw.MouseButton, down bool, modifier glfw.ModifierKey) bool

func (*ColorWheel) MouseDragEvent

func (c *ColorWheel) MouseDragEvent(self Widget, x, y, relX, relY, button int, modifier glfw.ModifierKey) bool

func (*ColorWheel) PreferredSize

func (c *ColorWheel) PreferredSize(self Widget, ctx *vg.Context) (int, int)

func (*ColorWheel) SetCallback

func (c *ColorWheel) SetCallback(callback func(color vg.Color))

func (*ColorWheel) SetColor

func (c *ColorWheel) SetColor(color vg.Color)

func (*ColorWheel) String

func (c *ColorWheel) String() string

type ColorWheelRegion

type ColorWheelRegion int
const (
	RegionNone          ColorWheelRegion = 0
	RegionInnerTriangle ColorWheelRegion = 1
	RegionOuterCircle   ColorWheelRegion = 2
	RegionBoth          ColorWheelRegion = 3
)

type ComboBox

type ComboBox struct {
	PopupButton
	// contains filtered or unexported fields
}

func NewComboBox

func NewComboBox(parent Widget, items ...[]string) *ComboBox

func (*ComboBox) Items

func (c *ComboBox) Items() []string

func (*ComboBox) SelectedIndex

func (c *ComboBox) SelectedIndex() int

func (*ComboBox) SetCallback

func (c *ComboBox) SetCallback(callback func(int))

func (*ComboBox) SetItems

func (c *ComboBox) SetItems(items []string, shortItems ...[]string)

func (*ComboBox) SetSelectedIndex

func (c *ComboBox) SetSelectedIndex(i int)

func (*ComboBox) ShortItems

func (c *ComboBox) ShortItems() []string

func (*ComboBox) String

func (c *ComboBox) String() string

type Cursor

type Cursor int
const (
	Arrow Cursor = iota
	IBeam
	Crosshair
	Hand
	HResize
	VResize
	CursorCount
)

type DropEvent

type DropEvent struct {
	Names []string
}

type EditAction

type EditAction int
const (
	EditActionNone EditAction = iota
	EditActionMoveLeft
	EditActionMoveRight
	EditActionMoveLineTop
	EditActionMoveLineEnd
	EditActionBackspace
	EditActionDelete
	EditActionCutUntilLineEnd
	EditActionYank
	EditActionDeleteLeftWord
	EditActionEnter
	EditActionSelectAll
	EditActionCopy
	EditActionCut
	EditActionPaste
)

func DetectEditAction

func DetectEditAction(key glfw.Key, modifier glfw.ModifierKey) EditAction

type EventQueue

type EventQueue struct {
	// contains filtered or unexported fields
}

EventQueue is an infinitely buffered double-ended queue of Events. The zero value is usable, but a Queue value must not be copied

func (*EventQueue) NextEvent

func (q *EventQueue) NextEvent() interface{}

func (*EventQueue) Send

func (q *EventQueue) Send(event interface{})

func (*EventQueue) SendFirst

func (q *EventQueue) SendFirst(event interface{})

type ExpandBoxLayout

type ExpandBoxLayout struct {
	// contains filtered or unexported fields
}

func NewExpandBoxLayout

func NewExpandBoxLayout(orientation Orientation, alignment Alignment, setting ...int) *ExpandBoxLayout

func (*ExpandBoxLayout) Alignment

func (b *ExpandBoxLayout) Alignment() Alignment

func (*ExpandBoxLayout) Margin

func (b *ExpandBoxLayout) Margin() int

func (*ExpandBoxLayout) OnPerformLayout

func (b *ExpandBoxLayout) OnPerformLayout(widget Widget, ctx *vg.Context)

func (*ExpandBoxLayout) Orientation

func (b *ExpandBoxLayout) Orientation() Orientation

func (*ExpandBoxLayout) PreferredSize

func (b *ExpandBoxLayout) PreferredSize(widget Widget, ctx *vg.Context) (int, int)

func (*ExpandBoxLayout) SetAlignment

func (b *ExpandBoxLayout) SetAlignment(a Alignment)

func (*ExpandBoxLayout) SetMargin

func (b *ExpandBoxLayout) SetMargin(m int)

func (*ExpandBoxLayout) SetOrientation

func (b *ExpandBoxLayout) SetOrientation(o Orientation)

func (*ExpandBoxLayout) SetSpacing

func (b *ExpandBoxLayout) SetSpacing(s int)

func (*ExpandBoxLayout) Spacing

func (b *ExpandBoxLayout) Spacing() int

func (*ExpandBoxLayout) String

func (b *ExpandBoxLayout) String() string

type ExpandListLayout

type ExpandListLayout struct {
	// contains filtered or unexported fields
}

func NewExpandListLayout

func NewExpandListLayout(widths []int, setting ...int) *ExpandListLayout

func (*ExpandListLayout) ColAlignment

func (g *ExpandListLayout) ColAlignment() Alignment

func (*ExpandListLayout) ColSpacing

func (g *ExpandListLayout) ColSpacing() int

func (*ExpandListLayout) ColumnWidths

func (g *ExpandListLayout) ColumnWidths() []int

func (*ExpandListLayout) ExpandPolicy

func (g *ExpandListLayout) ExpandPolicy(axis int) ExpandPolicy

func (*ExpandListLayout) Margin

func (g *ExpandListLayout) Margin() int

func (*ExpandListLayout) OnPerformLayout

func (g *ExpandListLayout) OnPerformLayout(widget Widget, ctx *vg.Context)

func (*ExpandListLayout) PreferredSize

func (g *ExpandListLayout) PreferredSize(widget Widget, ctx *vg.Context) (int, int)

func (*ExpandListLayout) Resolution

func (g *ExpandListLayout) Resolution() int

func (*ExpandListLayout) RowAlignment

func (g *ExpandListLayout) RowAlignment() Alignment

func (*ExpandListLayout) RowSpacing

func (g *ExpandListLayout) RowSpacing() int

func (*ExpandListLayout) SeColumnWidths

func (g *ExpandListLayout) SeColumnWidths(lengths []int)

func (*ExpandListLayout) SetColAlignment

func (g *ExpandListLayout) SetColAlignment(a Alignment)

func (*ExpandListLayout) SetColSpacing

func (g *ExpandListLayout) SetColSpacing(s int)

func (*ExpandListLayout) SetExpandPolicy

func (g *ExpandListLayout) SetExpandPolicy(axis int, policy ExpandPolicy)

func (*ExpandListLayout) SetMargin

func (g *ExpandListLayout) SetMargin(m int)

func (*ExpandListLayout) SetRowAlignment

func (g *ExpandListLayout) SetRowAlignment(a Alignment)

func (*ExpandListLayout) SetRowSpacing

func (g *ExpandListLayout) SetRowSpacing(s int)

func (*ExpandListLayout) SetStretches

func (g *ExpandListLayout) SetStretches(stretches []float32)

func (*ExpandListLayout) Stretches

func (g *ExpandListLayout) Stretches() []float32

func (*ExpandListLayout) String

func (g *ExpandListLayout) String() string

type ExpandPolicy

type ExpandPolicy int
const (
	ExpandAll ExpandPolicy = iota
	ExpandLast
)

type FlexibleWidget

type FlexibleWidget interface {
	Widget
	SetColumnWidth(columnWidth int)
}

type FloatBox

type FloatBox struct {
	TextBox
	// contains filtered or unexported fields
}

func NewFloatBox

func NewFloatBox(parent Widget, values ...float64) *FloatBox

func (*FloatBox) DefaultValue

func (t *FloatBox) DefaultValue() float64

func (*FloatBox) SetCallback

func (f *FloatBox) SetCallback(callback func(float64))

func (*FloatBox) SetDefaultValue

func (t *FloatBox) SetDefaultValue(value float64)

func (*FloatBox) SetValue

func (t *FloatBox) SetValue(value float64)

func (*FloatBox) String

func (f *FloatBox) String() string

func (*FloatBox) Value

func (t *FloatBox) Value() float64

type GLEvent

type GLEvent struct {
	T time.Time
	F func(t time.Time)
}

type GLShader

type GLShader struct {
}

type Graph

type Graph struct {
	WidgetImplement
	// contains filtered or unexported fields
}

func NewGraph

func NewGraph(parent Widget, captions ...string) *Graph

func (*Graph) BackgroundColor

func (g *Graph) BackgroundColor() vg.Color

func (*Graph) Caption

func (g *Graph) Caption() string

func (*Graph) Draw

func (g *Graph) Draw(self Widget, ctx *vg.Context)

func (*Graph) Footer

func (g *Graph) Footer() string

func (*Graph) ForegroundColor

func (g *Graph) ForegroundColor() vg.Color

func (*Graph) Header

func (g *Graph) Header() string

func (*Graph) PreferredSize

func (g *Graph) PreferredSize(self Widget, ctx *vg.Context) (int, int)

func (*Graph) SetBackgroundColor

func (g *Graph) SetBackgroundColor(color vg.Color)

func (*Graph) SetCaption

func (g *Graph) SetCaption(caption string)

func (*Graph) SetFooter

func (g *Graph) SetFooter(footer string)

func (*Graph) SetForegroundColor

func (g *Graph) SetForegroundColor(color vg.Color)

func (*Graph) SetHeader

func (g *Graph) SetHeader(header string)

func (*Graph) SetTextColor

func (g *Graph) SetTextColor(color vg.Color)

func (*Graph) SetValues

func (g *Graph) SetValues(values []float32)

func (*Graph) String

func (g *Graph) String() string

func (*Graph) TextColor

func (g *Graph) TextColor() vg.Color

func (*Graph) Values

func (g *Graph) Values() []float32

type GridLayout

type GridLayout struct {
	// contains filtered or unexported fields
}

func NewGridLayout

func NewGridLayout(orientation Orientation, resolution int, alignment Alignment, setting ...int) *GridLayout

func (*GridLayout) Alignment

func (g *GridLayout) Alignment(axis, item int) Alignment

func (*GridLayout) ColAlignment

func (g *GridLayout) ColAlignment() []Alignment

func (*GridLayout) ColDefaultAlignment

func (g *GridLayout) ColDefaultAlignment() Alignment

func (*GridLayout) ColSpacing

func (g *GridLayout) ColSpacing() int

func (*GridLayout) Margin

func (g *GridLayout) Margin() int

func (*GridLayout) OnPerformLayout

func (g *GridLayout) OnPerformLayout(widget Widget, ctx *vg.Context)

func (*GridLayout) Orientation

func (g *GridLayout) Orientation() Orientation

func (*GridLayout) PreferredSize

func (g *GridLayout) PreferredSize(widget Widget, ctx *vg.Context) (int, int)

func (*GridLayout) Resolution

func (g *GridLayout) Resolution() int

func (*GridLayout) RowAlignment

func (g *GridLayout) RowAlignment() []Alignment

func (*GridLayout) RowDefaultAlignment

func (g *GridLayout) RowDefaultAlignment() Alignment

func (*GridLayout) RowSpacing

func (g *GridLayout) RowSpacing() int

func (*GridLayout) SetColAlignment

func (g *GridLayout) SetColAlignment(a ...Alignment)

func (*GridLayout) SetColDefaultAlignment

func (g *GridLayout) SetColDefaultAlignment(a Alignment)

func (*GridLayout) SetColSpacing

func (g *GridLayout) SetColSpacing(s int)

func (*GridLayout) SetMargin

func (g *GridLayout) SetMargin(m int)

func (*GridLayout) SetOrientation

func (g *GridLayout) SetOrientation(o Orientation)

func (*GridLayout) SetResolution

func (g *GridLayout) SetResolution(r int)

func (*GridLayout) SetRowAlignment

func (g *GridLayout) SetRowAlignment(a ...Alignment)

func (*GridLayout) SetRowDefaultAlignment

func (g *GridLayout) SetRowDefaultAlignment(a Alignment)

func (*GridLayout) SetRowSpacing

func (g *GridLayout) SetRowSpacing(s int)

func (*GridLayout) String

func (g *GridLayout) String() string

type GroupLayout

type GroupLayout struct {
	// contains filtered or unexported fields
}

Special layout for widgets grouped by labels

This widget resembles a box layout in that it arranges a set of widgets vertically. All widgets are indented on the horizontal axis except for Label widgets, which are not indented.

This creates a pleasing layout where a number of widgets are grouped under some high-level heading.

func (*GroupLayout) GroupIndent

func (g *GroupLayout) GroupIndent() int

func (*GroupLayout) GroupSpacing

func (g *GroupLayout) GroupSpacing() int

func (*GroupLayout) Margin

func (g *GroupLayout) Margin() int

func (*GroupLayout) OnPerformLayout

func (g *GroupLayout) OnPerformLayout(widget Widget, ctx *vg.Context)

func (*GroupLayout) PreferredSize

func (g *GroupLayout) PreferredSize(widget Widget, ctx *vg.Context) (int, int)

func (*GroupLayout) SetGroupIndent

func (g *GroupLayout) SetGroupIndent(m int)

func (*GroupLayout) SetGroupSpacing

func (g *GroupLayout) SetGroupSpacing(s int)

func (*GroupLayout) SetMargin

func (g *GroupLayout) SetMargin(m int)

func (*GroupLayout) SetSpacing

func (g *GroupLayout) SetSpacing(s int)

func (*GroupLayout) Spacing

func (g *GroupLayout) Spacing() int

func (*GroupLayout) String

func (g *GroupLayout) String() string

type IPanel

type IPanel interface {
	Widget
	RefreshRelativePlacement()
	SetDepth(d int)
}

type Icon

type Icon rune
const (
	IconNote               Icon = 0x266a
	IconNoteBeamed         Icon = 0x266b
	IconMusic              Icon = 0x1f3b5
	IconSearch             Icon = 0x1f50d
	IconFlashlight         Icon = 0x1f526
	IconMail               Icon = 0x2709
	IconHeart              Icon = 0x2665
	IconHeartEmpty         Icon = 0x2661
	IconStar               Icon = 0x2605
	IconStarEmpty          Icon = 0x2606
	IconUser               Icon = 0x1f464
	IconUsers              Icon = 0x1f465
	IconUserAdd            Icon = 0xe700
	IconVideo              Icon = 0x1f3ac
	IconPicture            Icon = 0x1f304
	IconCamera             Icon = 0x1f4f7
	IconLayout             Icon = 0x268f
	IconMenu               Icon = 0x2630
	IconCheck              Icon = 0x2713
	IconCancel             Icon = 0x2715
	IconCancelCircled      Icon = 0x2716
	IconCancelSquared      Icon = 0x274e
	IconPlus               Icon = 0x2b
	IconPlusCircled        Icon = 0x2795
	IconPlusSquared        Icon = 0x229e
	IconMinus              Icon = 0x2d
	IconMinusCircled       Icon = 0x2796
	IconMinusSquared       Icon = 0x229f
	IconHelp               Icon = 0x2753
	IconHelpCircled        Icon = 0xe704
	IconInfo               Icon = 0x2139
	IconInfoCircled        Icon = 0xe705
	IconBack               Icon = 0x1f519
	IconHome               Icon = 0x2302
	IconLink               Icon = 0x1f517
	IconAttach             Icon = 0x1f4ce
	IconLock               Icon = 0x1f512
	IconLockOpen           Icon = 0x1f513
	IconTag                Icon = 0xe70c
	IconBookmark           Icon = 0x1f516
	IconBookmarks          Icon = 0x1f4d1
	IconFlag               Icon = 0x2691
	IconThumbsUp           Icon = 0x1f44d
	IconThumbsDown         Icon = 0x1f44e
	IconDownload           Icon = 0x1f4e5
	IconUpload             Icon = 0x1f4e4
	IconUploadCloud        Icon = 0xe711
	IconReply              Icon = 0xe712
	IconReplyAll           Icon = 0xe713
	IconForward            Icon = 0x27a6
	IconQuote              Icon = 0x275e
	IconCode               Icon = 0xe714
	IconExport             Icon = 0xe715
	IconFeather            Icon = 0x2712
	IconPrint              Icon = 0xe716
	IconRetweet            Icon = 0xe717
	IconKeyboard           Icon = 0x2328
	IconComment            Icon = 0xe718
	IconChat               Icon = 0xe720
	IconBell               Icon = 0x1f514
	IconAttention          Icon = 0x26a0
	IconAlert              Icon = 0x1f4a5
	IconVcard              Icon = 0xe722
	IconAddress            Icon = 0xe723
	IconLocation           Icon = 0xe724
	IconMap                Icon = 0xe727
	IconDirection          Icon = 0x27a2
	IconCompass            Icon = 0xe728
	IconCup                Icon = 0x2615
	IconTrash              Icon = 0xe729
	IconDoc                Icon = 0xe730
	IconDocs               Icon = 0xe736
	IconDocLandscape       Icon = 0xe737
	IconDocText            Icon = 0x1f4c4
	IconDocTextInv         Icon = 0xe731
	IconNewspaper          Icon = 0x1f4f0
	IconBookOpen           Icon = 0x1f4d6
	IconBook               Icon = 0x1f4d5
	IconFolder             Icon = 0x1f4c1
	IconArchive            Icon = 0xe738
	IconBox                Icon = 0x1f4e6
	IconRss                Icon = 0xe73a
	IconPhone              Icon = 0x1f4de
	IconCog                Icon = 0x2699
	IconTools              Icon = 0x2692
	IconShare              Icon = 0xe73c
	IconShareable          Icon = 0xe73e
	IconBasket             Icon = 0xe73d
	IconBag                Icon = 0x1f45c
	IconCalendar           Icon = 0x1f4c5
	IconLogin              Icon = 0xe740
	IconLogout             Icon = 0xe741
	IconMic                Icon = 0x1f3a4
	IconMute               Icon = 0x1f507
	IconSound              Icon = 0x1f50a
	IconVolume             Icon = 0xe742
	IconClock              Icon = 0x1f554
	IconHourglass          Icon = 0x23f3
	IconLamp               Icon = 0x1f4a1
	IconLightDown          Icon = 0x1f505
	IconLightUp            Icon = 0x1f506
	IconAdjust             Icon = 0x25d1
	IconBlock              Icon = 0x1f6ab
	IconResizeFull         Icon = 0xe744
	IconResizeSmall        Icon = 0xe746
	IconPopup              Icon = 0xe74c
	IconPublish            Icon = 0xe74d
	IconPanel              Icon = 0xe74e
	IconArrowCombo         Icon = 0xe74f
	IconDownCircled        Icon = 0xe758
	IconLeftCircled        Icon = 0xe759
	IconRightCircled       Icon = 0xe75a
	IconUpCircled          Icon = 0xe75b
	IconDownOpen           Icon = 0xe75c
	IconLeftOpen           Icon = 0xe75d
	IconRightOpen          Icon = 0xe75e
	IconUpOpen             Icon = 0xe75f
	IconDownOpenMini       Icon = 0xe760
	IconLeftOpenMini       Icon = 0xe761
	IconRightOpenMini      Icon = 0xe762
	IconUpOpenMini         Icon = 0xe763
	IconDownOpenBig        Icon = 0xe764
	IconLeftOpenBig        Icon = 0xe765
	IconRightOpenBig       Icon = 0xe766
	IconUpOpenBig          Icon = 0xe767
	IconDown               Icon = 0x2b07
	IconLeft               Icon = 0x2b05
	IconRight              Icon = 0x27a1
	IconUp                 Icon = 0x2b06
	IconDownDir            Icon = 0x25be
	IconLeftDir            Icon = 0x25c2
	IconRightDir           Icon = 0x25b8
	IconUpDir              Icon = 0x25b4
	IconDownBold           Icon = 0xe4b0
	IconLeftBold           Icon = 0xe4ad
	IconRightBold          Icon = 0xe4ae
	IconUpBold             Icon = 0xe4af
	IconDownThin           Icon = 0x2193
	IconLeftThin           Icon = 0x2190
	IconRightThin          Icon = 0x2192
	IconUpThin             Icon = 0x2191
	IconCcw                Icon = 0x27f2
	IconCw                 Icon = 0x27f3
	IconArrowsCcw          Icon = 0x1f504
	IconLevelDown          Icon = 0x21b3
	IconLevelUp            Icon = 0x21b0
	IconShuffle            Icon = 0x1f500
	IconLoop               Icon = 0x1f501
	IconSwitch             Icon = 0x21c6
	IconPlay               Icon = 0x25b6
	IconStop               Icon = 0x25a0
	IconPause              Icon = 0x2389
	IconRecord             Icon = 0x26ab
	IconToEnd              Icon = 0x23ed
	IconToStart            Icon = 0x23ee
	IconFastForward        Icon = 0x23e9
	IconFastBackward       Icon = 0x23ea
	IconProgress0          Icon = 0xe768
	IconProgress1          Icon = 0xe769
	IconProgress2          Icon = 0xe76a
	IconProgress3          Icon = 0xe76b
	IconTarget             Icon = 0x1f3af
	IconPalette            Icon = 0x1f3a8
	IconList               Icon = 0xe005
	IconListAdd            Icon = 0xe003
	IconSignal             Icon = 0x1f4f6
	IconTrophy             Icon = 0x1f3c6
	IconBattery            Icon = 0x1f50b
	IconBackInTime         Icon = 0xe771
	IconMonitor            Icon = 0x1f4bb
	IconMobile             Icon = 0x1f4f1
	IconNetwork            Icon = 0xe776
	IconInbox              Icon = 0xe777
	IconInstall            Icon = 0xe778
	IconGlobe              Icon = 0x1f30e
	IconCloud              Icon = 0x2601
	IconCloudThunder       Icon = 0x26c8
	IconFlash              Icon = 0x26a1
	IconMoon               Icon = 0x263d
	IconFlight             Icon = 0x2708
	IconPaperPlane         Icon = 0xe79b
	IconLeaf               Icon = 0x1f342
	IconLifebuoy           Icon = 0xe788
	IconMouse              Icon = 0xe789
	IconBriefcase          Icon = 0x1f4bc
	IconSuitcase           Icon = 0xe78e
	IconDot                Icon = 0xe78b
	IconDot2               Icon = 0xe78c
	IconDot3               Icon = 0xe78d
	IconBrush              Icon = 0xe79a
	IconMagnet             Icon = 0xe7a1
	IconInfinity           Icon = 0x221e
	IconErase              Icon = 0x232b
	IconChartPie           Icon = 0xe751
	IconChartLine          Icon = 0x1f4c8
	IconChartBar           Icon = 0x1f4ca
	IconChartArea          Icon = 0x1f53e
	IconTape               Icon = 0x2707
	IconGraduationCap      Icon = 0x1f393
	IconLanguage           Icon = 0xe752
	IconTicket             Icon = 0x1f3ab
	IconWater              Icon = 0x1f4a6
	IconDroplet            Icon = 0x1f4a7
	IconAir                Icon = 0xe753
	IconCreditCard         Icon = 0x1f4b3
	IconFloppy             Icon = 0x1f4be
	IconClipboard          Icon = 0x1f4cb
	IconMegaphone          Icon = 0x1f4e3
	IconDatabase           Icon = 0xe754
	IconDrive              Icon = 0xe755
	IconBucket             Icon = 0xe756
	IconThermometer        Icon = 0xe757
	IconKey                Icon = 0x1f511
	IconFlowCascade        Icon = 0xe790
	IconFlowBranch         Icon = 0xe791
	IconFlowTree           Icon = 0xe792
	IconFlowLine           Icon = 0xe793
	IconFlowParallel       Icon = 0xe794
	IconRocket             Icon = 0x1f680
	IconGauge              Icon = 0xe7a2
	IconTrafficCone        Icon = 0xe7a3
	IconCc                 Icon = 0xe7a5
	IconCcBy               Icon = 0xe7a6
	IconCcNc               Icon = 0xe7a7
	IconCcNcEu             Icon = 0xe7a8
	IconCcNcJp             Icon = 0xe7a9
	IconCcSa               Icon = 0xe7aa
	IconCcNd               Icon = 0xe7ab
	IconCcPd               Icon = 0xe7ac
	IconCcZero             Icon = 0xe7ad
	IconCcShare            Icon = 0xe7ae
	IconCcRemix            Icon = 0xe7af
	IconGithub             Icon = 0xf300
	IconGithubCircled      Icon = 0xf301
	IconFlickr             Icon = 0xf303
	IconFlickrCircled      Icon = 0xf304
	IconVimeo              Icon = 0xf306
	IconVimeoCircled       Icon = 0xf307
	IconTwitter            Icon = 0xf309
	IconTwitterCircled     Icon = 0xf30a
	IconFacebook           Icon = 0xf30c
	IconFacebookCircled    Icon = 0xf30d
	IconFacebookSquared    Icon = 0xf30e
	IconGplus              Icon = 0xf30f
	IconGplusCircled       Icon = 0xf310
	IconPinterest          Icon = 0xf312
	IconPinterestCircled   Icon = 0xf313
	IconTumblr             Icon = 0xf315
	IconTumblrCircled      Icon = 0xf316
	IconLinkedin           Icon = 0xf318
	IconLinkedinCircled    Icon = 0xf319
	IconDribbble           Icon = 0xf31b
	IconDribbbleCircled    Icon = 0xf31c
	IconStumbleupon        Icon = 0xf31e
	IconStumbleuponCircled Icon = 0xf31f
	IconLastfm             Icon = 0xf321
	IconLastfmCircled      Icon = 0xf322
	IconRdio               Icon = 0xf324
	IconRdioCircled        Icon = 0xf325
	IconSpotify            Icon = 0xf327
	IconSpotifyCircled     Icon = 0xf328
	IconQq                 Icon = 0xf32a
	IconInstagrem          Icon = 0xf32d
	IconDropbox            Icon = 0xf330
	IconEvernote           Icon = 0xf333
	IconFlattr             Icon = 0xf336
	IconSkype              Icon = 0xf339
	IconSkypeCircled       Icon = 0xf33a
	IconRenren             Icon = 0xf33c
	IconSinaWeibo          Icon = 0xf33f
	IconPaypal             Icon = 0xf342
	IconPicasa             Icon = 0xf345
	IconSoundcloud         Icon = 0xf348
	IconMixi               Icon = 0xf34b
	IconBehance            Icon = 0xf34e
	IconGoogleCircles      Icon = 0xf351
	IconVkontakte          Icon = 0xf354
	IconSmashing           Icon = 0xf357
	IconSweden             Icon = 0xf601
	IconDbShape            Icon = 0xf600
	IconLogoDb             Icon = 0xf603
)

type Image

type Image struct {
	ImageID int
	Name    string
}

type ImagePanel

type ImagePanel struct {
	WidgetImplement
	// contains filtered or unexported fields
}

func NewImagePanel

func NewImagePanel(parent Widget) *ImagePanel

func (*ImagePanel) Draw

func (i *ImagePanel) Draw(self Widget, ctx *vg.Context)

func (*ImagePanel) Images

func (i *ImagePanel) Images() []Image

func (*ImagePanel) MouseButtonEvent

func (i *ImagePanel) MouseButtonEvent(self Widget, x, y int, button glfw.MouseButton, down bool, modifier glfw.ModifierKey) bool

func (*ImagePanel) MouseMotionEvent

func (i *ImagePanel) MouseMotionEvent(self Widget, x, y, relX, relY, button int, modifier glfw.ModifierKey) bool

func (*ImagePanel) PreferredSize

func (i *ImagePanel) PreferredSize(self Widget, ctx *vg.Context) (int, int)

func (*ImagePanel) SetCallback

func (i *ImagePanel) SetCallback(callback func(int))

func (*ImagePanel) SetImages

func (i *ImagePanel) SetImages(images []Image)

func (*ImagePanel) String

func (i *ImagePanel) String() string

type ImageSizePolicy

type ImageSizePolicy int
const (
	ImageSizePolicyFixed ImageSizePolicy = iota
	ImageSizePolicyExpand
)

type ImageView

type ImageView struct {
	WidgetImplement
	// contains filtered or unexported fields
}

func NewImageView

func NewImageView(parent Widget, images ...int) *ImageView

func (*ImageView) Draw

func (i *ImageView) Draw(self Widget, ctx *vg.Context)

func (*ImageView) Image

func (i *ImageView) Image() int

func (*ImageView) Policy

func (i *ImageView) Policy() ImageSizePolicy

func (*ImageView) PreferredSize

func (i *ImageView) PreferredSize(self Widget, ctx *vg.Context) (int, int)

func (*ImageView) SetImage

func (i *ImageView) SetImage(image int)

func (*ImageView) SetPolicy

func (i *ImageView) SetPolicy(policy ImageSizePolicy)

func (*ImageView) String

func (i *ImageView) String() string

type IntBox

type IntBox struct {
	TextBox
	// contains filtered or unexported fields
}

func NewIntBox

func NewIntBox(parent Widget, signed bool, values ...int) *IntBox

func (*IntBox) DefaultValue

func (i *IntBox) DefaultValue() int

func (*IntBox) SetCallback

func (i *IntBox) SetCallback(callback func(int))

func (*IntBox) SetDefaultValue

func (i *IntBox) SetDefaultValue(value int)

func (*IntBox) SetValue

func (t *IntBox) SetValue(value int)

func (*IntBox) String

func (i *IntBox) String() string

func (*IntBox) Value

func (t *IntBox) Value() int

type KeyEvent

type KeyEvent struct {
	Key      glfw.Key
	ScanCode int
	Action   glfw.Action
	Modifier glfw.ModifierKey
}

type Label

type Label struct {
	WidgetImplement
	// contains filtered or unexported fields
}

Text label widget The font and color can be customized. When SetFixedWidth() is used, the text is wrapped when it surpasses the specified width

func NewLabel

func NewLabel(parent Widget, caption string) *Label

func (*Label) Caption

func (l *Label) Caption() string

Caption() gets the label's text caption

func (*Label) Color

func (l *Label) Color() vg.Color

Color() gets the label color

func (*Label) ColumnWidth

func (l *Label) ColumnWidth() int

func (*Label) Draw

func (l *Label) Draw(self Widget, ctx *vg.Context)

func (*Label) Font

func (l *Label) Font() string

Font() gets the currently active font

func (*Label) PreferredSize

func (l *Label) PreferredSize(self Widget, ctx *vg.Context) (int, int)

func (*Label) SetCaption

func (l *Label) SetCaption(caption string)

SetCaption() sets the label's text caption

func (*Label) SetColor

func (l *Label) SetColor(color vg.Color)

SetColor() sets the label color

func (*Label) SetColumnWidth

func (l *Label) SetColumnWidth(width int)

func (*Label) SetFont

func (l *Label) SetFont(fontFace string)

SetFont() sets the currently active font (2 are available by default: 'sans' and 'sans-bold')

func (*Label) SetWrap

func (l *Label) SetWrap(wrap bool)

func (*Label) String

func (l *Label) String() string

func (*Label) Wrap

func (l *Label) Wrap() bool

type Layout

type Layout interface {
	OnPerformLayout(widget Widget, ctx *vg.Context)
	PreferredSize(widget Widget, ctx *vg.Context) (int, int)
	String() string
}

func NewGroupLayout

func NewGroupLayout(setting ...int) Layout

type MouseButtonEvent

type MouseButtonEvent struct {
	Button   glfw.MouseButton
	Action   glfw.Action
	Modifier glfw.ModifierKey
}

type MouseMoveEvent

type MouseMoveEvent struct {
	X, Y float64
}

type Orientation

type Orientation int
const (
	Horizontal Orientation = iota
	Vertical
)

func (Orientation) String

func (o Orientation) String() string

type PaintEvent

type PaintEvent struct{}

type Panel

type Panel struct {
	WidgetImplement
	// contains filtered or unexported fields
}

func NewPanel

func NewPanel(parent Widget, title string) *Panel

func (*Panel) ButtonPanel

func (w *Panel) ButtonPanel() Widget

func (*Panel) Center

func (w *Panel) Center()

Center() makes the panel center in the current Window

func (*Panel) Depth

func (w *Panel) Depth() int

func (*Panel) Dispose

func (w *Panel) Dispose()

Dispose() disposes the panel

func (*Panel) Draggable

func (w *Panel) Draggable() bool

func (*Panel) Draw

func (w *Panel) Draw(self Widget, ctx *vg.Context)

func (*Panel) FindPanel

func (w *Panel) FindPanel() IPanel

func (*Panel) Modal

func (w *Panel) Modal() bool

Modal() returns is this a model dialog?

func (*Panel) MouseButtonEvent

func (w *Panel) MouseButtonEvent(self Widget, x, y int, button glfw.MouseButton, down bool, modifier glfw.ModifierKey) bool

func (*Panel) MouseDragEvent

func (w *Panel) MouseDragEvent(self Widget, x, y, relX, relY, button int, modifier glfw.ModifierKey) bool

func (*Panel) OnPerformLayout

func (w *Panel) OnPerformLayout(self Widget, ctx *vg.Context)

func (*Panel) PreferredSize

func (w *Panel) PreferredSize(self Widget, ctx *vg.Context) (int, int)

func (*Panel) RefreshRelativePlacement

func (w *Panel) RefreshRelativePlacement()

RefreshRelativePlacement is internal helper function to maintain nested panel position values; overridden in \ref Popup

func (*Panel) ScrollEvent

func (w *Panel) ScrollEvent(self Widget, x, y, relX, relY int) bool

func (*Panel) SetDepth

func (w *Panel) SetDepth(d int)

func (*Panel) SetDraggable

func (w *Panel) SetDraggable(flag bool)

func (*Panel) SetModal

func (w *Panel) SetModal(m bool)

SetModal() set whether or not this is a modal dialog

func (*Panel) SetTitle

func (w *Panel) SetTitle(title string)

SetTitle() sets the panel title

func (*Panel) String

func (w *Panel) String() string

func (*Panel) Title

func (w *Panel) Title() string

Title() returns the panel title

type Popup struct {
	Panel
	// contains filtered or unexported fields
}

func NewPopup

func NewPopup(parent Widget, parentPanel IPanel) *Popup

func (*Popup) AnchorHeight

func (p *Popup) AnchorHeight() int

AnchorHeight() returns the anchor height; this determines the vertical shift relative to the anchor position

func (*Popup) AnchorPosition

func (p *Popup) AnchorPosition() (int, int)

AnchorPosition() returns the anchor position in the parent panel; the placement of the popup is relative to it

func (*Popup) Draw

func (p *Popup) Draw(self Widget, ctx *vg.Context)

func (*Popup) FindPanel

func (p *Popup) FindPanel() IPanel

func (*Popup) IsPositionAbsolute

func (p *Popup) IsPositionAbsolute() bool

func (*Popup) OnPerformLayout

func (p *Popup) OnPerformLayout(self Widget, ctx *vg.Context)

func (*Popup) ParentPanel

func (p *Popup) ParentPanel() IPanel

ParentPanel() returns the parent panel of the popup

func (*Popup) RefreshRelativePlacement

func (p *Popup) RefreshRelativePlacement()

RefreshRelativePlacement is internal helper function to maintain nested panel position values; overridden in \ref Popup

func (*Popup) SetAnchorHeight

func (p *Popup) SetAnchorHeight(h int)

SetAnchorHeight() sets the anchor height; this determines the vertical shift relative to the anchor position

func (*Popup) SetAnchorPosition

func (p *Popup) SetAnchorPosition(x, y int)

SetAnchorPosition() sets the anchor position in the parent panel; the placement of the popup is relative to it

func (*Popup) SetParentPanel

func (p *Popup) SetParentPanel(w *Panel)

SetParentPanel() sets the parent panel of the popup

func (*Popup) String

func (p *Popup) String() string

type PopupButton

type PopupButton struct {
	Button
	// contains filtered or unexported fields
}

func NewPopupButton

func NewPopupButton(parent Widget, captions ...string) *PopupButton

func (*PopupButton) ChevronIcon

func (p *PopupButton) ChevronIcon() Icon

func (*PopupButton) Draw

func (p *PopupButton) Draw(self Widget, ctx *vg.Context)

func (*PopupButton) OnPerformLayout

func (p *PopupButton) OnPerformLayout(self Widget, ctx *vg.Context)

func (*PopupButton) Popup

func (p *PopupButton) Popup() Widget

func (*PopupButton) PreferredSize

func (p *PopupButton) PreferredSize(self Widget, ctx *vg.Context) (int, int)

func (*PopupButton) SetChevronIcon

func (p *PopupButton) SetChevronIcon(icon Icon)

func (*PopupButton) String

func (p *PopupButton) String() string

type ProgressBar

type ProgressBar struct {
	WidgetImplement
	// contains filtered or unexported fields
}

func NewProgressBar

func NewProgressBar(parent Widget) *ProgressBar

func (*ProgressBar) Draw

func (p *ProgressBar) Draw(self Widget, ctx *vg.Context)

func (*ProgressBar) PreferredSize

func (p *ProgressBar) PreferredSize(self Widget, ctx *vg.Context) (int, int)

func (*ProgressBar) SetValue

func (p *ProgressBar) SetValue(value float32)

func (*ProgressBar) String

func (p *ProgressBar) String() string

func (*ProgressBar) Value

func (p *ProgressBar) Value() float32

type ResizeEvent

type ResizeEvent struct {
	Width, Height int
}

type RuneEvent

type RuneEvent struct {
	R rune
}

type ScrollEvent

type ScrollEvent struct {
	Dx, Dy float64
}

type Slider

type Slider struct {
	WidgetImplement
	// contains filtered or unexported fields
}

func NewSlider

func NewSlider(parent Widget) *Slider

func (*Slider) Draw

func (s *Slider) Draw(self Widget, ctx *vg.Context)

func (*Slider) HighlightColor

func (s *Slider) HighlightColor() vg.Color

func (*Slider) HighlightedRange

func (s *Slider) HighlightedRange() (float32, float32)

func (*Slider) MouseButtonEvent

func (s *Slider) MouseButtonEvent(self Widget, x, y int, button glfw.MouseButton, down bool, modifier glfw.ModifierKey) bool

func (*Slider) MouseDragEvent

func (s *Slider) MouseDragEvent(self Widget, x, y, relX, relY, button int, modifier glfw.ModifierKey) bool

func (*Slider) PreferredSize

func (s *Slider) PreferredSize(self Widget, ctx *vg.Context) (int, int)

func (*Slider) SetCallback

func (s *Slider) SetCallback(callback func(float32))

func (*Slider) SetFinalCallback

func (s *Slider) SetFinalCallback(callback func(float32))

func (*Slider) SetHighlightColor

func (s *Slider) SetHighlightColor(c vg.Color)

func (*Slider) SetHighlightedRange

func (s *Slider) SetHighlightedRange(l, h float32)

func (*Slider) SetValue

func (s *Slider) SetValue(v float32)

func (*Slider) String

func (s *Slider) String() string

func (*Slider) Value

func (s *Slider) Value() float32

type Spinner

type Spinner struct {
	WidgetImplement
	// contains filtered or unexported fields
}

func NewSpinner

func NewSpinner(parent Widget) *Spinner

func (*Spinner) Active

func (s *Spinner) Active() bool

func (*Spinner) Draw

func (s *Spinner) Draw(self Widget, ctx *vg.Context)

func (*Spinner) IsPositionAbsolute

func (s *Spinner) IsPositionAbsolute() bool

func (*Spinner) LineCount

func (s *Spinner) LineCount() int

func (*Spinner) LineWidth

func (s *Spinner) LineWidth() float32

func (*Spinner) OnPerformLayout

func (s *Spinner) OnPerformLayout(self Widget, ctx *vg.Context)

func (*Spinner) PreferredSize

func (s *Spinner) PreferredSize(self Widget, ctx *vg.Context) (int, int)

func (*Spinner) Radius

func (s *Spinner) Radius() (int, int)

func (*Spinner) SetActive

func (s *Spinner) SetActive(flag bool)

func (*Spinner) SetLineCount

func (s *Spinner) SetLineCount(num int)

func (*Spinner) SetLineWidth

func (s *Spinner) SetLineWidth(lineWidth float32)

func (*Spinner) SetRadius

func (s *Spinner) SetRadius(c1, c2 int)

func (*Spinner) SetSpeed

func (s *Spinner) SetSpeed(speed float32)

func (*Spinner) Speed

func (s *Spinner) Speed() float32

func (*Spinner) String

func (s *Spinner) String() string

type SpinnerFilter

type SpinnerFilter struct {
	WidgetImplement
	// contains filtered or unexported fields
}

func (*SpinnerFilter) Draw

func (sf *SpinnerFilter) Draw(self Widget, ctx *vg.Context)

func (*SpinnerFilter) FocusEvent

func (sf *SpinnerFilter) FocusEvent(self Widget, f bool) bool

func (*SpinnerFilter) IMEPreeditEvent

func (sf *SpinnerFilter) IMEPreeditEvent(self Widget, text []rune, blocks []int, focusedBlock int) bool

func (*SpinnerFilter) IMEStatusEvent

func (sf *SpinnerFilter) IMEStatusEvent(self Widget) bool

func (*SpinnerFilter) IsPositionAbsolute

func (sf *SpinnerFilter) IsPositionAbsolute() bool

func (*SpinnerFilter) KeyboardCharacterEvent

func (sf *SpinnerFilter) KeyboardCharacterEvent(self Widget, codePoint rune) bool

func (*SpinnerFilter) KeyboardEvent

func (sf *SpinnerFilter) KeyboardEvent(self Widget, key glfw.Key, scanCode int, action glfw.Action, modifier glfw.ModifierKey) bool

func (*SpinnerFilter) MouseButtonEvent

func (sf *SpinnerFilter) MouseButtonEvent(self Widget, x, y int, button glfw.MouseButton, down bool, modifier glfw.ModifierKey) bool

func (*SpinnerFilter) MouseDragEvent

func (sf *SpinnerFilter) MouseDragEvent(self Widget, x, y, relX, relY, button int, modifier glfw.ModifierKey) bool

func (*SpinnerFilter) MouseEnterEvent

func (sf *SpinnerFilter) MouseEnterEvent(self Widget, x, y int, enter bool) bool

func (*SpinnerFilter) MouseMotionEvent

func (sf *SpinnerFilter) MouseMotionEvent(self Widget, x, y, relX, relY, button int, modifier glfw.ModifierKey) bool

func (*SpinnerFilter) PreferredSize

func (sf *SpinnerFilter) PreferredSize(self Widget, ctx *vg.Context) (int, int)

func (*SpinnerFilter) ScrollEvent

func (sf *SpinnerFilter) ScrollEvent(self Widget, x, y, relX, relY int) bool

func (*SpinnerFilter) String

func (sf *SpinnerFilter) String() string

type SpinnerState

type SpinnerState int
const (
	SpinnerStop SpinnerState = iota
	SpinnerFadeIn
	SpinnerFadeOut
)

type TextAlignment

type TextAlignment int
const (
	TextCenter TextAlignment = iota
	TextLeft
	TextRight
)

type TextBox

type TextBox struct {
	WidgetImplement
	// contains filtered or unexported fields
}

func NewTextBox

func NewTextBox(parent Widget, values ...string) *TextBox

func (*TextBox) Alignment

func (t *TextBox) Alignment() TextAlignment

func (*TextBox) CopySelection

func (t *TextBox) CopySelection() bool

func (*TextBox) DefaultValue

func (t *TextBox) DefaultValue() string

func (*TextBox) DeleteSelection

func (t *TextBox) DeleteSelection() bool

func (*TextBox) Draw

func (t *TextBox) Draw(self Widget, ctx *vg.Context)

func (*TextBox) Editable

func (t *TextBox) Editable() bool

func (*TextBox) FocusEvent

func (t *TextBox) FocusEvent(self Widget, focused bool) bool

func (*TextBox) Font

func (t *TextBox) Font() string

func (*TextBox) Format

func (t *TextBox) Format() string

func (*TextBox) IMEPreeditEvent

func (t *TextBox) IMEPreeditEvent(self Widget, text []rune, blocks []int, focusedBlock int) bool

func (*TextBox) IMEStatusEvent

func (t *TextBox) IMEStatusEvent(self Widget) bool

func (*TextBox) KeyboardCharacterEvent

func (t *TextBox) KeyboardCharacterEvent(self Widget, codePoint rune) bool

func (*TextBox) KeyboardEvent

func (t *TextBox) KeyboardEvent(self Widget, key glfw.Key, scanCode int, action glfw.Action, modifier glfw.ModifierKey) bool

func (*TextBox) MouseButtonEvent

func (t *TextBox) MouseButtonEvent(self Widget, x, y int, button glfw.MouseButton, down bool, modifier glfw.ModifierKey) bool

func (*TextBox) MouseDragEvent

func (t *TextBox) MouseDragEvent(self Widget, x, y, relX, relY, button int, modifier glfw.ModifierKey) bool

func (*TextBox) MouseEnterEvent

func (t *TextBox) MouseEnterEvent(self Widget, x, y int, enter bool) bool

func (*TextBox) MouseMotionEvent

func (t *TextBox) MouseMotionEvent(self Widget, x, y, relX, relY, button int, modifier glfw.ModifierKey) bool

func (*TextBox) PasteFromClipboard

func (t *TextBox) PasteFromClipboard()

func (*TextBox) PreferredSize

func (t *TextBox) PreferredSize(self Widget, ctx *vg.Context) (int, int)

func (*TextBox) SetAlignment

func (t *TextBox) SetAlignment(a TextAlignment)

func (*TextBox) SetCallback

func (t *TextBox) SetCallback(callback func(string) bool)

func (*TextBox) SetDefaultValue

func (t *TextBox) SetDefaultValue(value string)

func (*TextBox) SetEditable

func (t *TextBox) SetEditable(e bool)

func (*TextBox) SetFont

func (t *TextBox) SetFont(fontFace string)

func (*TextBox) SetFormat

func (t *TextBox) SetFormat(format string) error

func (*TextBox) SetUnitImage

func (t *TextBox) SetUnitImage(img int)

func (*TextBox) SetUnits

func (t *TextBox) SetUnits(units string)

func (*TextBox) SetValue

func (t *TextBox) SetValue(value string)

func (*TextBox) String

func (t *TextBox) String() string

func (*TextBox) UnitImage

func (t *TextBox) UnitImage() int

func (*TextBox) Units

func (t *TextBox) Units() string

func (*TextBox) Value

func (t *TextBox) Value() string

type Theme

type Theme struct {
	StandardFontSize    int
	ButtonFontSize      int
	TextBoxFontSize     int
	PanelCornerRadius   int
	PanelHeaderHeight   int
	PanelDropShadowSize int
	ButtonCornerRadius  int

	DropShadow        vg.Color
	Transparent       vg.Color
	BorderDark        vg.Color
	BorderLight       vg.Color
	BorderMedium      vg.Color
	TextColor         vg.Color
	DisabledTextColor vg.Color
	TextColorShadow   vg.Color
	IconColor         vg.Color

	ButtonGradientTopFocused   vg.Color
	ButtonGradientBotFocused   vg.Color
	ButtonGradientTopUnfocused vg.Color
	ButtonGradientBotUnfocused vg.Color
	ButtonGradientTopPushed    vg.Color
	ButtonGradientBotPushed    vg.Color

	/* Panel-related */
	PanelFillUnfocused  vg.Color
	PanelFillFocused    vg.Color
	PanelTitleUnfocused vg.Color
	PanelTitleFocused   vg.Color

	PanelHeaderGradientTop vg.Color
	PanelHeaderGradientBot vg.Color
	PanelHeaderSepTop      vg.Color
	PanelHeaderSepBot      vg.Color

	PanelPopup            vg.Color
	PanelPopupTransparent vg.Color

	FontNormal string
	FontBold   string
	FontIcons  string
}

func NewStandardTheme

func NewStandardTheme() *Theme

type VScrollPanel

type VScrollPanel struct {
	WidgetImplement
	// contains filtered or unexported fields
}

func NewVScrollPanel

func NewVScrollPanel(parent Widget) *VScrollPanel

func (*VScrollPanel) Draw

func (v *VScrollPanel) Draw(self Widget, ctx *vg.Context)

func (*VScrollPanel) IsClipped

func (v *VScrollPanel) IsClipped(x, y, w, h int) bool

func (*VScrollPanel) MouseButtonEvent

func (v *VScrollPanel) MouseButtonEvent(self Widget, x, y int, button glfw.MouseButton, down bool, modifier glfw.ModifierKey) bool

func (*VScrollPanel) MouseDragEvent

func (v *VScrollPanel) MouseDragEvent(self Widget, x, y, relX, relY, button int, modifier glfw.ModifierKey) bool

func (*VScrollPanel) MouseMotionEvent

func (v *VScrollPanel) MouseMotionEvent(self Widget, x, y, relX, relY, button int, modifier glfw.ModifierKey) bool

func (*VScrollPanel) OnPerformLayout

func (v *VScrollPanel) OnPerformLayout(self Widget, ctx *vg.Context)

func (*VScrollPanel) PreferredSize

func (v *VScrollPanel) PreferredSize(self Widget, ctx *vg.Context) (int, int)

func (*VScrollPanel) Scroll

func (v *VScrollPanel) Scroll() float32

func (*VScrollPanel) ScrollEvent

func (v *VScrollPanel) ScrollEvent(self Widget, x, y, relX, relY int) bool

func (*VScrollPanel) SetScroll

func (v *VScrollPanel) SetScroll(scroll float32)

func (*VScrollPanel) String

func (v *VScrollPanel) String() string

type VScrollPanelChild

type VScrollPanelChild struct {
	WidgetImplement
}

func NewVScrollPanelChild

func NewVScrollPanelChild(parent *VScrollPanel) *VScrollPanelChild

func (*VScrollPanelChild) FixedHeight

func (v *VScrollPanelChild) FixedHeight() int

func (*VScrollPanelChild) FixedSize

func (v *VScrollPanelChild) FixedSize() (int, int)

func (*VScrollPanelChild) FixedWidth

func (v *VScrollPanelChild) FixedWidth() int

func (*VScrollPanelChild) Height

func (v *VScrollPanelChild) Height() int

func (*VScrollPanelChild) IsClipped

func (v *VScrollPanelChild) IsClipped(cx, cy, cw, ch int) bool

func (*VScrollPanelChild) MouseButtonEvent

func (v *VScrollPanelChild) MouseButtonEvent(self Widget, x, y int, button glfw.MouseButton, down bool, modifier glfw.ModifierKey) bool

func (*VScrollPanelChild) MouseMotionEvent

func (v *VScrollPanelChild) MouseMotionEvent(self Widget, x, y, relX, relY, button int, modifier glfw.ModifierKey) bool

func (*VScrollPanelChild) ScrollEvent

func (v *VScrollPanelChild) ScrollEvent(self Widget, x, y, relX, relY int) bool

func (*VScrollPanelChild) SetFixedHeight

func (v *VScrollPanelChild) SetFixedHeight(h int)

func (*VScrollPanelChild) SetFixedSize

func (v *VScrollPanelChild) SetFixedSize(w, h int)

func (*VScrollPanelChild) SetFixedWidth

func (v *VScrollPanelChild) SetFixedWidth(w int)

func (*VScrollPanelChild) SetHeight

func (v *VScrollPanelChild) SetHeight(h int)

func (*VScrollPanelChild) SetSize

func (v *VScrollPanelChild) SetSize(w, h int)

func (*VScrollPanelChild) SetVisible

func (v *VScrollPanelChild) SetVisible(flag bool)

func (*VScrollPanelChild) SetWidth

func (v *VScrollPanelChild) SetWidth(w int)

func (*VScrollPanelChild) Size

func (v *VScrollPanelChild) Size() (int, int)

func (*VScrollPanelChild) String

func (v *VScrollPanelChild) String() string

func (*VScrollPanelChild) Visible

func (v *VScrollPanelChild) Visible() bool

func (*VScrollPanelChild) Width

func (v *VScrollPanelChild) Width() int

type Widget

type Widget interface {
	Parent() Widget
	SetParent(parent Widget)

	Layout() Layout
	SetLayout(layout Layout)

	Theme() *Theme
	SetTheme(theme *Theme)

	Position() (int, int)
	SetPosition(x, y int)
	AbsolutePosition() (int, int)
	IsPositionAbsolute() bool

	Size() (int, int)
	SetSize(w, h int)
	Width() int
	SetWidth(w int)
	Height() int
	SetHeight(h int)
	FixedSize() (int, int)
	SetFixedSize(w, h int)
	FixedWidth() int
	SetFixedWidth(w int)
	FixedHeight() int
	SetFixedHeight(h int)
	Clamp() [2]bool
	SetClampWidth(clamp bool)
	SetClampHeight(clamp bool)

	Visible() bool
	SetVisible(v bool)
	VisibleRecursive() bool

	ChildCount() int
	Children() []Widget
	SetChildren([]Widget)
	AddChild(self, w Widget)
	RemoveChildByIndex(i int)
	RemoveChild(w Widget)

	FindPanel() IPanel

	SetID(id string)
	ID() string

	Enabled() bool
	SetEnabled(e bool)

	Focused() bool
	SetFocused(f bool)
	RequestFocus(self Widget)

	Tooltip() string
	SetTooltip(s string)

	FontSize() int
	SetFontSize(s int)
	HasFontSize() bool

	Cursor() Cursor
	SetCursor(c Cursor)

	Contains(x, y int) bool
	IsClipped(x, y, w, h int) bool

	FindWidget(self Widget, x, y int) Widget
	MouseButtonEvent(self Widget, x, y int, button glfw.MouseButton, down bool, modifier glfw.ModifierKey) bool
	MouseMotionEvent(self Widget, x, y, relX, relY, button int, modifier glfw.ModifierKey) bool
	MouseDragEvent(self Widget, x, y, relX, relY, button int, modifier glfw.ModifierKey) bool
	MouseEnterEvent(self Widget, x, y int, enter bool) bool
	ScrollEvent(self Widget, x, y, relX, relY int) bool
	FocusEvent(self Widget, f bool) bool
	KeyboardEvent(self Widget, key glfw.Key, scanCode int, action glfw.Action, modifier glfw.ModifierKey) bool
	KeyboardCharacterEvent(self Widget, codePoint rune) bool
	IMEPreeditEvent(self Widget, text []rune, blocks []int, focusedBlock int) bool
	IMEStatusEvent(self Widget) bool

	PreferredSize(self Widget, ctx *vg.Context) (int, int)
	OnPerformLayout(self Widget, ctx *vg.Context)
	Draw(self Widget, ctx *vg.Context)
	Depth() int

	String() string
}

Widget is base class of all widgets

Widget is the base class of all widgets in ui. It can also be used as an panel to arrange an arbitrary number of child widgets using a layout generator (see Layout)

func NewWidget

func NewWidget(parent Widget) Widget

type WidgetImplement

type WidgetImplement struct {
	// contains filtered or unexported fields
}

func (*WidgetImplement) AbsolutePosition

func (w *WidgetImplement) AbsolutePosition() (int, int)

AbsolutePosition() returns the absolute position on screen

func (*WidgetImplement) AddChild

func (w *WidgetImplement) AddChild(self, child Widget)

AddChild() adds a child widget to the current widget This function almost never needs to be called by hand, since the constructor of \ref Widget automatically adds the current widget to its parent

func (*WidgetImplement) ChildCount

func (w *WidgetImplement) ChildCount() int

ChildCount() returns the number of child widgets

func (*WidgetImplement) Children

func (w *WidgetImplement) Children() []Widget

Children() returns the list of child widgets of the current widget

func (*WidgetImplement) Clamp

func (w *WidgetImplement) Clamp() [2]bool

Clamp() returns whether preferred size is used as fixed size

func (*WidgetImplement) Contains

func (w *WidgetImplement) Contains(x, y int) bool

Contains() checks if the widget contains a certain position

func (*WidgetImplement) Cursor

func (w *WidgetImplement) Cursor() Cursor

Cursor() returns a pointer to the cursor of the widget

func (*WidgetImplement) Depth

func (w *WidgetImplement) Depth() int

func (*WidgetImplement) Draw

func (w *WidgetImplement) Draw(self Widget, ctx *vg.Context)

Draw() draws the widget (and all child widgets)

func (*WidgetImplement) Enabled

func (w *WidgetImplement) Enabled() bool

Enabled() returns whether or not this widget is currently enabled

func (*WidgetImplement) FindPanel

func (w *WidgetImplement) FindPanel() IPanel

FindPanel() walks up the hierarchy and return the parent panel

func (*WidgetImplement) FindWidget

func (w *WidgetImplement) FindWidget(self Widget, x, y int) Widget

FindWidget() determines the widget located at the given position value (recursive)

func (*WidgetImplement) FixedHeight

func (w *WidgetImplement) FixedHeight() int

FixedHeight() returns the fixed height (see SetFixedSize())

func (*WidgetImplement) FixedSize

func (w *WidgetImplement) FixedSize() (int, int)

Return the fixed size (see SetFixedSize())

func (*WidgetImplement) FixedWidth

func (w *WidgetImplement) FixedWidth() int

FixedWidth() returns the fixed width (see SetFixedSize())

func (*WidgetImplement) FocusEvent

func (w *WidgetImplement) FocusEvent(self Widget, f bool) bool

FocusEvent() handles a focus change event (default implementation: record the focus status, but do nothing)

func (*WidgetImplement) Focused

func (w *WidgetImplement) Focused() bool

Focused() returns whether or not this widget is currently focused

func (*WidgetImplement) FontSize

func (w *WidgetImplement) FontSize() int

FontSize() returns current font size. If not set the default of the current theme will be returned

func (*WidgetImplement) HasFontSize

func (w *WidgetImplement) HasFontSize() bool

HasFontSize() return whether the font size is explicitly specified for this widget

func (*WidgetImplement) Height

func (w *WidgetImplement) Height() int

Height() returns the height of the widget

func (*WidgetImplement) ID

func (w *WidgetImplement) ID() string

ID() returns the ID value associated with this widget, if any

func (*WidgetImplement) IMEPreeditEvent

func (w *WidgetImplement) IMEPreeditEvent(self Widget, text []rune, blocks []int, focusedBlock int) bool

IMEPreeditEvent() handles preedit text changes of IME (default implementation: do nothing)

func (*WidgetImplement) IMEStatusEvent

func (w *WidgetImplement) IMEStatusEvent(self Widget) bool

IMEStatusEvent() handles IME status change event (default implementation: do nothing)

func (WidgetImplement) IsClipped

func (w WidgetImplement) IsClipped(cx, cy, cw, ch int) bool

func (*WidgetImplement) IsPositionAbsolute

func (w *WidgetImplement) IsPositionAbsolute() bool

AbsolutePosition() returns whether the the object should be skipped by layout engines.

func (*WidgetImplement) KeyboardCharacterEvent

func (w *WidgetImplement) KeyboardCharacterEvent(self Widget, codePoint rune) bool

KeyboardCharacterEvent() handles text input (UTF-32 format) (default implementation: do nothing)

func (*WidgetImplement) KeyboardEvent

func (w *WidgetImplement) KeyboardEvent(self Widget, key glfw.Key, scanCode int, action glfw.Action, modifier glfw.ModifierKey) bool

KeyboardEvent() handles a keyboard event (default implementation: do nothing)

func (*WidgetImplement) Layout

func (w *WidgetImplement) Layout() Layout

Layout() returns the used layout generator

func (*WidgetImplement) MouseButtonEvent

func (w *WidgetImplement) MouseButtonEvent(self Widget, x, y int, button glfw.MouseButton, down bool, modifier glfw.ModifierKey) bool

MouseButtonEvent() handles a mouse button event (default implementation: propagate to children)

func (*WidgetImplement) MouseDragEvent

func (w *WidgetImplement) MouseDragEvent(self Widget, x, y, relX, relY int, button int, modifier glfw.ModifierKey) bool

MouseDragEvent() handles a mouse drag event (default implementation: do nothing)

func (*WidgetImplement) MouseEnterEvent

func (w *WidgetImplement) MouseEnterEvent(self Widget, x, y int, enter bool) bool

MouseEnterEvent() handles a mouse enter/leave event (default implementation: record this fact, but do nothing)

func (*WidgetImplement) MouseMotionEvent

func (w *WidgetImplement) MouseMotionEvent(self Widget, x, y, relX, relY, button int, modifier glfw.ModifierKey) bool

MouseMotionEvent() handles a mouse motion event (default implementation: propagate to children)

func (*WidgetImplement) OnPerformLayout

func (w *WidgetImplement) OnPerformLayout(self Widget, ctx *vg.Context)

PerformLayout() invokes the associated layout generator to properly place child widgets, if any

func (*WidgetImplement) Parent

func (w *WidgetImplement) Parent() Widget

Parent() returns the parent widget

func (*WidgetImplement) Position

func (w *WidgetImplement) Position() (int, int)

Position() returns the position relative to the parent widget

func (*WidgetImplement) PreferredSize

func (w *WidgetImplement) PreferredSize(self Widget, ctx *vg.Context) (int, int)

PreferredSize() computes the preferred size of the widget

func (*WidgetImplement) RemoveChild

func (wg *WidgetImplement) RemoveChild(w Widget)

RemoveChild() removes a child widget by value

func (*WidgetImplement) RemoveChildByIndex

func (w *WidgetImplement) RemoveChildByIndex(index int)

RemoveChildByIndex() removes a child widget by index

func (*WidgetImplement) RequestFocus

func (w *WidgetImplement) RequestFocus(self Widget)

RequestFocus() requests the focus to be moved to this widget

func (*WidgetImplement) ScrollEvent

func (w *WidgetImplement) ScrollEvent(self Widget, x, y, relX, relY int) bool

ScrollEvent() handles a mouse scroll event (default implementation: propagate to children)

func (*WidgetImplement) SetChildren

func (w *WidgetImplement) SetChildren(children []Widget)

func (*WidgetImplement) SetClampHeight

func (w *WidgetImplement) SetClampHeight(clamp bool)

SetClampHeight() set the preferred height as fixed height

func (*WidgetImplement) SetClampWidth

func (w *WidgetImplement) SetClampWidth(clamp bool)

SetClampWidth() set the preferred width as fixed width

func (*WidgetImplement) SetCursor

func (w *WidgetImplement) SetCursor(c Cursor)

SetCursor() set the cursor of the widget

func (*WidgetImplement) SetEnabled

func (w *WidgetImplement) SetEnabled(e bool)

/ SetEnabled() set whether or not this widget is currently enabled

func (*WidgetImplement) SetFixedHeight

func (w *WidgetImplement) SetFixedHeight(h int)

SetFixedSize() set the fixed height (see SetFixedSize())

func (*WidgetImplement) SetFixedSize

func (wg *WidgetImplement) SetFixedSize(w, h int)

SetFixedSize() set the fixed size of this widget. If nonzero, components of the fixed size attribute override any values computed by a layout generator associated with this widget. Note that just setting the fixed size alone is not enough to actually change its size; this is done with a call to \ref SetSize or a call to PerformLayout() in the parent widget.

func (*WidgetImplement) SetFixedWidth

func (wg *WidgetImplement) SetFixedWidth(w int)

SetFixedWidth() set the fixed width (see SetFixedSize())

func (*WidgetImplement) SetFocused

func (w *WidgetImplement) SetFocused(f bool)

SetFocused() set whether or not this widget is currently focused

func (*WidgetImplement) SetFontSize

func (w *WidgetImplement) SetFontSize(s int)

SetFontSize() set the font size of this widget

func (*WidgetImplement) SetHeight

func (w *WidgetImplement) SetHeight(h int)

SetHeight() set the height of the widget

func (*WidgetImplement) SetID

func (w *WidgetImplement) SetID(id string)

SetID() associates this widget with an ID value (optional)

func (*WidgetImplement) SetLayout

func (w *WidgetImplement) SetLayout(layout Layout)

SetLayout() set the used layout generator

func (*WidgetImplement) SetParent

func (w *WidgetImplement) SetParent(parent Widget)

SetParent() set the parent widget

func (*WidgetImplement) SetPosition

func (w *WidgetImplement) SetPosition(x, y int)

SetPosition() set the position relative to the parent widget

func (*WidgetImplement) SetSize

func (wg *WidgetImplement) SetSize(w, h int)

SetSize() set the size of the widget

func (*WidgetImplement) SetTheme

func (w *WidgetImplement) SetTheme(theme *Theme)

SetTheme() set the theme used to draw this widget

func (*WidgetImplement) SetTooltip

func (w *WidgetImplement) SetTooltip(s string)

SetTooltip() set tooltip string

func (*WidgetImplement) SetVisible

func (w *WidgetImplement) SetVisible(v bool)

SetVisible() set whether or not the widget is currently visible (assuming all parents are visible)

func (*WidgetImplement) SetWidth

func (wg *WidgetImplement) SetWidth(w int)

SetWidth() set the width of the widget

func (*WidgetImplement) Size

func (w *WidgetImplement) Size() (int, int)

Size() returns the size of the widget

func (*WidgetImplement) String

func (w *WidgetImplement) String() string

func (*WidgetImplement) StringHelper

func (w *WidgetImplement) StringHelper(name, extra string) string

func (*WidgetImplement) Theme

func (w *WidgetImplement) Theme() *Theme

Theme() returns the theme used to draw this widget

func (*WidgetImplement) Tooltip

func (w *WidgetImplement) Tooltip() string

Tooltip() returns tooltip string

func (*WidgetImplement) Visible

func (w *WidgetImplement) Visible() bool

Visible() returns whether or not the widget is currently visible (assuming all parents are visible)

func (*WidgetImplement) VisibleRecursive

func (w *WidgetImplement) VisibleRecursive() bool

VisibleRecursive() checks if this widget is currently visible, taking parent widgets into account

func (*WidgetImplement) Width

func (w *WidgetImplement) Width() int

Width() returns the width of the widget

type Window

type Window struct {
	WidgetImplement
	EventQueue
	// contains filtered or unexported fields
}

func (*Window) BackgroundColor

func (w *Window) BackgroundColor() vg.Color

BackgroundColor() returns the screen's background color

func (*Window) Caption

func (w *Window) Caption() string

Caption() gets the panel title bar caption

func (*Window) CenterPanel

func (w *Window) CenterPanel(panel *Panel)

CenterPanel is an internal helper function

func (*Window) DebugPrint

func (w *Window) DebugPrint()

func (*Window) DisposePanel

func (w *Window) DisposePanel(panel *Panel)

DisposePanel is an internal helper function

func (*Window) GLFWWindow

func (w *Window) GLFWWindow() *glfw.Window

GLFWWindow() returns a pointer to the underlying GLFW panel data structure

func (*Window) InitializeGfx

func (w *Window) InitializeGfx()

func (*Window) IsClipped

func (w *Window) IsClipped(cx, cy, cw, ch int) bool

func (*Window) KeyboardCharacterEvent

func (w *Window) KeyboardCharacterEvent(self Widget, codePoint rune) bool

func (*Window) KeyboardEvent

func (w *Window) KeyboardEvent(self Widget, key glfw.Key, scanCode int, action glfw.Action, modifier glfw.ModifierKey) bool

func (*Window) MakeCurrent

func (w *Window) MakeCurrent()

func (*Window) MousePosition

func (w *Window) MousePosition() (int, int)

MousePosition() returns the last observed mouse position value

func (*Window) MovePanelToFront

func (w *Window) MovePanelToFront(panel IPanel)

MovePanelToFront is an internal helper function

func (*Window) NVGContext

func (w *Window) NVGContext() *vg.Context

NVGContext() returns a pointer to the underlying nanoVGo draw context

func (*Window) OnCloseEvent

func (w *Window) OnCloseEvent() bool

func (*Window) OnDropEvent

func (w *Window) OnDropEvent(e *DropEvent) bool

func (*Window) OnKeyEvent

func (w *Window) OnKeyEvent(e *KeyEvent) bool

KeyboardEvent() is a default key event handler

func (*Window) OnMouseButton

func (w *Window) OnMouseButton(e *MouseButtonEvent) bool

func (*Window) OnMouseMove

func (w *Window) OnMouseMove(e *MouseMoveEvent) bool

func (*Window) OnPaint

func (w *Window) OnPaint()

DrawAll() draws the Window contents

func (*Window) OnResizeEvent

func (w *Window) OnResizeEvent(e *ResizeEvent) bool

func (*Window) OnRuneEvent

func (w *Window) OnRuneEvent(e *RuneEvent) bool

KeyboardCharacterEvent() is a text input event handler: codepoint is native endian UTF-32 format

func (*Window) OnScrollEvent

func (w *Window) OnScrollEvent(e *ScrollEvent) bool

func (*Window) PerformLayout

func (w *Window) PerformLayout()

func (*Window) PreeditCursorPos

func (w *Window) PreeditCursorPos() (int, int, int)

XXX

func (*Window) SetBackgroundColor

func (w *Window) SetBackgroundColor(color vg.Color)

SetBackgroundColor() sets the screen's background color

func (*Window) SetCaption

func (w *Window) SetCaption(caption string)

SetCaption() sets the panel title bar caption

func (*Window) SetDrawContentsCallback

func (w *Window) SetDrawContentsCallback(callback func())

SetDrawContentsCallback() sets event handler to use OpenGL draw call

func (*Window) SetDropEventCallback

func (w *Window) SetDropEventCallback(callback func([]string) bool)

SetDropEventCallback() sets event handler to handle a file drop event

func (*Window) SetOnLoad

func (w *Window) SetOnLoad(callback func())

func (*Window) SetPreeditCursorPos

func (w *Window) SetPreeditCursorPos(x, y, h int)

XXX

func (*Window) SetResizeEventCallback

func (w *Window) SetResizeEventCallback(callback func(x, y int) bool)

SetResizeEventCallback() sets panel resize event handler

func (*Window) SetShutdownGLFWOnDestruct

func (w *Window) SetShutdownGLFWOnDestruct(v bool)

func (*Window) SetSize

func (w *Window) SetSize(width, height int)

SetSize() sets window size

func (*Window) SetVisible

func (w *Window) SetVisible(flag bool)

SetVisible() sets the top-level panel visibility (no effect on full-screen panels)

func (*Window) ShutdownGLFWOnDestruct

func (w *Window) ShutdownGLFWOnDestruct() bool

func (*Window) String

func (w *Window) String() string

func (*Window) UpdateFocus

func (w *Window) UpdateFocus(widget Widget)

UpdateFocus is an internal helper function

Directories

Path Synopsis
icons

Jump to

Keyboard shortcuts

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