walk

package module
v0.0.0-...-09597c7 Latest Latest
Warning

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

Go to latest
Published: Jun 13, 2012 License: BSD-3-Clause Imports: 20 Imported by: 0

README

About Walk
==========

Walk is a "Windows Application Library Kit" for the Go Programming Language.

Its focus is graphical user interfaces but there is some more stuff.

Setup
=====

Make sure you have a working Go installation.
See [Getting Started](http://golang.org/doc/install.html)

Now run `go get github.com/lxn/walk`

Using Walk
==========

See the examples directory for inspiration.

Some gui features require an application manifest file alongside or embedded
into your executable, to make use of common controls 6.0. See the examples
directory for such a file.

ui2walk
=======

The ui2walk tool generates Go code for use with Walk from Qt Designer ui files.

It generates .go files for every .ui file in the current working directory,
recursively.

If you e.g. have a file 'mydialog.ui', ui2walk will create 'mydialog_ui.go' in 
the same directory. This file will get regenerated every time you run ui2walk,
so don't edit it.

If it doesn't already exist, ui2walk also creates a matching "logic" file 
'mydialog.go', which will not be regenerated, so you can extend it:

	package main

	import "github.com/lxn/walk"

	type MyDialog struct {
		*walk.Dialog
		ui myDialogUI
	}

	func RunMyDialog(owner walk.RootWidget) (int, error) {
		dlg := new(MyDialog)
		if err := dlg.init(owner); err != nil {
			return 0, err
		}
	
		// TODO: Do further required setup, e.g. for event handling, here.

		return dlg.Run(), nil
	}

Documentation

Index

Constants

View Source
const (
	DlgCmdOK       = IDOK
	DlgCmdCancel   = IDCANCEL
	DlgCmdAbort    = IDABORT
	DlgCmdRetry    = IDRETRY
	DlgCmdIgnore   = IDIGNORE
	DlgCmdYes      = IDYES
	DlgCmdNo       = IDNO
	DlgCmdClose    = IDCLOSE
	DlgCmdHelp     = IDHELP
	DlgCmdTryAgain = IDTRYAGAIN
	DlgCmdContinue = IDCONTINUE
	DlgCmdTimeout  = IDTIMEOUT
)

Variables

This section is empty.

Functions

func AppDataPath

func AppDataPath() (string, error)

func CommonAppDataPath

func CommonAppDataPath() (string, error)

func DriveNames

func DriveNames() ([]string, error)

func Initialize

func Initialize(params InitParams)

func LocalAppDataPath

func LocalAppDataPath() (string, error)

func MsgBox

func MsgBox(owner RootWidget, title, message string, style MsgBoxStyle) int

func RegistryKeyString

func RegistryKeyString(rootKey *RegistryKey, subKeyPath, valueName string) (value string, err error)

func RegistryKeyUint32

func RegistryKeyUint32(rootKey *RegistryKey, subKeyPath, valueName string) (value uint32, err error)

func Shutdown

func Shutdown()

Types

type Action

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

func NewAction

func NewAction() *Action

func (*Action) Checkable

func (a *Action) Checkable() bool

func (*Action) Checked

func (a *Action) Checked() bool

func (*Action) Enabled

func (a *Action) Enabled() bool

func (*Action) Exclusive

func (a *Action) Exclusive() bool

func (*Action) Image

func (a *Action) Image() *Bitmap

func (*Action) SetCheckable

func (a *Action) SetCheckable(value bool) (err error)

func (*Action) SetChecked

func (a *Action) SetChecked(value bool) (err error)

func (*Action) SetEnabled

func (a *Action) SetEnabled(value bool) (err error)

func (*Action) SetExclusive

func (a *Action) SetExclusive(value bool) (err error)

func (*Action) SetImage

func (a *Action) SetImage(value *Bitmap) (err error)

func (*Action) SetText

func (a *Action) SetText(value string) (err error)

func (*Action) SetToolTip

func (a *Action) SetToolTip(value string) (err error)

func (*Action) SetVisible

func (a *Action) SetVisible(value bool) (err error)

func (*Action) Text

func (a *Action) Text() string

func (*Action) ToolTip

func (a *Action) ToolTip() string

func (*Action) Triggered

func (a *Action) Triggered() *Event

func (*Action) Visible

func (a *Action) Visible() bool

type ActionList

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

func (*ActionList) Add

func (l *ActionList) Add(action *Action) error

func (*ActionList) AddMenu

func (l *ActionList) AddMenu(menu *Menu) (*Action, error)

func (*ActionList) At

func (l *ActionList) At(index int) *Action

func (*ActionList) Clear

func (l *ActionList) Clear() error

func (*ActionList) Contains

func (l *ActionList) Contains(action *Action) bool

func (*ActionList) Index

func (l *ActionList) Index(action *Action) int

func (*ActionList) Insert

func (l *ActionList) Insert(index int, action *Action) error

func (*ActionList) InsertMenu

func (l *ActionList) InsertMenu(index int, menu *Menu) (*Action, error)

func (*ActionList) Len

func (l *ActionList) Len() int

func (*ActionList) Remove

func (l *ActionList) Remove(action *Action) error

func (*ActionList) RemoveAt

func (l *ActionList) RemoveAt(index int) error

type Alignment1D

type Alignment1D uint
const (
	AlignNear Alignment1D = iota
	AlignCenter
	AlignFar
)

type Alignment2D

type Alignment2D uint
const (
	AlignHNearVNear Alignment2D = iota
	AlignHCenterVNear
	AlignHFarVNear
	AlignHNearVCenter
	AlignHCenterVCenter
	AlignHFarVCenter
	AlignHNearVFar
	AlignHCenterVFar
	AlignHFarVFar
)

type Application

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

func App

func App() *Application

func (*Application) Exit

func (app *Application) Exit(exitCode int)

func (*Application) ExitCode

func (app *Application) ExitCode() int

func (*Application) OrganizationName

func (app *Application) OrganizationName() string

func (*Application) Panicking

func (app *Application) Panicking() *ErrorEvent

func (*Application) ProductName

func (app *Application) ProductName() string

func (*Application) SetOrganizationName

func (app *Application) SetOrganizationName(value string)

func (*Application) SetProductName

func (app *Application) SetProductName(value string)

func (*Application) SetSettings

func (app *Application) SetSettings(value Settings)

func (*Application) Settings

func (app *Application) Settings() Settings

type Bitmap

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

func NewBitmap

func NewBitmap(size Size) (bmp *Bitmap, err error)

func NewBitmapFromFile

func NewBitmapFromFile(filePath string) (*Bitmap, error)

func (*Bitmap) Dispose

func (bmp *Bitmap) Dispose()

func (*Bitmap) Size

func (bmp *Bitmap) Size() Size

type BitmapBrush

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

func NewBitmapBrush

func NewBitmapBrush(bitmap *Bitmap) (*BitmapBrush, error)

func (*BitmapBrush) Bitmap

func (b *BitmapBrush) Bitmap() *Bitmap

func (*BitmapBrush) Dispose

func (b *BitmapBrush) Dispose()

type BoxLayout

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

func NewHBoxLayout

func NewHBoxLayout() *BoxLayout

func NewVBoxLayout

func NewVBoxLayout() *BoxLayout

func (*BoxLayout) Container

func (l *BoxLayout) Container() Container

func (*BoxLayout) LayoutFlags

func (l *BoxLayout) LayoutFlags() LayoutFlags

func (*BoxLayout) Margins

func (l *BoxLayout) Margins() Margins

func (*BoxLayout) MinSize

func (l *BoxLayout) MinSize() Size

func (*BoxLayout) Orientation

func (l *BoxLayout) Orientation() Orientation

func (*BoxLayout) SetContainer

func (l *BoxLayout) SetContainer(value Container)

func (*BoxLayout) SetMargins

func (l *BoxLayout) SetMargins(value Margins) error

func (*BoxLayout) SetOrientation

func (l *BoxLayout) SetOrientation(value Orientation) error

func (*BoxLayout) SetSpacing

func (l *BoxLayout) SetSpacing(value int) error

func (*BoxLayout) SetStretchFactor

func (l *BoxLayout) SetStretchFactor(widget Widget, factor int) error

func (*BoxLayout) Spacing

func (l *BoxLayout) Spacing() int

func (*BoxLayout) StretchFactor

func (l *BoxLayout) StretchFactor(widget Widget) int

func (*BoxLayout) Update

func (l *BoxLayout) Update(reset bool) error

type Brush

type Brush interface {
	Dispose()
	// contains filtered or unexported methods
}

func NullBrush

func NullBrush() Brush

type Button

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

func (*Button) Checked

func (b *Button) Checked() bool

func (*Button) Clicked

func (b *Button) Clicked() *Event

func (*Button) SetChecked

func (b *Button) SetChecked(value bool)

func (*Button) SetText

func (b *Button) SetText(value string) error

func (*Button) Text

func (b *Button) Text() string

type CancelEvent

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

func (*CancelEvent) Attach

func (e *CancelEvent) Attach(handler CancelEventHandler) int

func (*CancelEvent) Detach

func (e *CancelEvent) Detach(handle int)

type CancelEventHandler

type CancelEventHandler func(canceled *bool)

type CancelEventPublisher

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

func (*CancelEventPublisher) Event

func (p *CancelEventPublisher) Event() *CancelEvent

func (*CancelEventPublisher) Publish

func (p *CancelEventPublisher) Publish(canceled *bool)

type Canvas

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

func NewCanvasFromImage

func NewCanvasFromImage(image Image) (*Canvas, error)

func (*Canvas) Bounds

func (c *Canvas) Bounds() Rectangle

func (*Canvas) Dispose

func (c *Canvas) Dispose()

func (*Canvas) DrawEllipse

func (c *Canvas) DrawEllipse(pen Pen, bounds Rectangle) error

func (*Canvas) DrawImage

func (c *Canvas) DrawImage(image Image, location Point) error

func (*Canvas) DrawImageStretched

func (c *Canvas) DrawImageStretched(image Image, bounds Rectangle) error

func (*Canvas) DrawLine

func (c *Canvas) DrawLine(pen Pen, from, to Point) error

func (*Canvas) DrawRectangle

func (c *Canvas) DrawRectangle(pen Pen, bounds Rectangle) error

func (*Canvas) DrawText

func (c *Canvas) DrawText(text string, font *Font, color Color, bounds Rectangle, format DrawTextFormat) error

func (*Canvas) FillEllipse

func (c *Canvas) FillEllipse(brush Brush, bounds Rectangle) error

func (*Canvas) FillRectangle

func (c *Canvas) FillRectangle(brush Brush, bounds Rectangle) error

func (*Canvas) MeasureText

func (c *Canvas) MeasureText(text string, font *Font, bounds Rectangle, format DrawTextFormat) (boundsMeasured Rectangle, runesFitted int, err error)

type CheckBox

type CheckBox struct {
	Button
}

func NewCheckBox

func NewCheckBox(parent Container) (*CheckBox, error)

func (*CheckBox) LayoutFlags

func (*CheckBox) LayoutFlags() LayoutFlags

func (*CheckBox) MinSizeHint

func (cb *CheckBox) MinSizeHint() Size

func (*CheckBox) SizeHint

func (cb *CheckBox) SizeHint() Size

type CloseEvent

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

func (*CloseEvent) Attach

func (e *CloseEvent) Attach(handler CloseEventHandler) int

func (*CloseEvent) Detach

func (e *CloseEvent) Detach(handle int)

type CloseEventHandler

type CloseEventHandler func(canceled *bool, reason CloseReason)

type CloseEventPublisher

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

func (*CloseEventPublisher) Event

func (p *CloseEventPublisher) Event() *CloseEvent

func (*CloseEventPublisher) Publish

func (p *CloseEventPublisher) Publish(canceled *bool, reason CloseReason)

type CloseReason

type CloseReason int
const (
	CloseReasonUnknown CloseReason = iota
	CloseReasonUser
)

type Color

type Color uint32

func RGB

func RGB(r, g, b byte) Color

func (Color) B

func (c Color) B() byte

func (Color) G

func (c Color) G() byte

func (Color) R

func (c Color) R() byte

type ComboBox

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

func NewComboBox

func NewComboBox(parent Container) (*ComboBox, error)

func (*ComboBox) CurrentIndex

func (cb *ComboBox) CurrentIndex() int

func (*ComboBox) CurrentIndexChanged

func (cb *ComboBox) CurrentIndexChanged() *Event

func (*ComboBox) Format

func (cb *ComboBox) Format() string

func (*ComboBox) LayoutFlags

func (*ComboBox) LayoutFlags() LayoutFlags

func (*ComboBox) MinSizeHint

func (cb *ComboBox) MinSizeHint() Size

func (*ComboBox) Model

func (cb *ComboBox) Model() ListModel

func (*ComboBox) Precision

func (cb *ComboBox) Precision() int

func (*ComboBox) SetCurrentIndex

func (cb *ComboBox) SetCurrentIndex(value int) error

func (*ComboBox) SetFormat

func (cb *ComboBox) SetFormat(value string)

func (*ComboBox) SetModel

func (cb *ComboBox) SetModel(model ListModel) error

func (*ComboBox) SetPrecision

func (cb *ComboBox) SetPrecision(value int)

func (*ComboBox) SetText

func (cb *ComboBox) SetText(value string) error

func (*ComboBox) SetTextSelection

func (cb *ComboBox) SetTextSelection(start, end int)

func (*ComboBox) SizeHint

func (cb *ComboBox) SizeHint() Size

func (*ComboBox) Text

func (cb *ComboBox) Text() string

func (*ComboBox) TextSelection

func (cb *ComboBox) TextSelection() (start, end int)

type Composite

type Composite struct {
	ContainerBase
}

func NewComposite

func NewComposite(parent Container) (*Composite, error)

type Container

type Container interface {
	Widget
	Children() *WidgetList
	Layout() Layout
	SetLayout(value Layout) error
}

type ContainerBase

type ContainerBase struct {
	WidgetBase
	// contains filtered or unexported fields
}

func (*ContainerBase) Children

func (cb *ContainerBase) Children() *WidgetList

func (*ContainerBase) Layout

func (cb *ContainerBase) Layout() Layout

func (*ContainerBase) LayoutFlags

func (cb *ContainerBase) LayoutFlags() LayoutFlags

func (*ContainerBase) MinSizeHint

func (cb *ContainerBase) MinSizeHint() Size

func (*ContainerBase) Persistent

func (cb *ContainerBase) Persistent() bool

func (*ContainerBase) RestoreState

func (cb *ContainerBase) RestoreState() error

func (*ContainerBase) SaveState

func (cb *ContainerBase) SaveState() error

func (*ContainerBase) SetLayout

func (cb *ContainerBase) SetLayout(value Layout) error

func (*ContainerBase) SetPersistent

func (cb *ContainerBase) SetPersistent(value bool)

func (*ContainerBase) SetSuspended

func (cb *ContainerBase) SetSuspended(suspend bool)

func (*ContainerBase) SizeHint

func (cb *ContainerBase) SizeHint() Size

type CosmeticPen

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

func NewCosmeticPen

func NewCosmeticPen(style PenStyle, color Color) (*CosmeticPen, error)

func (*CosmeticPen) Color

func (p *CosmeticPen) Color() Color

func (*CosmeticPen) Dispose

func (p *CosmeticPen) Dispose()

func (*CosmeticPen) Style

func (p *CosmeticPen) Style() PenStyle

func (*CosmeticPen) Width

func (p *CosmeticPen) Width() int

type Cursor

type Cursor interface {
	Dispose()
	// contains filtered or unexported methods
}

func CursorAppStarting

func CursorAppStarting() Cursor

func CursorArrow

func CursorArrow() Cursor

func CursorCross

func CursorCross() Cursor

func CursorHand

func CursorHand() Cursor

func CursorHelp

func CursorHelp() Cursor

func CursorIBeam

func CursorIBeam() Cursor

func CursorIcon

func CursorIcon() Cursor

func CursorNo

func CursorNo() Cursor

func CursorSize

func CursorSize() Cursor

func CursorSizeAll

func CursorSizeAll() Cursor

func CursorSizeNESW

func CursorSizeNESW() Cursor

func CursorSizeNS

func CursorSizeNS() Cursor

func CursorSizeNWSE

func CursorSizeNWSE() Cursor

func CursorSizeWE

func CursorSizeWE() Cursor

func CursorUpArrow

func CursorUpArrow() Cursor

func CursorWait

func CursorWait() Cursor

type CustomWidget

type CustomWidget struct {
	WidgetBase
	// contains filtered or unexported fields
}

func NewCustomWidget

func NewCustomWidget(parent Container, style uint, paint PaintFunc) (*CustomWidget, error)

func (*CustomWidget) ClearsBackground

func (cw *CustomWidget) ClearsBackground() bool

func (*CustomWidget) InvalidatesOnResize

func (cw *CustomWidget) InvalidatesOnResize() bool

func (*CustomWidget) LayoutFlags

func (*CustomWidget) LayoutFlags() LayoutFlags

func (*CustomWidget) SetClearsBackground

func (cw *CustomWidget) SetClearsBackground(value bool)

func (*CustomWidget) SetInvalidatesOnResize

func (cw *CustomWidget) SetInvalidatesOnResize(value bool)

func (*CustomWidget) SizeHint

func (cw *CustomWidget) SizeHint() Size

type DateEdit

type DateEdit struct {
	WidgetBase
	// contains filtered or unexported fields
}

func NewDateEdit

func NewDateEdit(parent Container) (*DateEdit, error)

func (*DateEdit) LayoutFlags

func (*DateEdit) LayoutFlags() LayoutFlags

func (*DateEdit) MinSizeHint

func (de *DateEdit) MinSizeHint() Size

func (*DateEdit) Range

func (de *DateEdit) Range() (min, max time.Time)

func (*DateEdit) SetRange

func (de *DateEdit) SetRange(min, max time.Time) error

func (*DateEdit) SetValue

func (de *DateEdit) SetValue(value time.Time) error

func (*DateEdit) SizeHint

func (de *DateEdit) SizeHint() Size

func (*DateEdit) Value

func (de *DateEdit) Value() time.Time

func (*DateEdit) ValueChanged

func (de *DateEdit) ValueChanged() *Event

type Dialog

type Dialog struct {
	TopLevelWindow
	// contains filtered or unexported fields
}

func NewDialog

func NewDialog(owner RootWidget) (*Dialog, error)

func (*Dialog) Accept

func (dlg *Dialog) Accept()

func (*Dialog) Cancel

func (dlg *Dialog) Cancel()

func (*Dialog) CancelButton

func (dlg *Dialog) CancelButton() *PushButton

func (*Dialog) Close

func (dlg *Dialog) Close(result int)

func (*Dialog) DefaultButton

func (dlg *Dialog) DefaultButton() *PushButton

func (*Dialog) Run

func (dlg *Dialog) Run() int

func (*Dialog) SetCancelButton

func (dlg *Dialog) SetCancelButton(button *PushButton) error

func (*Dialog) SetDefaultButton

func (dlg *Dialog) SetDefaultButton(button *PushButton) error

func (*Dialog) Show

func (dlg *Dialog) Show()

type DrawTextFormat

type DrawTextFormat uint

DrawText format flags

const (
	TextTop                  DrawTextFormat = DT_TOP
	TextLeft                 DrawTextFormat = DT_LEFT
	TextCenter               DrawTextFormat = DT_CENTER
	TextRight                DrawTextFormat = DT_RIGHT
	TextVCenter              DrawTextFormat = DT_VCENTER
	TextBottom               DrawTextFormat = DT_BOTTOM
	TextWordbreak            DrawTextFormat = DT_WORDBREAK
	TextSingleLine           DrawTextFormat = DT_SINGLELINE
	TextExpandTabs           DrawTextFormat = DT_EXPANDTABS
	TextTabstop              DrawTextFormat = DT_TABSTOP
	TextNoClip               DrawTextFormat = DT_NOCLIP
	TextExternalLeading      DrawTextFormat = DT_EXTERNALLEADING
	TextCalcRect             DrawTextFormat = DT_CALCRECT
	TextNoPrefix             DrawTextFormat = DT_NOPREFIX
	TextInternal             DrawTextFormat = DT_INTERNAL
	TextEditControl          DrawTextFormat = DT_EDITCONTROL
	TextPathEllipsis         DrawTextFormat = DT_PATH_ELLIPSIS
	TextEndEllipsis          DrawTextFormat = DT_END_ELLIPSIS
	TextModifyString         DrawTextFormat = DT_MODIFYSTRING
	TextRTLReading           DrawTextFormat = DT_RTLREADING
	TextWordEllipsis         DrawTextFormat = DT_WORD_ELLIPSIS
	TextNoFullWidthCharBreak DrawTextFormat = DT_NOFULLWIDTHCHARBREAK
	TextHidePrefix           DrawTextFormat = DT_HIDEPREFIX
	TextPrefixOnly           DrawTextFormat = DT_PREFIXONLY
)

type Error

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

func (*Error) Error

func (err *Error) Error() string

func (*Error) Inner

func (err *Error) Inner() error

func (*Error) Message

func (err *Error) Message() string

func (*Error) Stack

func (err *Error) Stack() []byte

type ErrorEvent

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

func (*ErrorEvent) Attach

func (e *ErrorEvent) Attach(handler ErrorEventHandler) int

func (*ErrorEvent) Detach

func (e *ErrorEvent) Detach(handle int)

type ErrorEventHandler

type ErrorEventHandler func(err error)

type ErrorEventPublisher

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

func (*ErrorEventPublisher) Event

func (p *ErrorEventPublisher) Event() *ErrorEvent

func (*ErrorEventPublisher) Publish

func (p *ErrorEventPublisher) Publish(err error)

type Event

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

func (*Event) Attach

func (e *Event) Attach(handler EventHandler) int

func (*Event) Detach

func (e *Event) Detach(handle int)

type EventHandler

type EventHandler func()

type EventPublisher

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

func (*EventPublisher) Event

func (p *EventPublisher) Event() *Event

func (*EventPublisher) Publish

func (p *EventPublisher) Publish()

type FileDialog

type FileDialog struct {
	Title          string
	FilePath       string
	InitialDirPath string
	Filter         string
	FilterIndex    int
}

func (*FileDialog) ShowOpen

func (dlg *FileDialog) ShowOpen(owner RootWidget) (accepted bool, err error)

func (*FileDialog) ShowSave

func (dlg *FileDialog) ShowSave(owner RootWidget) (accepted bool, err error)

type Font

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

Font represents a typographic typeface that is used for text drawing operations and on many GUI widgets.

func NewFont

func NewFont(family string, pointSize int, style FontStyle) (*Font, error)

NewFont returns a new Font with the specified attributes.

func (*Font) Bold

func (f *Font) Bold() bool

Bold returns if text drawn using the Font appears with greater weight than normal.

func (*Font) Dispose

func (f *Font) Dispose()

Dispose releases the os resources that were allocated for the Font.

The Font can no longer be used for drawing operations or with GUI widgets after calling this method. It is safe to call Dispose multiple times.

func (*Font) Family

func (f *Font) Family() string

Family returns the family name of the Font.

func (*Font) Italic

func (f *Font) Italic() bool

Italic returns if text drawn using the Font appears slanted.

func (*Font) PointSize

func (f *Font) PointSize() int

PointSize returns the size of the Font in point units.

func (*Font) StrikeOut

func (f *Font) StrikeOut() bool

StrikeOut returns if text drawn using the Font appears striked out.

func (*Font) Style

func (f *Font) Style() FontStyle

Style returns the combination of style flags of the Font.

func (*Font) Underline

func (f *Font) Underline() bool

Underline returns if text drawn using the font appears underlined.

type FontStyle

type FontStyle byte
const (
	FontBold      FontStyle = 0x01
	FontItalic    FontStyle = 0x02
	FontUnderline FontStyle = 0x04
	FontStrikeOut FontStyle = 0x08
)

Font style flags

type GeometricPen

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

func NewGeometricPen

func NewGeometricPen(style PenStyle, width int, brush Brush) (*GeometricPen, error)

func (*GeometricPen) Brush

func (p *GeometricPen) Brush() Brush

func (*GeometricPen) Dispose

func (p *GeometricPen) Dispose()

func (*GeometricPen) Style

func (p *GeometricPen) Style() PenStyle

func (*GeometricPen) Width

func (p *GeometricPen) Width() int

type GridLayout

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

func NewGridLayout

func NewGridLayout() *GridLayout

func (*GridLayout) ColumnStretchFactor

func (l *GridLayout) ColumnStretchFactor(column int) int

func (*GridLayout) Container

func (l *GridLayout) Container() Container

func (*GridLayout) LayoutFlags

func (l *GridLayout) LayoutFlags() LayoutFlags

func (*GridLayout) Margins

func (l *GridLayout) Margins() Margins

func (*GridLayout) MinSize

func (l *GridLayout) MinSize() Size

func (*GridLayout) Range

func (l *GridLayout) Range(widget Widget) (r Rectangle, ok bool)

func (*GridLayout) RowStretchFactor

func (l *GridLayout) RowStretchFactor(row int) int

func (*GridLayout) SetColumnStretchFactor

func (l *GridLayout) SetColumnStretchFactor(column, factor int) error

func (*GridLayout) SetContainer

func (l *GridLayout) SetContainer(value Container)

func (*GridLayout) SetMargins

func (l *GridLayout) SetMargins(value Margins) error

func (*GridLayout) SetRange

func (l *GridLayout) SetRange(widget Widget, r Rectangle) error

func (*GridLayout) SetRowStretchFactor

func (l *GridLayout) SetRowStretchFactor(row, factor int) error

func (*GridLayout) SetSpacing

func (l *GridLayout) SetSpacing(value int) error

func (*GridLayout) Spacing

func (l *GridLayout) Spacing() int

func (*GridLayout) Update

func (l *GridLayout) Update(reset bool) error

type GroupBox

type GroupBox struct {
	WidgetBase
	// contains filtered or unexported fields
}

func NewGroupBox

func NewGroupBox(parent Container) (*GroupBox, error)

func (*GroupBox) Children

func (gb *GroupBox) Children() *WidgetList

func (*GroupBox) ClientBounds

func (gb *GroupBox) ClientBounds() Rectangle

func (*GroupBox) Layout

func (gb *GroupBox) Layout() Layout

func (*GroupBox) LayoutFlags

func (gb *GroupBox) LayoutFlags() LayoutFlags

func (*GroupBox) MinSizeHint

func (gb *GroupBox) MinSizeHint() Size

func (*GroupBox) SetFont

func (gb *GroupBox) SetFont(value *Font)

func (*GroupBox) SetLayout

func (gb *GroupBox) SetLayout(value Layout) error

func (*GroupBox) SetTitle

func (gb *GroupBox) SetTitle(value string) error

func (*GroupBox) SizeHint

func (gb *GroupBox) SizeHint() Size

func (*GroupBox) Title

func (gb *GroupBox) Title() string

type HatchBrush

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

func NewHatchBrush

func NewHatchBrush(color Color, style HatchStyle) (*HatchBrush, error)

func (*HatchBrush) Color

func (b *HatchBrush) Color() Color

func (*HatchBrush) Dispose

func (b *HatchBrush) Dispose()

func (*HatchBrush) Style

func (b *HatchBrush) Style() HatchStyle

type HatchStyle

type HatchStyle int
const (
	HatchHorizontal       HatchStyle = HS_HORIZONTAL
	HatchVertical         HatchStyle = HS_VERTICAL
	HatchForwardDiagonal  HatchStyle = HS_FDIAGONAL
	HatchBackwardDiagonal HatchStyle = HS_BDIAGONAL
	HatchCross            HatchStyle = HS_CROSS
	HatchDiagonalCross    HatchStyle = HS_DIAGCROSS
)

type Icon

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

Icon is a bitmap that supports transparency and combining multiple variants of an image in different resolutions.

func NewIconFromFile

func NewIconFromFile(filePath string) (*Icon, error)

NewIconFromFile returns a new Icon, using the specified icon image file.

func (*Icon) Dispose

func (i *Icon) Dispose() error

Dispose releases the operating system resources associated with the Icon.

type Image

type Image interface {
	Dispose()
	Size() Size
	// contains filtered or unexported methods
}

func NewImageFromFile

func NewImageFromFile(filePath string) (Image, error)

type ImageList

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

func NewImageList

func NewImageList(imageSize Size, maskColor Color) (*ImageList, error)

func (*ImageList) Add

func (il *ImageList) Add(bitmap, maskBitmap *Bitmap) (int, error)

func (*ImageList) AddMasked

func (il *ImageList) AddMasked(bitmap *Bitmap) (int32, error)

func (*ImageList) Dispose

func (il *ImageList) Dispose()

func (*ImageList) MaskColor

func (il *ImageList) MaskColor() Color

type ImageView

type ImageView struct {
	*CustomWidget
	// contains filtered or unexported fields
}

func NewImageView

func NewImageView(parent Container) (*ImageView, error)

func (*ImageView) Image

func (iv *ImageView) Image() Image

func (*ImageView) SetImage

func (iv *ImageView) SetImage(value Image) error

type IndexList

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

func NewIndexList

func NewIndexList(items []int) *IndexList

func (*IndexList) At

func (l *IndexList) At(index int) int

func (*IndexList) Len

func (l *IndexList) Len() int

type IniFileSettings

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

func NewIniFileSettings

func NewIniFileSettings() *IniFileSettings

func (*IniFileSettings) Get

func (ifs *IniFileSettings) Get(key string) (string, bool)

func (*IniFileSettings) Load

func (ifs *IniFileSettings) Load() error

func (*IniFileSettings) Put

func (ifs *IniFileSettings) Put(key, value string) error

func (*IniFileSettings) Save

func (ifs *IniFileSettings) Save() error

type InitParams

type InitParams struct {
	LogErrors    bool
	PanicOnError bool
}

type IntEvent

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

func (*IntEvent) Attach

func (e *IntEvent) Attach(handler IntEventHandler) int

func (*IntEvent) Detach

func (e *IntEvent) Detach(handle int)

type IntEventHandler

type IntEventHandler func(n int)

type IntEventPublisher

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

func (*IntEventPublisher) Event

func (p *IntEventPublisher) Event() *IntEvent

func (*IntEventPublisher) Publish

func (p *IntEventPublisher) Publish(n int)

type ItemChecker

type ItemChecker interface {
	// Checked returns if the specified item is checked.
	Checked(index int) bool

	// SetChecked sets if the specified item is checked.
	SetChecked(index int, checked bool) error
}

ItemChecker is the interface that a model must implement to support check boxes in a widget like TableView.

type KeyEvent

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

func (*KeyEvent) Attach

func (e *KeyEvent) Attach(handler KeyEventHandler) int

func (*KeyEvent) Detach

func (e *KeyEvent) Detach(handle int)

type KeyEventHandler

type KeyEventHandler func(key int)

type KeyEventPublisher

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

func (*KeyEventPublisher) Event

func (p *KeyEventPublisher) Event() *KeyEvent

func (*KeyEventPublisher) Publish

func (p *KeyEventPublisher) Publish(key int)

type Label

type Label struct {
	WidgetBase
}

func NewLabel

func NewLabel(parent Container) (*Label, error)

func (*Label) LayoutFlags

func (*Label) LayoutFlags() LayoutFlags

func (*Label) MinSizeHint

func (l *Label) MinSizeHint() Size

func (*Label) SetText

func (l *Label) SetText(value string) error

func (*Label) SizeHint

func (l *Label) SizeHint() Size

func (*Label) Text

func (l *Label) Text() string

type Layout

type Layout interface {
	Container() Container
	SetContainer(value Container)
	Margins() Margins
	SetMargins(value Margins) error
	Spacing() int
	SetSpacing(value int) error
	LayoutFlags() LayoutFlags
	MinSize() Size
	Update(reset bool) error
}

type LayoutFlags

type LayoutFlags byte

LayoutFlags specify how a Widget wants to be treated when used with a Layout.

These flags are interpreted in respect to Widget.SizeHint.

const (
	// ShrinkableHorz allows a Widget to be shrunk horizontally.
	ShrinkableHorz LayoutFlags = 1 << iota

	// ShrinkableVert allows a Widget to be shrunk vertically.
	ShrinkableVert

	// GrowableHorz allows a Widget to be enlarged horizontally.
	GrowableHorz

	// GrowableVert allows a Widget to be enlarged vertically.
	GrowableVert

	// GreedyHorz specifies that the widget prefers to take up as much space as
	// possible, horizontally.
	GreedyHorz

	// GreedyVert specifies that the widget prefers to take up as much space as
	// possible, vertically.
	GreedyVert
)

type LineEdit

type LineEdit struct {
	WidgetBase
	// contains filtered or unexported fields
}

func NewLineEdit

func NewLineEdit(parent Container) (*LineEdit, error)

func (*LineEdit) CueBanner

func (le *LineEdit) CueBanner() string

func (*LineEdit) EditingFinished

func (le *LineEdit) EditingFinished() *Event

func (*LineEdit) LayoutFlags

func (*LineEdit) LayoutFlags() LayoutFlags

func (*LineEdit) MaxLength

func (le *LineEdit) MaxLength() int

func (*LineEdit) MinSizeHint

func (le *LineEdit) MinSizeHint() Size

func (*LineEdit) PasswordMode

func (le *LineEdit) PasswordMode() bool

func (*LineEdit) ReadOnly

func (le *LineEdit) ReadOnly() bool

func (*LineEdit) ReturnPressed

func (le *LineEdit) ReturnPressed() *Event

func (*LineEdit) SetCueBanner

func (le *LineEdit) SetCueBanner(value string) error

func (*LineEdit) SetMaxLength

func (le *LineEdit) SetMaxLength(value int)

func (*LineEdit) SetPasswordMode

func (le *LineEdit) SetPasswordMode(value bool)

func (*LineEdit) SetReadOnly

func (le *LineEdit) SetReadOnly(readOnly bool) error

func (*LineEdit) SetText

func (le *LineEdit) SetText(value string) error

func (*LineEdit) SetTextSelection

func (le *LineEdit) SetTextSelection(start, end int)

func (*LineEdit) SetValidator

func (le *LineEdit) SetValidator(validator Validator)

func (*LineEdit) SizeHint

func (le *LineEdit) SizeHint() Size

func (*LineEdit) Text

func (le *LineEdit) Text() string

func (*LineEdit) TextChanged

func (le *LineEdit) TextChanged() *Event

func (*LineEdit) TextSelection

func (le *LineEdit) TextSelection() (start, end int)

func (*LineEdit) Validator

func (le *LineEdit) Validator() Validator

type ListBox

type ListBox struct {
	WidgetBase
	// contains filtered or unexported fields
}

func NewListBox

func NewListBox(parent Container) (*ListBox, error)

func (*ListBox) CurrentIndex

func (lb *ListBox) CurrentIndex() int

func (*ListBox) CurrentIndexChanged

func (lb *ListBox) CurrentIndexChanged() *Event

func (*ListBox) DblClicked

func (lb *ListBox) DblClicked() *Event

func (*ListBox) Format

func (lb *ListBox) Format() string

func (*ListBox) LayoutFlags

func (*ListBox) LayoutFlags() LayoutFlags

func (*ListBox) Model

func (lb *ListBox) Model() ListModel

func (*ListBox) Precision

func (lb *ListBox) Precision() int

func (*ListBox) SetCurrentIndex

func (lb *ListBox) SetCurrentIndex(value int) error

func (*ListBox) SetFormat

func (lb *ListBox) SetFormat(value string)

func (*ListBox) SetModel

func (lb *ListBox) SetModel(model ListModel) error

func (*ListBox) SetPrecision

func (lb *ListBox) SetPrecision(value int)

func (*ListBox) SizeHint

func (lb *ListBox) SizeHint() Size

type ListModel

type ListModel interface {
	// ItemCount returns the number of items in the model.
	ItemCount() int

	// Value returns the value that should be displayed for the given index.
	Value(index int) interface{}

	// ItemsReset returns the event that the model should publish when the
	// number of its items changes.
	ItemsReset() *Event

	// ItemChanged returns the event that the model should publish when an item
	// was changed.
	ItemChanged() *IntEvent
}

ListModel is the interface that a model must implement to support widgets like ComboBox.

type ListModelBase

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

ListModelBase implements the ItemsReset and ItemChanged methods of the ListModel interface.

func (*ListModelBase) ItemChanged

func (lmb *ListModelBase) ItemChanged() *IntEvent

func (*ListModelBase) ItemsReset

func (lmb *ListModelBase) ItemsReset() *Event

func (*ListModelBase) PublishItemChanged

func (lmb *ListModelBase) PublishItemChanged(index int)

func (*ListModelBase) PublishItemsReset

func (lmb *ListModelBase) PublishItemsReset()

type MainWindow

type MainWindow struct {
	TopLevelWindow
	// contains filtered or unexported fields
}

func NewMainWindow

func NewMainWindow() (*MainWindow, error)

func (*MainWindow) Children

func (mw *MainWindow) Children() *WidgetList

func (*MainWindow) ClientBounds

func (mw *MainWindow) ClientBounds() Rectangle

func (*MainWindow) Layout

func (mw *MainWindow) Layout() Layout

func (*MainWindow) Menu

func (mw *MainWindow) Menu() *Menu

func (*MainWindow) Run

func (mw *MainWindow) Run() int

func (*MainWindow) SetLayout

func (mw *MainWindow) SetLayout(value Layout) error

func (*MainWindow) ToolBar

func (mw *MainWindow) ToolBar() *ToolBar

type Margins

type Margins struct {
	HNear, VNear, HFar, VFar int
}
type Menu struct {
	// contains filtered or unexported fields
}

func NewMenu

func NewMenu() (*Menu, error)
func (m *Menu) Actions() *ActionList
func (m *Menu) Dispose()
func (m *Menu) IsDisposed() bool

type Metafile

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

func NewMetafile

func NewMetafile(referenceCanvas *Canvas) (*Metafile, error)

func NewMetafileFromFile

func NewMetafileFromFile(filePath string) (*Metafile, error)

func (*Metafile) Dispose

func (mf *Metafile) Dispose()

func (*Metafile) Save

func (mf *Metafile) Save(filePath string) error

func (*Metafile) Size

func (mf *Metafile) Size() Size

type MouseButton

type MouseButton int
const (
	LeftButton MouseButton = iota
	RightButton
	MiddleButton
)

type MouseEvent

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

func (*MouseEvent) Attach

func (e *MouseEvent) Attach(handler MouseEventHandler) int

func (*MouseEvent) Detach

func (e *MouseEvent) Detach(handle int)

type MouseEventHandler

type MouseEventHandler func(x, y int, button MouseButton)

type MouseEventPublisher

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

func (*MouseEventPublisher) Event

func (p *MouseEventPublisher) Event() *MouseEvent

func (*MouseEventPublisher) Publish

func (p *MouseEventPublisher) Publish(x, y int, button MouseButton)

type MsgBoxStyle

type MsgBoxStyle uint
const (
	MsgBoxOK                MsgBoxStyle = MB_OK
	MsgBoxOKCancel          MsgBoxStyle = MB_OKCANCEL
	MsgBoxAbortRetryIgnore  MsgBoxStyle = MB_ABORTRETRYIGNORE
	MsgBoxYesNoCancel       MsgBoxStyle = MB_YESNOCANCEL
	MsgBoxYesNo             MsgBoxStyle = MB_YESNO
	MsgBoxRetryCancel       MsgBoxStyle = MB_RETRYCANCEL
	MsgBoxCancelTryContinue MsgBoxStyle = MB_CANCELTRYCONTINUE
	MsgBoxIconHand          MsgBoxStyle = MB_ICONHAND
	MsgBoxIconQuestion      MsgBoxStyle = MB_ICONQUESTION
	MsgBoxIconExclamation   MsgBoxStyle = MB_ICONEXCLAMATION
	MsgBoxIconAsterisk      MsgBoxStyle = MB_ICONASTERISK
	MsgBoxUserIcon          MsgBoxStyle = MB_USERICON
	MsgBoxIconWarning       MsgBoxStyle = MB_ICONWARNING
	MsgBoxIconError         MsgBoxStyle = MB_ICONERROR
	MsgBoxIconInformation   MsgBoxStyle = MB_ICONINFORMATION
	MsgBoxIconStop          MsgBoxStyle = MB_ICONSTOP
	MsgBoxDefButton1        MsgBoxStyle = MB_DEFBUTTON1
	MsgBoxDefButton2        MsgBoxStyle = MB_DEFBUTTON2
	MsgBoxDefButton3        MsgBoxStyle = MB_DEFBUTTON3
	MsgBoxDefButton4        MsgBoxStyle = MB_DEFBUTTON4
)

type NotifyIcon

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

NotifyIcon represents an icon in the taskbar notification area.

func NewNotifyIcon

func NewNotifyIcon() (*NotifyIcon, error)

NewNotifyIcon creates and returns a new NotifyIcon.

The NotifyIcon is initially not visible.

func (*NotifyIcon) ContextMenu

func (ni *NotifyIcon) ContextMenu() *Menu

ContextMenu returns the context menu of the NotifyIcon.

func (*NotifyIcon) Dispose

func (ni *NotifyIcon) Dispose() error

Dispose releases the operating system resources associated with the NotifyIcon.

The associated Icon is not disposed of.

func (*NotifyIcon) Icon

func (ni *NotifyIcon) Icon() *Icon

Icon returns the Icon of the NotifyIcon.

func (*NotifyIcon) MouseDown

func (ni *NotifyIcon) MouseDown() *MouseEvent

MouseDown returns the event that is published when a mouse button is pressed while the cursor is over the NotifyIcon.

func (*NotifyIcon) MouseUp

func (ni *NotifyIcon) MouseUp() *MouseEvent

MouseDown returns the event that is published when a mouse button is released while the cursor is over the NotifyIcon.

func (*NotifyIcon) SetIcon

func (ni *NotifyIcon) SetIcon(icon *Icon) error

SetIcon sets the Icon of the NotifyIcon.

func (*NotifyIcon) SetToolTip

func (ni *NotifyIcon) SetToolTip(toolTip string) error

SetToolTip sets the tool tip text of the NotifyIcon.

func (*NotifyIcon) SetVisible

func (ni *NotifyIcon) SetVisible(visible bool) error

SetVisible sets if the NotifyIcon is visible.

func (*NotifyIcon) ToolTip

func (ni *NotifyIcon) ToolTip() string

ToolTip returns the tool tip text of the NotifyIcon.

func (*NotifyIcon) Visible

func (ni *NotifyIcon) Visible() bool

Visible returns if the NotifyIcon is visible.

type NumberEdit

type NumberEdit struct {
	WidgetBase
	// contains filtered or unexported fields
}

func NewNumberEdit

func NewNumberEdit(parent Container) (*NumberEdit, error)

func (*NumberEdit) Decimals

func (ne *NumberEdit) Decimals() int

func (*NumberEdit) Enabled

func (ne *NumberEdit) Enabled() bool

func (*NumberEdit) Font

func (ne *NumberEdit) Font() *Font

func (*NumberEdit) Increment

func (ne *NumberEdit) Increment() float64

func (*NumberEdit) LayoutFlags

func (*NumberEdit) LayoutFlags() LayoutFlags

func (*NumberEdit) MaxValue

func (ne *NumberEdit) MaxValue() float64

func (*NumberEdit) MinSizeHint

func (ne *NumberEdit) MinSizeHint() Size

func (*NumberEdit) MinValue

func (ne *NumberEdit) MinValue() float64

func (*NumberEdit) SetDecimals

func (ne *NumberEdit) SetDecimals(value int) error

func (*NumberEdit) SetEnabled

func (ne *NumberEdit) SetEnabled(value bool)

func (*NumberEdit) SetFocus

func (ne *NumberEdit) SetFocus() error

func (*NumberEdit) SetFont

func (ne *NumberEdit) SetFont(value *Font)

func (*NumberEdit) SetIncrement

func (ne *NumberEdit) SetIncrement(value float64) error

func (*NumberEdit) SetRange

func (ne *NumberEdit) SetRange(min, max float64) error

func (*NumberEdit) SetTextSelection

func (ne *NumberEdit) SetTextSelection(start, end int)

func (*NumberEdit) SetValue

func (ne *NumberEdit) SetValue(value float64) error

func (*NumberEdit) SizeHint

func (ne *NumberEdit) SizeHint() Size

func (*NumberEdit) TextSelection

func (ne *NumberEdit) TextSelection() (start, end int)

func (*NumberEdit) Value

func (ne *NumberEdit) Value() float64

func (*NumberEdit) ValueChanged

func (ne *NumberEdit) ValueChanged() *Event

type NumberValidator

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

func NewNumberValidator

func NewNumberValidator() *NumberValidator

func (*NumberValidator) Decimals

func (nv *NumberValidator) Decimals() int

func (*NumberValidator) MaxValue

func (nv *NumberValidator) MaxValue() float64

func (*NumberValidator) MinValue

func (nv *NumberValidator) MinValue() float64

func (*NumberValidator) SetDecimals

func (nv *NumberValidator) SetDecimals(value int) error

func (*NumberValidator) SetRange

func (nv *NumberValidator) SetRange(min, max float64) error

func (*NumberValidator) Validate

func (nv *NumberValidator) Validate(s string) ValidationStatus

type Orientation

type Orientation byte
const (
	Horizontal Orientation = iota
	Vertical
)

type PaintFunc

type PaintFunc func(canvas *Canvas, updateBounds Rectangle) error

type Pen

type Pen interface {
	Dispose()
	Style() PenStyle
	Width() int
	// contains filtered or unexported methods
}

func NullPen

func NullPen() Pen

type PenStyle

type PenStyle int
const (
	PenSolid       PenStyle = PS_SOLID
	PenDash        PenStyle = PS_DASH
	PenDot         PenStyle = PS_DOT
	PenDashDot     PenStyle = PS_DASHDOT
	PenDashDotDot  PenStyle = PS_DASHDOTDOT
	PenNull        PenStyle = PS_NULL
	PenInsideFrame PenStyle = PS_INSIDEFRAME
	PenUserStyle   PenStyle = PS_USERSTYLE
	PenAlternate   PenStyle = PS_ALTERNATE
)

Pen styles

const (
	PenCapRound  PenStyle = PS_ENDCAP_ROUND
	PenCapSquare PenStyle = PS_ENDCAP_SQUARE
	PenCapFlat   PenStyle = PS_ENDCAP_FLAT
)

Pen cap styles (geometric pens only)

const (
	PenJoinBevel PenStyle = PS_JOIN_BEVEL
	PenJoinMiter PenStyle = PS_JOIN_MITER
	PenJoinRound PenStyle = PS_JOIN_ROUND
)

Pen join styles (geometric pens only)

type Persistable

type Persistable interface {
	Persistent() bool
	SetPersistent(value bool)
	SaveState() error
	RestoreState() error
}

type Point

type Point struct {
	X, Y int
}

type ProgressBar

type ProgressBar struct {
	WidgetBase
}

func NewProgressBar

func NewProgressBar(parent Container) (*ProgressBar, error)

func (*ProgressBar) LayoutFlags

func (*ProgressBar) LayoutFlags() LayoutFlags

func (*ProgressBar) MaxValue

func (pb *ProgressBar) MaxValue() int

func (*ProgressBar) MinSizeHint

func (pb *ProgressBar) MinSizeHint() Size

func (*ProgressBar) MinValue

func (pb *ProgressBar) MinValue() int

func (*ProgressBar) SetRange

func (pb *ProgressBar) SetRange(min, max int)

func (*ProgressBar) SetValue

func (pb *ProgressBar) SetValue(value int)

func (*ProgressBar) SizeHint

func (pb *ProgressBar) SizeHint() Size

func (*ProgressBar) Value

func (pb *ProgressBar) Value() int

type PushButton

type PushButton struct {
	Button
}

func NewPushButton

func NewPushButton(parent Container) (*PushButton, error)

func (*PushButton) LayoutFlags

func (*PushButton) LayoutFlags() LayoutFlags

func (*PushButton) MinSizeHint

func (pb *PushButton) MinSizeHint() Size

func (*PushButton) SizeHint

func (pb *PushButton) SizeHint() Size

type RadioButton

type RadioButton struct {
	Button
}

func NewRadioButton

func NewRadioButton(parent Container) (*RadioButton, error)

func (*RadioButton) LayoutFlags

func (*RadioButton) LayoutFlags() LayoutFlags

func (*RadioButton) MinSizeHint

func (rb *RadioButton) MinSizeHint() Size

func (*RadioButton) SizeHint

func (rb *RadioButton) SizeHint() Size

type Rectangle

type Rectangle struct {
	X, Y, Width, Height int
}

func (Rectangle) Bottom

func (r Rectangle) Bottom() int

func (Rectangle) Left

func (r Rectangle) Left() int

func (Rectangle) Location

func (r Rectangle) Location() Point

func (Rectangle) Right

func (r Rectangle) Right() int

func (*Rectangle) SetLocation

func (r *Rectangle) SetLocation(p Point) Rectangle

func (*Rectangle) SetSize

func (r *Rectangle) SetSize(s Size) Rectangle

func (Rectangle) Size

func (r Rectangle) Size() Size

func (Rectangle) Top

func (r Rectangle) Top() int

type RegistryKey

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

func ClassesRootKey

func ClassesRootKey() *RegistryKey

func CurrentUserKey

func CurrentUserKey() *RegistryKey

func LocalMachineKey

func LocalMachineKey() *RegistryKey

type RootWidget

type RootWidget interface {
	Container
	Run() int
}

type Settings

type Settings interface {
	Get(key string) (string, bool)
	Put(key, value string) error
	Load() error
	Save() error
}

type Size

type Size struct {
	Width, Height int
}

type SolidColorBrush

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

func NewSolidColorBrush

func NewSolidColorBrush(color Color) (*SolidColorBrush, error)

func (*SolidColorBrush) Color

func (b *SolidColorBrush) Color() Color

func (*SolidColorBrush) Dispose

func (b *SolidColorBrush) Dispose()

type Spacer

type Spacer struct {
	WidgetBase
	// contains filtered or unexported fields
}

func NewHSpacer

func NewHSpacer(parent Container) (*Spacer, error)

func NewHSpacerFixed

func NewHSpacerFixed(parent Container, width int) (*Spacer, error)

func NewVSpacer

func NewVSpacer(parent Container) (*Spacer, error)

func NewVSpacerFixed

func NewVSpacerFixed(parent Container, height int) (*Spacer, error)

func (*Spacer) LayoutFlags

func (s *Spacer) LayoutFlags() LayoutFlags

func (*Spacer) SizeHint

func (s *Spacer) SizeHint() Size

type Splitter

type Splitter struct {
	ContainerBase
	// contains filtered or unexported fields
}

func NewSplitter

func NewSplitter(parent Container) (*Splitter, error)

func (*Splitter) HandleWidth

func (s *Splitter) HandleWidth() int

func (*Splitter) LayoutFlags

func (s *Splitter) LayoutFlags() LayoutFlags

func (*Splitter) Orientation

func (s *Splitter) Orientation() Orientation

func (*Splitter) Persistent

func (s *Splitter) Persistent() bool

func (*Splitter) RestoreState

func (s *Splitter) RestoreState() error

func (*Splitter) SaveState

func (s *Splitter) SaveState() error

func (*Splitter) SetHandleWidth

func (s *Splitter) SetHandleWidth(value int) error

func (*Splitter) SetLayout

func (s *Splitter) SetLayout(value Layout) error

func (*Splitter) SetOrientation

func (s *Splitter) SetOrientation(value Orientation) error

func (*Splitter) SetPersistent

func (s *Splitter) SetPersistent(value bool)

func (*Splitter) SizeHint

func (s *Splitter) SizeHint() Size

type TabPage

type TabPage struct {
	ContainerBase
	// contains filtered or unexported fields
}

func NewTabPage

func NewTabPage() (*TabPage, error)

func (*TabPage) SetTitle

func (tp *TabPage) SetTitle(value string) error

func (*TabPage) Title

func (tp *TabPage) Title() string

type TabPageList

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

func (*TabPageList) Add

func (l *TabPageList) Add(item *TabPage) error

func (*TabPageList) At

func (l *TabPageList) At(index int) *TabPage

func (*TabPageList) Clear

func (l *TabPageList) Clear() error

func (*TabPageList) Contains

func (l *TabPageList) Contains(item *TabPage) bool

func (*TabPageList) Index

func (l *TabPageList) Index(item *TabPage) int

func (*TabPageList) Insert

func (l *TabPageList) Insert(index int, item *TabPage) error

func (*TabPageList) Len

func (l *TabPageList) Len() int

func (*TabPageList) Remove

func (l *TabPageList) Remove(item *TabPage) error

func (*TabPageList) RemoveAt

func (l *TabPageList) RemoveAt(index int) error

type TabWidget

type TabWidget struct {
	WidgetBase
	// contains filtered or unexported fields
}

func NewTabWidget

func NewTabWidget(parent Container) (*TabWidget, error)

func (*TabWidget) CurrentIndex

func (tw *TabWidget) CurrentIndex() int

func (*TabWidget) CurrentIndexChanged

func (tw *TabWidget) CurrentIndexChanged() *Event

func (*TabWidget) LayoutFlags

func (tw *TabWidget) LayoutFlags() LayoutFlags

func (*TabWidget) MinSizeHint

func (tw *TabWidget) MinSizeHint() Size

func (*TabWidget) Pages

func (tw *TabWidget) Pages() *TabPageList

func (*TabWidget) Persistent

func (tw *TabWidget) Persistent() bool

func (*TabWidget) RestoreState

func (tw *TabWidget) RestoreState() error

func (*TabWidget) SaveState

func (tw *TabWidget) SaveState() error

func (*TabWidget) SetCurrentIndex

func (tw *TabWidget) SetCurrentIndex(index int) error

func (*TabWidget) SetPersistent

func (tw *TabWidget) SetPersistent(value bool)

func (*TabWidget) SizeHint

func (tw *TabWidget) SizeHint() Size

type TableColumn

type TableColumn struct {
	// Name is the optional name of the column.
	Name string

	// Title is the text to display in the column header.
	Title string

	// Format is the format string for converting a value into a string.
	Format string

	// Precision is the number of decimal places for formatting a big.Rat.
	Precision int

	// Width is the width of the column in pixels.
	Width int

	// Alignment is the alignment of the column (who would have thought).
	Alignment Alignment1D
}

TableColumn provides column information for widgets like TableView.

type TableModel

type TableModel interface {
	// Columns returns information about the columns of the model.
	Columns() []TableColumn

	// RowCount returns the number of rows in the model.
	RowCount() int

	// Value returns the value that should be displayed for the given cell.
	Value(row, col int) interface{}

	// RowsReset returns the event that the model should publish when the number
	// of its rows changes.
	RowsReset() *Event

	// RowChanged returns the event that the model should publish when a row was
	// changed.
	RowChanged() *IntEvent
}

TableModel is the interface that a model must implement to support widgets like TableView.

type TableModelBase

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

TableModelBase implements the RowsReset and RowChanged methods of the TableModel interface.

func (*TableModelBase) PublishRowChanged

func (tmb *TableModelBase) PublishRowChanged(row int)

func (*TableModelBase) PublishRowsReset

func (tmb *TableModelBase) PublishRowsReset()

func (*TableModelBase) RowChanged

func (tmb *TableModelBase) RowChanged() *IntEvent

func (*TableModelBase) RowsReset

func (tmb *TableModelBase) RowsReset() *Event

type TableView

type TableView struct {
	WidgetBase
	// contains filtered or unexported fields
}

TableView is a model based widget for record centric, tabular data.

TableView is implemented as a virtual mode list view to support quite large amounts of data.

func NewTableView

func NewTableView(parent Container) (*TableView, error)

NewTableView creates and returns a *TableView as child of the specified Container.

func (*TableView) CheckBoxes

func (tv *TableView) CheckBoxes() bool

CheckBoxes returns if the *TableView has check boxes.

func (*TableView) ColumnClicked

func (tv *TableView) ColumnClicked() *IntEvent

ColumnClicked returns the event that is published after a column header was clicked.

func (*TableView) CurrentIndex

func (tv *TableView) CurrentIndex() int

CurrentIndex returns the index of the current item, or -1 if there is no current item.

func (*TableView) CurrentIndexChanged

func (tv *TableView) CurrentIndexChanged() *Event

CurrentIndexChanged is the event that is published after CurrentIndex has changed.

func (*TableView) Dispose

func (tv *TableView) Dispose()

Dispose releases the operating system resources, associated with the *TableView.

func (*TableView) ItemActivated

func (tv *TableView) ItemActivated() *Event

ItemActivated returns the event that is published after an item was activated.

An item is activated when it is double clicked or the enter key is pressed when the item is selected.

func (*TableView) ItemStateChangedEventDelay

func (tv *TableView) ItemStateChangedEventDelay() int

ItemStateChangedEventDelay returns the delay in milliseconds, between the moment the state of an item in the *TableView changes and the moment the associated event is published.

By default there is no delay.

func (*TableView) LastColumnStretched

func (tv *TableView) LastColumnStretched() bool

LastColumnStretched returns if the last column should take up all remaining horizontal space of the *TableView.

func (*TableView) LayoutFlags

func (*TableView) LayoutFlags() LayoutFlags

LayoutFlags returns a combination of LayoutFlags that specify how the *TableView wants to be treated by Layout implementations.

func (*TableView) MinSizeHint

func (tv *TableView) MinSizeHint() Size

MinSizeHint returns the minimum outer Size, including decorations, that makes sense for the *TableView.

func (*TableView) Model

func (tv *TableView) Model() TableModel

Model returns the TableModel that provides data to the *TableView.

func (*TableView) Persistent

func (tv *TableView) Persistent() bool

Persistent returns if the *TableView should persist its UI state, like column widths. See *App.Settings for details.

func (*TableView) RestoreState

func (tv *TableView) RestoreState() error

RestoreState restores the UI state of the *TableView from the settings.

func (*TableView) SaveState

func (tv *TableView) SaveState() error

SaveState writes the UI state of the *TableView to the settings.

func (*TableView) SelectedColumnIndex

func (tv *TableView) SelectedColumnIndex() int

SelectedColumnIndex returns the index of the selected column or -1 if no column is selected.

func (*TableView) SelectedIndexes

func (tv *TableView) SelectedIndexes() *IndexList

SelectedIndexes returns a list of the currently selected item indexes.

func (*TableView) SelectedIndexesChanged

func (tv *TableView) SelectedIndexesChanged() *Event

SelectedIndexesChanged returns the event that is published when the list of selected item indexes changed.

func (*TableView) SetCheckBoxes

func (tv *TableView) SetCheckBoxes(value bool)

SetCheckBoxes sets if the *TableView has check boxes.

func (*TableView) SetCurrentIndex

func (tv *TableView) SetCurrentIndex(value int) error

SetCurrentIndex sets the index of the current item.

Call this with a value of -1 to have no current item.

func (*TableView) SetItemStateChangedEventDelay

func (tv *TableView) SetItemStateChangedEventDelay(delay int)

SetItemStateChangedEventDelay sets the delay in milliseconds, between the moment the state of an item in the *TableView changes and the moment the associated event is published.

An example where this may be useful is a master-details scenario. If the master TableView is configured to delay the event, you can avoid pointless updates of the details TableView, if the user uses arrow keys to rapidly navigate the master view.

func (*TableView) SetLastColumnStretched

func (tv *TableView) SetLastColumnStretched(value bool) error

SetLastColumnStretched sets if the last column should take up all remaining horizontal space of the *TableView.

The effect of setting this is persistent.

func (*TableView) SetModel

func (tv *TableView) SetModel(model TableModel) error

SetModel sets the TableModel that provides data to the *TableView.

func (*TableView) SetPersistent

func (tv *TableView) SetPersistent(value bool)

SetPersistent sets if the *TableView should persist its UI state, like column widths. See *App.Settings for details.

func (*TableView) SetSelectedColumnIndex

func (tv *TableView) SetSelectedColumnIndex(value int)

SetSelectedColumnIndex sets the index of the selected column.

Call this with a value of -1 to clear any column selection.

func (*TableView) SetSingleItemSelection

func (tv *TableView) SetSingleItemSelection(value bool) error

SetSingleItemSelection sets if only a single item can be selected at once.

func (*TableView) SingleItemSelection

func (tv *TableView) SingleItemSelection() bool

SingleItemSelection returns if only a single item can be selected at once.

By default multiple items can be selected at once.

func (*TableView) SizeHint

func (tv *TableView) SizeHint() Size

SizeHint returns a sensible Size for a *TableView.

func (*TableView) StretchLastColumn

func (tv *TableView) StretchLastColumn() error

StretchLastColumn makes the last column take up all remaining horizontal space of the *TableView.

The effect of this is not persistent.

type TextEdit

type TextEdit struct {
	WidgetBase
}

func NewTextEdit

func NewTextEdit(parent Container) (*TextEdit, error)

func (*TextEdit) LayoutFlags

func (*TextEdit) LayoutFlags() LayoutFlags

func (*TextEdit) MinSizeHint

func (te *TextEdit) MinSizeHint() Size

func (*TextEdit) ReadOnly

func (te *TextEdit) ReadOnly() bool

func (*TextEdit) SetReadOnly

func (te *TextEdit) SetReadOnly(readOnly bool) error

func (*TextEdit) SetText

func (te *TextEdit) SetText(value string) error

func (*TextEdit) SetTextSelection

func (te *TextEdit) SetTextSelection(start, end int)

func (*TextEdit) SizeHint

func (te *TextEdit) SizeHint() Size

func (*TextEdit) Text

func (te *TextEdit) Text() string

func (*TextEdit) TextSelection

func (te *TextEdit) TextSelection() (start, end int)

type ToolBar

type ToolBar struct {
	WidgetBase
	// contains filtered or unexported fields
}

func NewToolBar

func NewToolBar(parent Container) (*ToolBar, error)

func NewVerticalToolBar

func NewVerticalToolBar(parent Container) (*ToolBar, error)

func (*ToolBar) Actions

func (tb *ToolBar) Actions() *ActionList

func (*ToolBar) DefaultButtonWidth

func (tb *ToolBar) DefaultButtonWidth() int

DefaultButtonWidth returns the default button width of the ToolBar.

The default value for a horizontal ToolBar is 0, resulting in automatic sizing behavior. For a vertical ToolBar, the default is 100 pixels.

func (*ToolBar) ImageList

func (tb *ToolBar) ImageList() *ImageList

func (*ToolBar) LayoutFlags

func (tb *ToolBar) LayoutFlags() LayoutFlags

func (*ToolBar) MaxTextRows

func (tb *ToolBar) MaxTextRows() int

func (*ToolBar) MinSizeHint

func (tb *ToolBar) MinSizeHint() Size

func (*ToolBar) SetDefaultButtonWidth

func (tb *ToolBar) SetDefaultButtonWidth(width int) error

SetDefaultButtonWidth sets the default button width of the ToolBar.

Calling this method affects all buttons in the ToolBar, no matter if they are added before or after the call. A width of 0 results in automatic sizing behavior. Negative values are not allowed.

func (*ToolBar) SetImageList

func (tb *ToolBar) SetImageList(value *ImageList)

func (*ToolBar) SetMaxTextRows

func (tb *ToolBar) SetMaxTextRows(maxTextRows int) error

func (*ToolBar) SizeHint

func (tb *ToolBar) SizeHint() Size

type ToolButton

type ToolButton struct {
	Button
}

func NewToolButton

func NewToolButton(parent Container) (*ToolButton, error)

func (*ToolButton) LayoutFlags

func (*ToolButton) LayoutFlags() LayoutFlags

func (*ToolButton) MinSizeHint

func (tb *ToolButton) MinSizeHint() Size

func (*ToolButton) SizeHint

func (tb *ToolButton) SizeHint() Size

type ToolTip

type ToolTip struct {
	WidgetBase
}

func NewToolTip

func NewToolTip(parent Container) (*ToolTip, error)

func (*ToolTip) AddWidget

func (tt *ToolTip) AddWidget(widget Widget, text string) error

func (*ToolTip) LayoutFlags

func (*ToolTip) LayoutFlags() LayoutFlags

func (*ToolTip) RemoveWidget

func (tt *ToolTip) RemoveWidget(widget Widget) error

func (*ToolTip) SetTitle

func (tt *ToolTip) SetTitle(value string) error

func (*ToolTip) SizeHint

func (tt *ToolTip) SizeHint() Size

func (*ToolTip) Title

func (tt *ToolTip) Title() string

type TopLevelWindow

type TopLevelWindow struct {
	ContainerBase
	// contains filtered or unexported fields
}

func (*TopLevelWindow) Close

func (tlw *TopLevelWindow) Close() error

func (*TopLevelWindow) Closing

func (tlw *TopLevelWindow) Closing() *CloseEvent

func (*TopLevelWindow) Hide

func (tlw *TopLevelWindow) Hide()

func (*TopLevelWindow) Icon

func (tlw *TopLevelWindow) Icon() *Icon

func (*TopLevelWindow) LayoutFlags

func (tlw *TopLevelWindow) LayoutFlags() LayoutFlags

func (*TopLevelWindow) Owner

func (tlw *TopLevelWindow) Owner() RootWidget

func (*TopLevelWindow) RestoreState

func (tlw *TopLevelWindow) RestoreState() error

func (*TopLevelWindow) Run

func (tlw *TopLevelWindow) Run() int

func (*TopLevelWindow) SaveState

func (tlw *TopLevelWindow) SaveState() error

func (*TopLevelWindow) SetIcon

func (tlw *TopLevelWindow) SetIcon(icon *Icon)

func (*TopLevelWindow) SetOwner

func (tlw *TopLevelWindow) SetOwner(value RootWidget) error

func (*TopLevelWindow) SetTitle

func (tlw *TopLevelWindow) SetTitle(value string) error

func (*TopLevelWindow) Show

func (tlw *TopLevelWindow) Show()

func (*TopLevelWindow) SizeHint

func (tlw *TopLevelWindow) SizeHint() Size

func (*TopLevelWindow) Starting

func (tlw *TopLevelWindow) Starting() *Event

func (*TopLevelWindow) Title

func (tlw *TopLevelWindow) Title() string

type TreeView

type TreeView struct {
	WidgetBase
	// contains filtered or unexported fields
}

func NewTreeView

func NewTreeView(parent Container) (*TreeView, error)

func (*TreeView) ItemCollapsed

func (tv *TreeView) ItemCollapsed() *TreeViewItemEvent

func (*TreeView) ItemCollapsing

func (tv *TreeView) ItemCollapsing() *TreeViewItemEvent

func (*TreeView) ItemExpanded

func (tv *TreeView) ItemExpanded() *TreeViewItemEvent

func (*TreeView) ItemExpanding

func (tv *TreeView) ItemExpanding() *TreeViewItemEvent

func (*TreeView) Items

func (tv *TreeView) Items() *TreeViewItemList

func (*TreeView) LayoutFlags

func (*TreeView) LayoutFlags() LayoutFlags

func (*TreeView) SelectionChanged

func (tv *TreeView) SelectionChanged() *TreeViewItemSelectionEvent

func (*TreeView) SelectionChanging

func (tv *TreeView) SelectionChanging() *TreeViewItemSelectionEvent

func (*TreeView) SizeHint

func (tv *TreeView) SizeHint() Size

type TreeViewItem

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

func NewTreeViewItem

func NewTreeViewItem() *TreeViewItem

func (*TreeViewItem) Children

func (tvi *TreeViewItem) Children() *TreeViewItemList

func (*TreeViewItem) Parent

func (tvi *TreeViewItem) Parent() *TreeViewItem

func (*TreeViewItem) SetText

func (tvi *TreeViewItem) SetText(value string) error

func (*TreeViewItem) Text

func (tvi *TreeViewItem) Text() string

type TreeViewItemEvent

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

func (*TreeViewItemEvent) Attach

func (e *TreeViewItemEvent) Attach(handler TreeViewItemEventHandler) int

func (*TreeViewItemEvent) Detach

func (e *TreeViewItemEvent) Detach(handle int)

type TreeViewItemEventHandler

type TreeViewItemEventHandler func(item *TreeViewItem)

type TreeViewItemEventPublisher

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

func (*TreeViewItemEventPublisher) Event

func (*TreeViewItemEventPublisher) Publish

func (p *TreeViewItemEventPublisher) Publish(item *TreeViewItem)

type TreeViewItemList

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

func (*TreeViewItemList) Add

func (l *TreeViewItemList) Add(item *TreeViewItem) error

func (*TreeViewItemList) At

func (l *TreeViewItemList) At(index int) *TreeViewItem

func (*TreeViewItemList) Clear

func (l *TreeViewItemList) Clear() error

func (*TreeViewItemList) Contains

func (l *TreeViewItemList) Contains(item *TreeViewItem) bool

func (*TreeViewItemList) Index

func (l *TreeViewItemList) Index(item *TreeViewItem) int

func (*TreeViewItemList) Insert

func (l *TreeViewItemList) Insert(index int, item *TreeViewItem) error

func (*TreeViewItemList) Len

func (l *TreeViewItemList) Len() int

func (*TreeViewItemList) Remove

func (l *TreeViewItemList) Remove(item *TreeViewItem) error

func (*TreeViewItemList) RemoveAt

func (l *TreeViewItemList) RemoveAt(index int) error

type TreeViewItemSelectionEvent

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

func (*TreeViewItemSelectionEvent) Attach

func (*TreeViewItemSelectionEvent) Detach

func (e *TreeViewItemSelectionEvent) Detach(handle int)

type TreeViewItemSelectionEventHandler

type TreeViewItemSelectionEventHandler func(old, new *TreeViewItem)

type TreeViewItemSelectionEventPublisher

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

func (*TreeViewItemSelectionEventPublisher) Event

func (*TreeViewItemSelectionEventPublisher) Publish

func (p *TreeViewItemSelectionEventPublisher) Publish(old, new *TreeViewItem)

type ValidationStatus

type ValidationStatus uint
const (
	Invalid ValidationStatus = iota
	Partial
	Valid
)

type Validator

type Validator interface {
	Validate(s string) ValidationStatus
}

type WebView

type WebView struct {
	WidgetBase
	// contains filtered or unexported fields
}

func NewWebView

func NewWebView(parent Container) (*WebView, error)

func (*WebView) Dispose

func (wv *WebView) Dispose()

func (*WebView) LayoutFlags

func (*WebView) LayoutFlags() LayoutFlags

func (*WebView) SetURL

func (wv *WebView) SetURL(url string) error

func (*WebView) SizeHint

func (*WebView) SizeHint() Size

func (*WebView) URL

func (wv *WebView) URL() (url string, err error)

type Widget

type Widget interface {
	// Background returns the background Brush of the Widget.
	//
	// By default this is nil.
	Background() Brush

	// BaseWidget returns a *WidgetBase, a pointer to an instance of the struct
	// that implements most operations common to all widgets.
	BaseWidget() *WidgetBase

	// Bounds returns the outer bounding box Rectangle of the Widget, including
	// decorations.
	//
	// For a RootWidget, like *MainWindow or *Dialog, the Rectangle is in screen
	// coordinates, for a child Widget the coordinates are relative to its
	// parent.
	Bounds() Rectangle

	// BringToTop moves the Widget to the top of the keyboard focus order.
	BringToTop() error

	// ClientBounds returns the inner bounding box Rectangle of the Widget,
	// excluding decorations.
	ClientBounds() Rectangle

	// ContextMenu returns the context menu of the Widget.
	//
	// By default this is nil.
	ContextMenu() *Menu

	// CreateCanvas creates and returns a *Canvas that can be used to draw
	// inside the ClientBounds of the Widget.
	//
	// Remember to call the Dispose method on the canvas to release resources,
	// when you no longer need it.
	CreateCanvas() (*Canvas, error)

	// Cursor returns the Cursor of the Widget.
	//
	// By default this is nil.
	Cursor() Cursor

	// Dispose releases the operating system resources, associated with the
	// Widget.
	//
	// If a user closes a *MainWindow or *Dialog, it is automatically released.
	// Also, if a Container is disposed of, all its descendants will be released
	// as well.
	Dispose()

	// Enabled returns if the Widget is enabled for user interaction.
	Enabled() bool

	// Font returns the *Font of the Widget.
	//
	// By default this is a MS Shell Dlg 2, 8 point font.
	Font() *Font

	// Height returns the outer height of the Widget, including decorations.
	Height() int

	// Invalidate schedules a full repaint of the Widget.
	Invalidate() error

	// IsDisposed returns if the Widget has been disposed of.
	IsDisposed() bool

	// KeyDown returns a *KeyEvent that you can attach to for handling key down
	// events for the Widget.
	KeyDown() *KeyEvent

	// LayoutFlags returns a combination of LayoutFlags that specify how the
	// Widget wants to be treated by Layout implementations.
	LayoutFlags() LayoutFlags

	// MaxSize returns the maximum allowed outer Size for the Widget, including
	// decorations.
	//
	// For child widgets, this is only relevant when the parent of the Widget
	// has a Layout. RootWidgets, like *MainWindow and *Dialog, also honor this.
	MaxSize() Size

	// MinSize returns the minimum allowed outer Size for the Widget, including
	// decorations.
	//
	// For child widgets, this is only relevant when the parent of the Widget
	// has a Layout. RootWidgets, like *MainWindow and *Dialog, also honor this.
	MinSize() Size

	// MinSizeHint returns the minimum outer Size, including decorations, that
	// makes sense for the respective type of Widget.
	MinSizeHint() Size

	// MouseDown returns a *MouseEvent that you can attach to for handling
	// mouse down events for the Widget.
	MouseDown() *MouseEvent

	// MouseMove returns a *MouseEvent that you can attach to for handling
	// mouse move events for the Widget.
	MouseMove() *MouseEvent

	// MouseUp returns a *MouseEvent that you can attach to for handling
	// mouse up events for the Widget.
	MouseUp() *MouseEvent

	// Name returns the name of the Widget.
	Name() string

	// Parent returns the Container of the Widget.
	//
	// For RootWidgets, like *MainWindow and *Dialog, this is always nil.
	Parent() Container

	// RootWidget returns the root of the UI hierarchy of the Widget, which is
	// usually a *MainWindow or *Dialog.
	RootWidget() RootWidget

	// SetBackground sets the background Brush of the Widget.
	SetBackground(value Brush)

	// SetBounds sets the outer bounding box Rectangle of the Widget, including
	// decorations.
	//
	// For a RootWidget, like *MainWindow or *Dialog, the Rectangle is in screen
	// coordinates, for a child Widget the coordinates are relative to its
	// parent.
	SetBounds(value Rectangle) error

	// SetClientSize sets the Size of the inner bounding box of the Widget,
	// excluding decorations.
	SetClientSize(value Size) error

	// SetContextMenu sets the context menu of the Widget.
	SetContextMenu(value *Menu)

	// SetCursor sets the Cursor of the Widget.
	SetCursor(value Cursor)

	// SetEnabled sets if the Widget is enabled for user interaction.
	SetEnabled(value bool)

	// SetFocus sets the keyboard input focus to the Widget.
	SetFocus() error

	// SetFont sets the *Font of the Widget.
	SetFont(value *Font)

	// SetHeight sets the outer height of the Widget, including decorations.
	SetHeight(value int) error

	// SetMinMaxSize sets the minimum and maximum outer Size of the Widget,
	// including decorations.
	//
	// Use walk.Size{} to make the respective limit be ignored.
	SetMinMaxSize(min, max Size) error

	// SetName sets the name of the Widget.
	//
	// This is important if you want to make use of the built-in UI persistence.
	// Some widgets support automatic state persistence. See Settings for
	// details.
	SetName(name string)

	// SetParent sets the parent of the Widget and adds the Widget to the
	// Children list of the Container.
	SetParent(value Container) error

	// SetSize sets the outer Size of the Widget, including decorations.
	SetSize(value Size) error

	// SetSuspended sets if the Widget is suspended for layout and repainting
	// purposes.
	//
	// You should call SetSuspended(true), before doing a batch of modifications
	// that would cause multiple layout or drawing updates. Remember to call
	// SetSuspended(false) afterwards, which will update the Widget accordingly.
	SetSuspended(suspend bool)

	// SetVisible sets if the Widget is visible.
	SetVisible(value bool)

	// SetWidth sets the outer width of the Widget, including decorations.
	SetWidth(value int) error

	// SetX sets the x coordinate of the Widget, relative to the screen for
	// RootWidgets like *MainWindow or *Dialog and relative to the parent for
	// child Widgets.
	SetX(value int) error

	// SetY sets the y coordinate of the Widget, relative to the screen for
	// RootWidgets like *MainWindow or *Dialog and relative to the parent for
	// child Widgets.
	SetY(value int) error

	// Size returns the outer Size of the Widget, including decorations.
	Size() Size

	// SizeChanged returns an *Event that you can attach to for handling size
	// changed events for the Widget.
	SizeChanged() *Event

	// SizeHint returns the preferred Size for the respective type of Widget.
	SizeHint() Size

	// Suspended returns if the Widget is suspended for layout and repainting
	// purposes.
	Suspended() bool

	// Synchronize enqueues func f to be called some time later by the main
	// goroutine from inside a message loop.
	Synchronize(f func())

	// Visible returns if the Widget is visible.
	Visible() bool

	// Width returns the outer width of the Widget, including decorations.
	Width() int

	// X returns the x coordinate of the Widget, relative to the screen for
	// RootWidgets like *MainWindow or *Dialog and relative to the parent for
	// child Widgets.
	X() int

	// Y returns the y coordinate of the Widget, relative to the screen for
	// RootWidgets like *MainWindow or *Dialog and relative to the parent for
	// child Widgets.
	Y() int
}

Widget is an interface that provides operations common to all widgets.

type WidgetBase

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

WidgetBase implements many operations common to all Widgets.

func (*WidgetBase) Background

func (wb *WidgetBase) Background() Brush

Background returns the background Brush of the *WidgetBase.

By default this is nil.

func (*WidgetBase) BaseWidget

func (wb *WidgetBase) BaseWidget() *WidgetBase

BaseWidget simply returns the receiver.

func (*WidgetBase) Bounds

func (wb *WidgetBase) Bounds() Rectangle

Bounds returns the outer bounding box Rectangle of the *WidgetBase, including decorations.

For a RootWidget, like *MainWindow or *Dialog, the Rectangle is in screen coordinates, for a child Widget the coordinates are relative to its parent.

func (*WidgetBase) BringToTop

func (wb *WidgetBase) BringToTop() error

BringToTop moves the *WidgetBase to the top of the keyboard focus order.

func (*WidgetBase) ClientBounds

func (wb *WidgetBase) ClientBounds() Rectangle

ClientBounds returns the inner bounding box Rectangle of the *WidgetBase, excluding decorations.

func (*WidgetBase) ContextMenu

func (wb *WidgetBase) ContextMenu() *Menu

ContextMenu returns the context menu of the *WidgetBase.

By default this is nil.

func (*WidgetBase) CreateCanvas

func (wb *WidgetBase) CreateCanvas() (*Canvas, error)

CreateCanvas creates and returns a *Canvas that can be used to draw inside the ClientBounds of the *WidgetBase.

Remember to call the Dispose method on the canvas to release resources, when you no longer need it.

func (*WidgetBase) Cursor

func (wb *WidgetBase) Cursor() Cursor

Cursor returns the Cursor of the *WidgetBase.

By default this is nil.

func (*WidgetBase) Dispose

func (wb *WidgetBase) Dispose()

Dispose releases the operating system resources, associated with the *WidgetBase.

If a user closes a *MainWindow or *Dialog, it is automatically released. Also, if a Container is disposed of, all its descendants will be released as well.

func (*WidgetBase) Enabled

func (wb *WidgetBase) Enabled() bool

Enabled returns if the *WidgetBase is enabled for user interaction.

func (*WidgetBase) Font

func (wb *WidgetBase) Font() *Font

Font returns the *Font of the *WidgetBase.

By default this is a MS Shell Dlg 2, 8 point font.

func (*WidgetBase) Height

func (wb *WidgetBase) Height() int

Height returns the outer height of the *WidgetBase, including decorations.

func (*WidgetBase) Invalidate

func (wb *WidgetBase) Invalidate() error

Invalidate schedules a full repaint of the *WidgetBase.

func (*WidgetBase) IsDisposed

func (wb *WidgetBase) IsDisposed() bool

IsDisposed returns if the *WidgetBase has been disposed of.

func (*WidgetBase) KeyDown

func (wb *WidgetBase) KeyDown() *KeyEvent

KeyDown returns a *KeyEvent that you can attach to for handling key down events for the *WidgetBase.

func (*WidgetBase) LayoutFlags

func (wb *WidgetBase) LayoutFlags() LayoutFlags

LayoutFlags returns a combination of LayoutFlags that specify how the *WidgetBase wants to be treated by Layout implementations.

func (*WidgetBase) MaxSize

func (wb *WidgetBase) MaxSize() Size

MaxSize returns the maximum allowed outer Size for the *WidgetBase, including decorations.

For child widgets, this is only relevant when the parent of the *WidgetBase has a Layout. RootWidgets, like *MainWindow and *Dialog, also honor this.

func (*WidgetBase) MinSize

func (wb *WidgetBase) MinSize() Size

MinSize returns the minimum allowed outer Size for the *WidgetBase, including decorations.

For child widgets, this is only relevant when the parent of the *WidgetBase has a Layout. RootWidgets, like *MainWindow and *Dialog, also honor this.

func (*WidgetBase) MinSizeHint

func (wb *WidgetBase) MinSizeHint() Size

MinSizeHint returns the minimum outer Size, including decorations, that makes sense for the respective type of Widget.

func (*WidgetBase) MouseDown

func (wb *WidgetBase) MouseDown() *MouseEvent

MouseDown returns a *MouseEvent that you can attach to for handling mouse down events for the *WidgetBase.

func (*WidgetBase) MouseMove

func (wb *WidgetBase) MouseMove() *MouseEvent

MouseMove returns a *MouseEvent that you can attach to for handling mouse move events for the *WidgetBase.

func (*WidgetBase) MouseUp

func (wb *WidgetBase) MouseUp() *MouseEvent

MouseUp returns a *MouseEvent that you can attach to for handling mouse up events for the *WidgetBase.

func (*WidgetBase) Name

func (wb *WidgetBase) Name() string

Name returns the name of the *WidgetBase.

func (*WidgetBase) Parent

func (wb *WidgetBase) Parent() Container

Parent returns the Container of the *WidgetBase.

For RootWidgets, like *MainWindow and *Dialog, this is always nil.

func (*WidgetBase) RootWidget

func (wb *WidgetBase) RootWidget() RootWidget

RootWidget returns the root of the UI hierarchy of the *WidgetBase, which is usually a *MainWindow or *Dialog.

func (*WidgetBase) SetBackground

func (wb *WidgetBase) SetBackground(value Brush)

SetBackground sets the background Brush of the *WidgetBase.

func (*WidgetBase) SetBounds

func (wb *WidgetBase) SetBounds(bounds Rectangle) error

SetBounds returns the outer bounding box Rectangle of the *WidgetBase, including decorations.

For a RootWidget, like *MainWindow or *Dialog, the Rectangle is in screen coordinates, for a child Widget the coordinates are relative to its parent.

func (*WidgetBase) SetClientSize

func (wb *WidgetBase) SetClientSize(value Size) error

SetClientSize sets the Size of the inner bounding box of the *WidgetBase, excluding decorations.

func (*WidgetBase) SetContextMenu

func (wb *WidgetBase) SetContextMenu(value *Menu)

SetContextMenu sets the context menu of the *WidgetBase.

func (*WidgetBase) SetCursor

func (wb *WidgetBase) SetCursor(value Cursor)

SetCursor sets the Cursor of the *WidgetBase.

func (*WidgetBase) SetEnabled

func (wb *WidgetBase) SetEnabled(value bool)

SetEnabled sets if the *WidgetBase is enabled for user interaction.

func (*WidgetBase) SetFocus

func (wb *WidgetBase) SetFocus() error

SetFocus sets the keyboard input focus to the *WidgetBase.

func (*WidgetBase) SetFont

func (wb *WidgetBase) SetFont(value *Font)

SetFont sets the *Font of the *WidgetBase.

func (*WidgetBase) SetHeight

func (wb *WidgetBase) SetHeight(value int) error

SetHeight sets the outer height of the *WidgetBase, including decorations.

func (*WidgetBase) SetMinMaxSize

func (wb *WidgetBase) SetMinMaxSize(min, max Size) error

SetMinMaxSize sets the minimum and maximum outer Size of the *WidgetBase, including decorations.

Use walk.Size{} to make the respective limit be ignored.

func (*WidgetBase) SetName

func (wb *WidgetBase) SetName(name string)

SetName sets the name of the *WidgetBase.

func (*WidgetBase) SetParent

func (wb *WidgetBase) SetParent(value Container) (err error)

SetParent sets the parent of the *WidgetBase and adds the *WidgetBase to the Children list of the Container.

func (*WidgetBase) SetSize

func (wb *WidgetBase) SetSize(size Size) error

SetSize sets the outer Size of the *WidgetBase, including decorations.

func (*WidgetBase) SetSuspended

func (wb *WidgetBase) SetSuspended(suspend bool)

SetSuspended sets if the *WidgetBase is suspended for layout and repainting purposes.

You should call SetSuspended(true), before doing a batch of modifications that would cause multiple layout or drawing updates. Remember to call SetSuspended(false) afterwards, which will update the *WidgetBase accordingly.

func (*WidgetBase) SetVisible

func (wb *WidgetBase) SetVisible(visible bool)

SetVisible sets if the *WidgetBase is visible.

func (*WidgetBase) SetWidth

func (wb *WidgetBase) SetWidth(value int) error

SetWidth sets the outer width of the *WidgetBase, including decorations.

func (*WidgetBase) SetX

func (wb *WidgetBase) SetX(value int) error

SetX sets the x coordinate of the *WidgetBase, relative to the screen for RootWidgets like *MainWindow or *Dialog and relative to the parent for child Widgets.

func (*WidgetBase) SetY

func (wb *WidgetBase) SetY(value int) error

SetY sets the y coordinate of the *WidgetBase, relative to the screen for RootWidgets like *MainWindow or *Dialog and relative to the parent for child Widgets.

func (*WidgetBase) Size

func (wb *WidgetBase) Size() Size

Size returns the outer Size of the *WidgetBase, including decorations.

func (*WidgetBase) SizeChanged

func (wb *WidgetBase) SizeChanged() *Event

SizeChanged returns an *Event that you can attach to for handling size changed events for the *WidgetBase.

func (*WidgetBase) SizeHint

func (wb *WidgetBase) SizeHint() Size

SizeHint returns a default Size that should be "overidden" by a concrete Widget type.

func (*WidgetBase) Suspended

func (wb *WidgetBase) Suspended() bool

Suspended returns if the *WidgetBase is suspended for layout and repainting purposes.

func (*WidgetBase) Synchronize

func (wb *WidgetBase) Synchronize(f func())

Synchronize enqueues func f to be called some time later by the main goroutine from inside a message loop.

func (*WidgetBase) Visible

func (wb *WidgetBase) Visible() bool

Visible returns if the *WidgetBase is visible.

func (*WidgetBase) Width

func (wb *WidgetBase) Width() int

Width returns the outer width of the *WidgetBase, including decorations.

func (*WidgetBase) X

func (wb *WidgetBase) X() int

X returns the x coordinate of the *WidgetBase, relative to the screen for RootWidgets like *MainWindow or *Dialog and relative to the parent for child Widgets.

func (*WidgetBase) Y

func (wb *WidgetBase) Y() int

Y returns the y coordinate of the *WidgetBase, relative to the screen for RootWidgets like *MainWindow or *Dialog and relative to the parent for child Widgets.

type WidgetList

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

func (*WidgetList) Add

func (l *WidgetList) Add(item Widget) error

func (*WidgetList) At

func (l *WidgetList) At(index int) Widget

func (*WidgetList) Clear

func (l *WidgetList) Clear() error

func (*WidgetList) Contains

func (l *WidgetList) Contains(item Widget) bool

func (*WidgetList) Index

func (l *WidgetList) Index(item Widget) int

func (*WidgetList) Insert

func (l *WidgetList) Insert(index int, item Widget) error

func (*WidgetList) Len

func (l *WidgetList) Len() int

func (*WidgetList) Remove

func (l *WidgetList) Remove(item Widget) error

func (*WidgetList) RemoveAt

func (l *WidgetList) RemoveAt(index int) error

Directories

Path Synopsis
examples
tools

Jump to

Keyboard shortcuts

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