walk

package module
Version: v0.0.0-...-f2100e7 Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2013 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 primarily useful for Desktop GUI development, but there is some more stuff.

Setup
=====

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

##### Note
`Go 1.0.x` doesn't work with walk anymore, Make sure you use `Go 1.1.x`

##### To Install
Now run `go get github.com/lxn/walk`

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

The preferred way to create GUIs with Walk is to use its declarative sub package,
as illustrated in this small example:

##### `test.go`

```go
package main

import (
	"github.com/lxn/walk"
	. "github.com/lxn/walk/declarative"
	"strings"
)

func main() {
	var inTE, outTE *walk.TextEdit

	MainWindow{
		Title:   "SCREAMO",
		MinSize: Size{600, 400},
		Layout:  VBox{},
		Children: []Widget{
			HSplitter{
				Children: []Widget{
					TextEdit{AssignTo: &inTE},
					TextEdit{AssignTo: &outTE, ReadOnly: true},
				},
			},
			PushButton{
				Text: "SCREAM",
				OnClicked: func() {
					outTE.SetText(strings.ToUpper(inTE.Text()))
				},
			},
		},
	}.Run()
}
```

##### Build app

In the directory containing `test.go` run

	go build
	
To get rid of the cmd window, instead run

	go build -ldflags="-H windowsgui"

##### Create Manifest `test.exe.manifest`

```xml
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
        <assemblyIdentity version="1.0.0.0" processorArchitecture="*" name="SomeFunkyNameHere" type="win32"/>
        <dependency>
            <dependentAssembly>
                <assemblyIdentity type="win32" name="Microsoft.Windows.Common-Controls" version="6.0.0.0" processorArchitecture="*" publicKeyToken="6595b64144ccf1df" language="*"/>
            </dependentAssembly>
        </dependency>
    </assembly>
```

##### Run app
	
	test.exe
	
##### Sample Output (Windows 7)

![alt tag](http://i.imgur.com/lUrgE2Q.png)

##### More Examples
There are some [examples](examples) that should get you started.

Application Manifest Files
==========================
Walk requires Common Controls 6. This means that you must put an appropriate
application manifest file either next to your executable or embedded as a
resource.

You can copy one of the application manifest files that come with the examples.

IMPORTANT: Do not launch your executable before the manifest file is in place.
If you do anyway, the program will not run properly. And worse, Windows will not
recognize a manifest file, you later drop next to the executable. To fix this,
rebuild your executable and only launch it with a manifest file in place.

Documentation

Index

Constants

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

Variables

View Source
var (
	ErrPropertyReadOnly       = errors.New("read-only property")
	ErrPropertyNotValidatable = errors.New("property not validatable")
)

Functions

func AltDown

func AltDown() bool

func AppDataPath

func AppDataPath() (string, error)

func CommonAppDataPath

func CommonAppDataPath() (string, error)

func ControlDown

func ControlDown() bool

func DriveNames

func DriveNames() ([]string, error)

func FormatFloat

func FormatFloat(f float64, prec int) string

func FormatFloatGrouped

func FormatFloatGrouped(f float64, prec int) string

func InitWidget

func InitWidget(widget Widget, parent Window, className string, style, exStyle uint32) error

InitWidget initializes a Widget.

func InitWindow

func InitWindow(window, parent Window, className string, style, exStyle uint32) error

InitWindow initializes a window.

Widgets should be initialized using InitWidget instead.

func InitWrapperWindow

func InitWrapperWindow(window Window) error

InitWrapperWindow initializes a window that wraps (embeds) another window.

Calling this method is necessary, if you want to be able to override the WndProc method of the embedded window. The embedded window should only be used as inseparable part of the wrapper window to avoid undefined behavior.

func LocalAppDataPath

func LocalAppDataPath() (string, error)

func LogErrors

func LogErrors() bool

func MsgBox

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

func MustRegisterWindowClass

func MustRegisterWindowClass(className string)

MustRegisterWindowClass registers the specified window class.

MustRegisterWindowClass must be called once for every window type that is not based on any system provided control, before calling InitChildWidget or InitWidget. Calling MustRegisterWindowClass twice with the same className results in a panic.

func PanicOnError

func PanicOnError() bool

func ParseFloat

func ParseFloat(s string) (float64, error)

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 SetLogErrors

func SetLogErrors(v bool)

func SetPanicOnError

func SetPanicOnError(v bool)

func SetTranslationFunc

func SetTranslationFunc(f TranslationFunction)

func ShiftDown

func ShiftDown() bool

Types

type Action

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

func NewAction

func NewAction() *Action

func NewMenuAction

func NewMenuAction(menu *Menu) *Action

func NewSeparatorAction

func NewSeparatorAction() *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) EnabledCondition

func (a *Action) EnabledCondition() Condition

func (*Action) Exclusive

func (a *Action) Exclusive() bool

func (*Action) Image

func (a *Action) Image() *Bitmap

func (*Action) IsSeparator

func (a *Action) IsSeparator() bool

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

func (a *Action) SetEnabledCondition(c Condition)

func (*Action) SetExclusive

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

func (*Action) SetImage

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

func (*Action) SetShortcut

func (a *Action) SetShortcut(shortcut Shortcut) (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) SetVisibleCondition

func (a *Action) SetVisibleCondition(c Condition)

func (*Action) Shortcut

func (a *Action) Shortcut() Shortcut

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

func (*Action) VisibleCondition

func (a *Action) VisibleCondition() Condition

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 BindingValueProvider

type BindingValueProvider interface {
	BindingValue(index int) interface{}
}

BindingValueProvider is the interface that a model must implement to support data binding with widgets like ComboBox.

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 NewBitmapFromImage

func NewBitmapFromImage(im image.Image) (*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) CheckedChanged

func (b *Button) CheckedChanged() *Event

func (*Button) Clicked

func (b *Button) Clicked() *Event

func (*Button) SetChecked

func (b *Button) SetChecked(checked bool)

func (*Button) SetText

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

func (*Button) Text

func (b *Button) Text() string

func (*Button) WndProc

func (b *Button) WndProc(hwnd win.HWND, msg uint32, wParam, lParam uintptr) uintptr

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

func (*CheckBox) WndProc

func (cb *CheckBox) WndProc(hwnd win.HWND, msg uint32, wParam, lParam uintptr) uintptr

type ClipboardService

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

ClipboardService provides access to the system clipboard.

func Clipboard

func Clipboard() *ClipboardService

Clipboard returns an object that provides access to the system clipboard.

func (*ClipboardService) Clear

func (c *ClipboardService) Clear() error

Clear clears the contents of the clipboard.

func (*ClipboardService) ContainsText

func (c *ClipboardService) ContainsText() (available bool, err error)

ContainsText returns whether the clipboard currently contains text data.

func (*ClipboardService) SetText

func (c *ClipboardService) SetText(s string) error

SetText sets the current text data of the clipboard.

func (*ClipboardService) Text

func (c *ClipboardService) Text() (text string, err error)

Text returns the current text data of the clipboard.

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 byte
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 NewDropDownBox

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

func (*ComboBox) BindingMember

func (cb *ComboBox) BindingMember() string

BindingMember returns the member from the model of the ComboBox that is bound to a field of the data source managed by an associated DataBinder.

This is only applicable to walk.ReflectListModel models and simple slices of pointers to struct.

func (*ComboBox) CurrentIndex

func (cb *ComboBox) CurrentIndex() int

func (*ComboBox) CurrentIndexChanged

func (cb *ComboBox) CurrentIndexChanged() *Event

func (*ComboBox) DisplayMember

func (cb *ComboBox) DisplayMember() string

DisplayMember returns the member from the model of the ComboBox that is displayed in the ComboBox.

This is only applicable to walk.ReflectListModel models and simple slices of pointers to struct.

func (*ComboBox) Editable

func (cb *ComboBox) Editable() bool

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() interface{}

Model returns the model of the ComboBox.

func (*ComboBox) Precision

func (cb *ComboBox) Precision() int

func (*ComboBox) SetBindingMember

func (cb *ComboBox) SetBindingMember(bindingMember string) error

SetBindingMember sets the member from the model of the ComboBox that is bound to a field of the data source managed by an associated DataBinder.

This is only applicable to walk.ReflectListModel models and simple slices of pointers to struct.

For a model consisting of items of type S, data source field of type T and bindingMember "Foo", this can be one of the following:

A field		Foo T
A method	func (s S) Foo() T
A method	func (s S) Foo() (T, error)

If bindingMember is not a simple member name like "Foo", but a path to a member like "A.B.Foo", members "A" and "B" both must be one of the options mentioned above, but with T having type pointer to struct.

func (*ComboBox) SetCurrentIndex

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

func (*ComboBox) SetDisplayMember

func (cb *ComboBox) SetDisplayMember(displayMember string) error

SetDisplayMember sets the member from the model of the ComboBox that is displayed in the ComboBox.

This is only applicable to walk.ReflectListModel models and simple slices of pointers to struct.

For a model consisting of items of type S, the type of the specified member T and displayMember "Foo", this can be one of the following:

A field		Foo T
A method	func (s S) Foo() T
A method	func (s S) Foo() (T, error)

If displayMember is not a simple member name like "Foo", but a path to a member like "A.B.Foo", members "A" and "B" both must be one of the options mentioned above, but with T having type pointer to struct.

func (*ComboBox) SetFormat

func (cb *ComboBox) SetFormat(value string)

func (*ComboBox) SetModel

func (cb *ComboBox) SetModel(mdl interface{}) error

SetModel sets the model of the ComboBox.

It is required that mdl either implements walk.ListModel or walk.ReflectListModel or be a slice of pointers to struct or a []string.

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)

func (*ComboBox) WndProc

func (cb *ComboBox) WndProc(hwnd win.HWND, msg uint32, wParam, lParam uintptr) uintptr

type Composite

type Composite struct {
	ContainerBase
}

func NewComposite

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

type Condition

type Condition interface {
	Satisfied() bool
	Changed() *Event
}

func NewAllCondition

func NewAllCondition(items ...Condition) Condition

func NewAnyCondition

func NewAnyCondition(items ...Condition) Condition

type Container

type Container interface {
	Window
	AsContainerBase() *ContainerBase
	Children() *WidgetList
	Layout() Layout
	SetLayout(value Layout) error
	DataBinder() *DataBinder
	SetDataBinder(dbm *DataBinder)
}

type ContainerBase

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

func (*ContainerBase) AsContainerBase

func (cb *ContainerBase) AsContainerBase() *ContainerBase

func (*ContainerBase) AsWidgetBase

func (cb *ContainerBase) AsWidgetBase() *WidgetBase

func (*ContainerBase) Children

func (cb *ContainerBase) Children() *WidgetList

func (*ContainerBase) DataBinder

func (cb *ContainerBase) DataBinder() *DataBinder

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

func (cb *ContainerBase) SetDataBinder(db *DataBinder)

func (*ContainerBase) SetEnabled

func (cb *ContainerBase) SetEnabled(enabled bool)

func (*ContainerBase) SetFont

func (cb *ContainerBase) SetFont(f *Font)

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

func (*ContainerBase) WndProc

func (cb *ContainerBase) WndProc(hwnd win.HWND, msg uint32, wParam, lParam uintptr) uintptr

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

func NewCursorFromImage

func NewCursorFromImage(im image.Image, hotspot image.Point) (Cursor, error)

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

func (*CustomWidget) WndProc

func (cw *CustomWidget) WndProc(hwnd win.HWND, msg uint32, wParam, lParam uintptr) uintptr

type DataBinder

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

func NewDataBinder

func NewDataBinder() *DataBinder

func (*DataBinder) AutoSubmit

func (db *DataBinder) AutoSubmit() bool

func (*DataBinder) BoundWidgets

func (db *DataBinder) BoundWidgets() []Widget

func (*DataBinder) CanSubmit

func (db *DataBinder) CanSubmit() bool

func (*DataBinder) CanSubmitChanged

func (db *DataBinder) CanSubmitChanged() *Event

func (*DataBinder) DataSource

func (db *DataBinder) DataSource() interface{}

func (*DataBinder) ErrorPresenter

func (db *DataBinder) ErrorPresenter() ErrorPresenter

func (*DataBinder) Reset

func (db *DataBinder) Reset() error

func (*DataBinder) SetAutoSubmit

func (db *DataBinder) SetAutoSubmit(autoSubmit bool)

func (*DataBinder) SetBoundWidgets

func (db *DataBinder) SetBoundWidgets(boundWidgets []Widget)

func (*DataBinder) SetDataSource

func (db *DataBinder) SetDataSource(dataSource interface{}) error

func (*DataBinder) SetErrorPresenter

func (db *DataBinder) SetErrorPresenter(ep ErrorPresenter)

func (*DataBinder) Submit

func (db *DataBinder) Submit() error

func (*DataBinder) Submitted

func (db *DataBinder) Submitted() *Event

type DateEdit

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

func NewDateEdit

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

func NewDateEditWithNoneOption

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

func (*DateEdit) Date

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

func (*DateEdit) DateChanged

func (de *DateEdit) DateChanged() *Event

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

func (de *DateEdit) SetDate(date time.Time) error

func (*DateEdit) SetRange

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

func (*DateEdit) SizeHint

func (de *DateEdit) SizeHint() Size

func (*DateEdit) WndProc

func (de *DateEdit) WndProc(hwnd win.HWND, msg uint32, wParam, lParam uintptr) uintptr

type DelegateCondition

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

func NewDelegateCondition

func NewDelegateCondition(satisfied func() bool, changed *Event) *DelegateCondition

func (*DelegateCondition) Changed

func (dc *DelegateCondition) Changed() *Event

func (*DelegateCondition) Satisfied

func (dc *DelegateCondition) Satisfied() bool

type Dialog

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

func NewDialog

func NewDialog(owner Form) (*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) Result

func (dlg *Dialog) Result() int

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 Disposable

type Disposable interface {
	Dispose()
}

type Disposables

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

func (*Disposables) Add

func (d *Disposables) Add(item Disposable)

func (*Disposables) Spare

func (d *Disposables) Spare()

func (*Disposables) Treat

func (d *Disposables) Treat()

type DrawTextFormat

type DrawTextFormat uint

DrawText format flags

const (
	TextTop                  DrawTextFormat = win.DT_TOP
	TextLeft                 DrawTextFormat = win.DT_LEFT
	TextCenter               DrawTextFormat = win.DT_CENTER
	TextRight                DrawTextFormat = win.DT_RIGHT
	TextVCenter              DrawTextFormat = win.DT_VCENTER
	TextBottom               DrawTextFormat = win.DT_BOTTOM
	TextWordbreak            DrawTextFormat = win.DT_WORDBREAK
	TextSingleLine           DrawTextFormat = win.DT_SINGLELINE
	TextExpandTabs           DrawTextFormat = win.DT_EXPANDTABS
	TextTabstop              DrawTextFormat = win.DT_TABSTOP
	TextNoClip               DrawTextFormat = win.DT_NOCLIP
	TextExternalLeading      DrawTextFormat = win.DT_EXTERNALLEADING
	TextCalcRect             DrawTextFormat = win.DT_CALCRECT
	TextNoPrefix             DrawTextFormat = win.DT_NOPREFIX
	TextInternal             DrawTextFormat = win.DT_INTERNAL
	TextEditControl          DrawTextFormat = win.DT_EDITCONTROL
	TextPathEllipsis         DrawTextFormat = win.DT_PATH_ELLIPSIS
	TextEndEllipsis          DrawTextFormat = win.DT_END_ELLIPSIS
	TextModifyString         DrawTextFormat = win.DT_MODIFYSTRING
	TextRTLReading           DrawTextFormat = win.DT_RTLREADING
	TextWordEllipsis         DrawTextFormat = win.DT_WORD_ELLIPSIS
	TextNoFullWidthCharBreak DrawTextFormat = win.DT_NOFULLWIDTHCHARBREAK
	TextHidePrefix           DrawTextFormat = win.DT_HIDEPREFIX
	TextPrefixOnly           DrawTextFormat = win.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 ErrorPresenter

type ErrorPresenter interface {
	PresentError(err error, widget Widget)
}

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

func (dlg *FileDialog) ShowBrowseFolder(owner Form) (accepted bool, err error)

func (*FileDialog) ShowOpen

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

func (*FileDialog) ShowSave

func (dlg *FileDialog) ShowSave(owner Form) (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 Form

type Form interface {
	Container
	AsFormBase() *FormBase
	Run() int
}

type FormBase

type FormBase struct {
	WindowBase
	// contains filtered or unexported fields
}

func (*FormBase) AsContainerBase

func (fb *FormBase) AsContainerBase() *ContainerBase

func (*FormBase) AsFormBase

func (fb *FormBase) AsFormBase() *FormBase

func (*FormBase) Children

func (fb *FormBase) Children() *WidgetList

func (*FormBase) Close

func (fb *FormBase) Close() error

func (*FormBase) Closing

func (fb *FormBase) Closing() *CloseEvent

func (*FormBase) ContextMenu

func (fb *FormBase) ContextMenu() *Menu

func (*FormBase) DataBinder

func (fb *FormBase) DataBinder() *DataBinder

func (*FormBase) Enabled

func (fb *FormBase) Enabled() bool

func (*FormBase) Font

func (fb *FormBase) Font() *Font

func (*FormBase) Hide

func (fb *FormBase) Hide()

func (*FormBase) Icon

func (fb *FormBase) Icon() *Icon

func (*FormBase) Layout

func (fb *FormBase) Layout() Layout

func (*FormBase) LayoutFlags

func (fb *FormBase) LayoutFlags() LayoutFlags

func (*FormBase) Owner

func (fb *FormBase) Owner() Form

func (*FormBase) Persistent

func (fb *FormBase) Persistent() bool

func (*FormBase) ProgressIndicator

func (fb *FormBase) ProgressIndicator() *ProgressIndicator

func (*FormBase) RestoreState

func (fb *FormBase) RestoreState() error

func (*FormBase) Run

func (fb *FormBase) Run() int

func (*FormBase) SaveState

func (fb *FormBase) SaveState() error

func (*FormBase) SetContextMenu

func (fb *FormBase) SetContextMenu(contextMenu *Menu)

func (*FormBase) SetDataBinder

func (fb *FormBase) SetDataBinder(db *DataBinder)

func (*FormBase) SetEnabled

func (fb *FormBase) SetEnabled(enabled bool)

func (*FormBase) SetIcon

func (fb *FormBase) SetIcon(icon *Icon)

func (*FormBase) SetLayout

func (fb *FormBase) SetLayout(value Layout) error

func (*FormBase) SetOwner

func (fb *FormBase) SetOwner(value Form) error

func (*FormBase) SetPersistent

func (fb *FormBase) SetPersistent(value bool)

func (*FormBase) SetSuspended

func (fb *FormBase) SetSuspended(suspended bool)

func (*FormBase) SetTitle

func (fb *FormBase) SetTitle(value string) error

func (*FormBase) Show

func (fb *FormBase) Show()

func (*FormBase) SizeHint

func (fb *FormBase) SizeHint() Size

func (*FormBase) Starting

func (fb *FormBase) Starting() *Event

func (*FormBase) Suspended

func (fb *FormBase) Suspended() bool

func (*FormBase) Title

func (fb *FormBase) Title() string

func (*FormBase) WndProc

func (fb *FormBase) WndProc(hwnd win.HWND, msg uint32, wParam, lParam uintptr) uintptr

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

func (gb *GroupBox) AsContainerBase() *ContainerBase

func (*GroupBox) Children

func (gb *GroupBox) Children() *WidgetList

func (*GroupBox) ClientBounds

func (gb *GroupBox) ClientBounds() Rectangle

func (*GroupBox) DataBinder

func (gb *GroupBox) DataBinder() *DataBinder

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

func (gb *GroupBox) SetDataBinder(dataBinder *DataBinder)

func (*GroupBox) SetFont

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

func (*GroupBox) SetLayout

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

func (*GroupBox) SetSuspended

func (gb *GroupBox) SetSuspended(suspend bool)

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

func (*GroupBox) WndProc

func (gb *GroupBox) WndProc(hwnd win.HWND, msg uint32, wParam, lParam uintptr) uintptr

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 = win.HS_HORIZONTAL
	HatchVertical         HatchStyle = win.HS_VERTICAL
	HatchForwardDiagonal  HatchStyle = win.HS_FDIAGONAL
	HatchBackwardDiagonal HatchStyle = win.HS_BDIAGONAL
	HatchCross            HatchStyle = win.HS_CROSS
	HatchDiagonalCross    HatchStyle = win.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 IconApplication

func IconApplication() *Icon

func IconError

func IconError() *Icon

func IconInformation

func IconInformation() *Icon

func IconQuestion

func IconQuestion() *Icon

func IconShield

func IconShield() *Icon

func IconWarning

func IconWarning() *Icon
func IconWinLogo() *Icon

func NewIconFromFile

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

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

func NewIconFromImage

func NewIconFromImage(im image.Image) (ic *Icon, err error)

func NewIconFromResource

func NewIconFromResource(resName string) (ic *Icon, err error)

NewIconFromResource returns a new Icon, using the specified icon resource.

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 ImageProvider

type ImageProvider interface {
	// Image returns the image to display for the item at index index.
	//
	// Supported types are *walk.Bitmap, *walk.Icon and string. A string will be
	// interpreted as a file path and the icon associated with the file will be
	// used. It is not supported to use strings together with the other options
	// in the same model instance.
	Image(index int) interface{}
}

ImageProvider is the interface that a model must implement to support displaying an item image.

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 Imager

type Imager interface {
	// Image returns the image to display for an item.
	//
	// Supported types are *walk.Bitmap, *walk.Icon and string. A string will be
	// interpreted as a file path and the icon associated with the file will be
	// used. It is not supported to use strings together with the other options
	// in the same model instance.
	Image() interface{}
}

Imager provides access to an image of objects like tree items.

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(fileName string) *IniFileSettings

func (*IniFileSettings) ExpireDuration

func (ifs *IniFileSettings) ExpireDuration() time.Duration

func (*IniFileSettings) FilePath

func (ifs *IniFileSettings) FilePath() string

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

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

func (*IniFileSettings) Remove

func (ifs *IniFileSettings) Remove(key string) error

func (*IniFileSettings) Save

func (ifs *IniFileSettings) Save() error

func (*IniFileSettings) SetExpireDuration

func (ifs *IniFileSettings) SetExpireDuration(expireDuration time.Duration)

func (*IniFileSettings) Timestamp

func (ifs *IniFileSettings) Timestamp(key string) (time.Time, 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 Key

type Key uint16
const (
	KeyLButton           Key = win.VK_LBUTTON
	KeyRButton           Key = win.VK_RBUTTON
	KeyCancel            Key = win.VK_CANCEL
	KeyMButton           Key = win.VK_MBUTTON
	KeyXButton1          Key = win.VK_XBUTTON1
	KeyXButton2          Key = win.VK_XBUTTON2
	KeyBack              Key = win.VK_BACK
	KeyTab               Key = win.VK_TAB
	KeyClear             Key = win.VK_CLEAR
	KeyReturn            Key = win.VK_RETURN
	KeyShift             Key = win.VK_SHIFT
	KeyControl           Key = win.VK_CONTROL
	KeyAlt               Key = win.VK_MENU
	KeyMenu              Key = win.VK_MENU
	KeyPause             Key = win.VK_PAUSE
	KeyCapital           Key = win.VK_CAPITAL
	KeyKana              Key = win.VK_KANA
	KeyHangul            Key = win.VK_HANGUL
	KeyJunja             Key = win.VK_JUNJA
	KeyFinal             Key = win.VK_FINAL
	KeyHanja             Key = win.VK_HANJA
	KeyKanji             Key = win.VK_KANJI
	KeyEscape            Key = win.VK_ESCAPE
	KeyConvert           Key = win.VK_CONVERT
	KeyNonconvert        Key = win.VK_NONCONVERT
	KeyAccept            Key = win.VK_ACCEPT
	KeyModeChange        Key = win.VK_MODECHANGE
	KeySpace             Key = win.VK_SPACE
	KeyPrior             Key = win.VK_PRIOR
	KeyNext              Key = win.VK_NEXT
	KeyEnd               Key = win.VK_END
	KeyHome              Key = win.VK_HOME
	KeyLeft              Key = win.VK_LEFT
	KeyUp                Key = win.VK_UP
	KeyRight             Key = win.VK_RIGHT
	KeyDown              Key = win.VK_DOWN
	KeySelect            Key = win.VK_SELECT
	KeyPrint             Key = win.VK_PRINT
	KeyExecute           Key = win.VK_EXECUTE
	KeySnapshot          Key = win.VK_SNAPSHOT
	KeyInsert            Key = win.VK_INSERT
	KeyDelete            Key = win.VK_DELETE
	KeyHelp              Key = win.VK_HELP
	Key0                 Key = 0x30
	Key1                 Key = 0x31
	Key2                 Key = 0x32
	Key3                 Key = 0x33
	Key4                 Key = 0x34
	Key5                 Key = 0x35
	Key6                 Key = 0x36
	Key7                 Key = 0x37
	Key8                 Key = 0x38
	Key9                 Key = 0x39
	KeyA                 Key = 0x41
	KeyB                 Key = 0x42
	KeyC                 Key = 0x43
	KeyD                 Key = 0x44
	KeyE                 Key = 0x45
	KeyF                 Key = 0x46
	KeyG                 Key = 0x47
	KeyH                 Key = 0x48
	KeyI                 Key = 0x49
	KeyJ                 Key = 0x4A
	KeyK                 Key = 0x4B
	KeyL                 Key = 0x4C
	KeyM                 Key = 0x4D
	KeyN                 Key = 0x4E
	KeyO                 Key = 0x4F
	KeyP                 Key = 0x50
	KeyQ                 Key = 0x51
	KeyR                 Key = 0x52
	KeyS                 Key = 0x53
	KeyT                 Key = 0x54
	KeyU                 Key = 0x55
	KeyV                 Key = 0x56
	KeyW                 Key = 0x57
	KeyX                 Key = 0x58
	KeyY                 Key = 0x59
	KeyZ                 Key = 0x5A
	KeyLWin              Key = win.VK_LWIN
	KeyRWin              Key = win.VK_RWIN
	KeyApps              Key = win.VK_APPS
	KeySleep             Key = win.VK_SLEEP
	KeyNumpad0           Key = win.VK_NUMPAD0
	KeyNumpad1           Key = win.VK_NUMPAD1
	KeyNumpad2           Key = win.VK_NUMPAD2
	KeyNumpad3           Key = win.VK_NUMPAD3
	KeyNumpad4           Key = win.VK_NUMPAD4
	KeyNumpad5           Key = win.VK_NUMPAD5
	KeyNumpad6           Key = win.VK_NUMPAD6
	KeyNumpad7           Key = win.VK_NUMPAD7
	KeyNumpad8           Key = win.VK_NUMPAD8
	KeyNumpad9           Key = win.VK_NUMPAD9
	KeyMultiply          Key = win.VK_MULTIPLY
	KeyAdd               Key = win.VK_ADD
	KeySeparator         Key = win.VK_SEPARATOR
	KeySubtract          Key = win.VK_SUBTRACT
	KeyDecimal           Key = win.VK_DECIMAL
	KeyDivide            Key = win.VK_DIVIDE
	KeyF1                Key = win.VK_F1
	KeyF2                Key = win.VK_F2
	KeyF3                Key = win.VK_F3
	KeyF4                Key = win.VK_F4
	KeyF5                Key = win.VK_F5
	KeyF6                Key = win.VK_F6
	KeyF7                Key = win.VK_F7
	KeyF8                Key = win.VK_F8
	KeyF9                Key = win.VK_F9
	KeyF10               Key = win.VK_F10
	KeyF11               Key = win.VK_F11
	KeyF12               Key = win.VK_F12
	KeyF13               Key = win.VK_F13
	KeyF14               Key = win.VK_F14
	KeyF15               Key = win.VK_F15
	KeyF16               Key = win.VK_F16
	KeyF17               Key = win.VK_F17
	KeyF18               Key = win.VK_F18
	KeyF19               Key = win.VK_F19
	KeyF20               Key = win.VK_F20
	KeyF21               Key = win.VK_F21
	KeyF22               Key = win.VK_F22
	KeyF23               Key = win.VK_F23
	KeyF24               Key = win.VK_F24
	KeyNumlock           Key = win.VK_NUMLOCK
	KeyScroll            Key = win.VK_SCROLL
	KeyLShift            Key = win.VK_LSHIFT
	KeyRShift            Key = win.VK_RSHIFT
	KeyLControl          Key = win.VK_LCONTROL
	KeyRControl          Key = win.VK_RCONTROL
	KeyLAlt              Key = win.VK_LMENU
	KeyLMenu             Key = win.VK_LMENU
	KeyRAlt              Key = win.VK_RMENU
	KeyRMenu             Key = win.VK_RMENU
	KeyBrowserBack       Key = win.VK_BROWSER_BACK
	KeyBrowserForward    Key = win.VK_BROWSER_FORWARD
	KeyBrowserRefresh    Key = win.VK_BROWSER_REFRESH
	KeyBrowserStop       Key = win.VK_BROWSER_STOP
	KeyBrowserSearch     Key = win.VK_BROWSER_SEARCH
	KeyBrowserFavorites  Key = win.VK_BROWSER_FAVORITES
	KeyBrowserHome       Key = win.VK_BROWSER_HOME
	KeyVolumeMute        Key = win.VK_VOLUME_MUTE
	KeyVolumeDown        Key = win.VK_VOLUME_DOWN
	KeyVolumeUp          Key = win.VK_VOLUME_UP
	KeyMediaNextTrack    Key = win.VK_MEDIA_NEXT_TRACK
	KeyMediaPrevTrack    Key = win.VK_MEDIA_PREV_TRACK
	KeyMediaStop         Key = win.VK_MEDIA_STOP
	KeyMediaPlayPause    Key = win.VK_MEDIA_PLAY_PAUSE
	KeyLaunchMail        Key = win.VK_LAUNCH_MAIL
	KeyLaunchMediaSelect Key = win.VK_LAUNCH_MEDIA_SELECT
	KeyLaunchApp1        Key = win.VK_LAUNCH_APP1
	KeyLaunchApp2        Key = win.VK_LAUNCH_APP2
	KeyOEM1              Key = win.VK_OEM_1
	KeyOEMPlus           Key = win.VK_OEM_PLUS
	KeyOEMComma          Key = win.VK_OEM_COMMA
	KeyOEMMinus          Key = win.VK_OEM_MINUS
	KeyOEMPeriod         Key = win.VK_OEM_PERIOD
	KeyOEM2              Key = win.VK_OEM_2
	KeyOEM3              Key = win.VK_OEM_3
	KeyOEM4              Key = win.VK_OEM_4
	KeyOEM5              Key = win.VK_OEM_5
	KeyOEM6              Key = win.VK_OEM_6
	KeyOEM7              Key = win.VK_OEM_7
	KeyOEM8              Key = win.VK_OEM_8
	KeyOEM102            Key = win.VK_OEM_102
	KeyProcessKey        Key = win.VK_PROCESSKEY
	KeyPacket            Key = win.VK_PACKET
	KeyAttn              Key = win.VK_ATTN
	KeyCRSel             Key = win.VK_CRSEL
	KeyEXSel             Key = win.VK_EXSEL
	KeyErEOF             Key = win.VK_EREOF
	KeyPlay              Key = win.VK_PLAY
	KeyZoom              Key = win.VK_ZOOM
	KeyNoName            Key = win.VK_NONAME
	KeyPA1               Key = win.VK_PA1
	KeyOEMClear          Key = win.VK_OEM_CLEAR
)

func (Key) String

func (k Key) String() string

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

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

type Label

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

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

func (*Label) WndProc

func (l *Label) WndProc(hwnd win.HWND, msg uint32, wParam, lParam uintptr) uintptr

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 (le *LineEdit) LayoutFlags() (lf 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) 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) SizeHint

func (le *LineEdit) SizeHint() (size 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) WndProc

func (le *LineEdit) WndProc(hwnd win.HWND, msg uint32, wParam, lParam uintptr) uintptr

type LineErrorPresenter

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

func NewLineErrorPresenter

func NewLineErrorPresenter(parent Container) (*LineErrorPresenter, error)

func (*LineErrorPresenter) LayoutFlags

func (*LineErrorPresenter) LayoutFlags() LayoutFlags

func (*LineErrorPresenter) MinSizeHint

func (lep *LineErrorPresenter) MinSizeHint() Size

func (*LineErrorPresenter) PresentError

func (lep *LineErrorPresenter) PresentError(err error, widget Widget)

func (*LineErrorPresenter) SizeHint

func (lep *LineErrorPresenter) SizeHint() Size

func (*LineErrorPresenter) WndProc

func (lep *LineErrorPresenter) WndProc(hwnd win.HWND, msg uint32, wParam, lParam uintptr) uintptr

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

func (lb *ListBox) DataMember() string

DataMember returns the member from the model of the ListBox that is displayed in the ListBox.

This is only applicable to walk.ReflectListModel models and simple slices of pointers to struct.

func (*ListBox) Format

func (lb *ListBox) Format() string

func (*ListBox) ItemActivated

func (lb *ListBox) ItemActivated() *Event

func (*ListBox) LayoutFlags

func (*ListBox) LayoutFlags() LayoutFlags

func (*ListBox) Model

func (lb *ListBox) Model() interface{}

Model returns the model of the ListBox.

func (*ListBox) Precision

func (lb *ListBox) Precision() int

func (*ListBox) SetCurrentIndex

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

func (*ListBox) SetDataMember

func (lb *ListBox) SetDataMember(dataMember string) error

SetDataMember sets the member from the model of the ListBox that is displayed in the ListBox.

This is only applicable to walk.ReflectListModel models and simple slices of pointers to struct.

For a model consisting of items of type S, the type of the specified member T and dataMember "Foo", this can be one of the following:

A field		Foo T
A method	func (s S) Foo() T
A method	func (s S) Foo() (T, error)

If dataMember is not a simple member name like "Foo", but a path to a member like "A.B.Foo", members "A" and "B" both must be one of the options mentioned above, but with T having type pointer to struct.

func (*ListBox) SetFormat

func (lb *ListBox) SetFormat(value string)

func (*ListBox) SetModel

func (lb *ListBox) SetModel(mdl interface{}) error

SetModel sets the model of the ListBox.

It is required that mdl either implements walk.ListModel or walk.ReflectListModel or be a slice of pointers to struct or a []string.

func (*ListBox) SetPrecision

func (lb *ListBox) SetPrecision(value int)

func (*ListBox) SizeHint

func (lb *ListBox) SizeHint() Size

func (*ListBox) WndProc

func (lb *ListBox) WndProc(hwnd win.HWND, msg uint32, wParam, lParam uintptr) uintptr

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 {
	FormBase
	// contains filtered or unexported fields
}

func NewMainWindow

func NewMainWindow() (*MainWindow, error)

func (*MainWindow) ClientBounds

func (mw *MainWindow) ClientBounds() Rectangle

func (*MainWindow) Fullscreen

func (mw *MainWindow) Fullscreen() bool

func (*MainWindow) Menu

func (mw *MainWindow) Menu() *Menu

func (*MainWindow) SetFullscreen

func (mw *MainWindow) SetFullscreen(fullscreen bool) error

func (*MainWindow) SetVisible

func (mw *MainWindow) SetVisible(visible bool)

func (*MainWindow) StatusBar

func (mw *MainWindow) StatusBar() *StatusBar

func (*MainWindow) ToolBar

func (mw *MainWindow) ToolBar() *ToolBar

func (*MainWindow) WndProc

func (mw *MainWindow) WndProc(hwnd win.HWND, msg uint32, wParam, lParam uintptr) uintptr

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 Modifiers

type Modifiers byte
const (
	ModShift Modifiers = 1 << iota
	ModControl
	ModAlt
)

func ModifiersDown

func ModifiersDown() Modifiers

func (Modifiers) String

func (m Modifiers) String() string

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 = win.MB_OK
	MsgBoxOKCancel          MsgBoxStyle = win.MB_OKCANCEL
	MsgBoxAbortRetryIgnore  MsgBoxStyle = win.MB_ABORTRETRYIGNORE
	MsgBoxYesNoCancel       MsgBoxStyle = win.MB_YESNOCANCEL
	MsgBoxYesNo             MsgBoxStyle = win.MB_YESNO
	MsgBoxRetryCancel       MsgBoxStyle = win.MB_RETRYCANCEL
	MsgBoxCancelTryContinue MsgBoxStyle = win.MB_CANCELTRYCONTINUE
	MsgBoxIconHand          MsgBoxStyle = win.MB_ICONHAND
	MsgBoxIconQuestion      MsgBoxStyle = win.MB_ICONQUESTION
	MsgBoxIconExclamation   MsgBoxStyle = win.MB_ICONEXCLAMATION
	MsgBoxIconAsterisk      MsgBoxStyle = win.MB_ICONASTERISK
	MsgBoxUserIcon          MsgBoxStyle = win.MB_USERICON
	MsgBoxIconWarning       MsgBoxStyle = win.MB_ICONWARNING
	MsgBoxIconError         MsgBoxStyle = win.MB_ICONERROR
	MsgBoxIconInformation   MsgBoxStyle = win.MB_ICONINFORMATION
	MsgBoxIconStop          MsgBoxStyle = win.MB_ICONSTOP
	MsgBoxDefButton1        MsgBoxStyle = win.MB_DEFBUTTON1
	MsgBoxDefButton2        MsgBoxStyle = win.MB_DEFBUTTON2
	MsgBoxDefButton3        MsgBoxStyle = win.MB_DEFBUTTON3
	MsgBoxDefButton4        MsgBoxStyle = win.MB_DEFBUTTON4
)

type MutableCondition

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

func NewMutableCondition

func NewMutableCondition() *MutableCondition

func (*MutableCondition) Changed

func (mc *MutableCondition) Changed() *Event

func (*MutableCondition) Satisfied

func (mc *MutableCondition) Satisfied() bool

func (*MutableCondition) SetSatisfied

func (mc *MutableCondition) SetSatisfied(satisfied bool) error

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

func (ni *NotifyIcon) ShowCustom(title, info string) error

ShowCustom displays a custom icon message balloon above the NotifyIcon.

The NotifyIcon must be visible before calling this method.

func (*NotifyIcon) ShowError

func (ni *NotifyIcon) ShowError(title, info string) error

ShowError displays an error message balloon above the NotifyIcon.

The NotifyIcon must be visible before calling this method.

func (*NotifyIcon) ShowInfo

func (ni *NotifyIcon) ShowInfo(title, info string) error

ShowInfo displays an info message balloon above the NotifyIcon.

The NotifyIcon must be visible before calling this method.

func (*NotifyIcon) ShowMessage

func (ni *NotifyIcon) ShowMessage(title, info string) error

ShowMessage displays a neutral message balloon above the NotifyIcon.

The NotifyIcon must be visible before calling this method.

func (*NotifyIcon) ShowWarning

func (ni *NotifyIcon) ShowWarning(title, info string) error

ShowWarning displays a warning message balloon above the NotifyIcon.

The NotifyIcon must be visible before calling this method.

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
}

NumberEdit is a widget that is suited to edit numeric values.

func NewNumberEdit

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

NewNumberEdit returns a new NumberEdit widget as child of parent.

func (*NumberEdit) Decimals

func (ne *NumberEdit) Decimals() int

Decimals returns the number of decimal places in the NumberEdit.

func (*NumberEdit) Enabled

func (ne *NumberEdit) Enabled() bool

Enabled returns whether the NumberEdit is enabled.

func (*NumberEdit) Font

func (ne *NumberEdit) Font() *Font

Font returns the Font of the NumberEdit.

func (*NumberEdit) Increment

func (ne *NumberEdit) Increment() float64

Increment returns the amount by which the NumberEdit increments or decrements its value, when the user presses the KeyDown or KeyUp keys, or when the mouse wheel is rotated.

func (*NumberEdit) LayoutFlags

func (*NumberEdit) LayoutFlags() LayoutFlags

LayoutFlags returns information that is mainly interesting to Layout implementations.

func (*NumberEdit) MaxValue

func (ne *NumberEdit) MaxValue() float64

MinValue returns the maximum value the NumberEdit will accept.

func (*NumberEdit) MinSizeHint

func (ne *NumberEdit) MinSizeHint() Size

MinSizeHint returns information that is mainly interesting to Layout implementations.

func (*NumberEdit) MinValue

func (ne *NumberEdit) MinValue() float64

MinValue returns the minimum value the NumberEdit will accept.

func (*NumberEdit) Prefix

func (ne *NumberEdit) Prefix() string

Prefix returns the text that appears in the NumberEdit before the number.

func (*NumberEdit) SetDecimals

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

SetDecimals sets the number of decimal places in the NumberEdit.

func (*NumberEdit) SetEnabled

func (ne *NumberEdit) SetEnabled(value bool)

SetEnabled sets whether the NumberEdit is enabled.

func (*NumberEdit) SetFocus

func (ne *NumberEdit) SetFocus() error

SetFocus sets the keyboard input focus to the NumberEdit.

func (*NumberEdit) SetFont

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

SetFont sets the Font of the NumberEdit.

func (*NumberEdit) SetIncrement

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

SetIncrement sets the amount by which the NumberEdit increments or decrements its value, when the user presses the KeyDown or KeyUp keys, or when the mouse wheel is rotated.

func (*NumberEdit) SetPrefix

func (ne *NumberEdit) SetPrefix(prefix string) error

SetPrefix sets the text that appears in the NumberEdit before the number.

func (*NumberEdit) SetRange

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

SetRange sets the minimum and maximum values the NumberEdit will accept.

If the current value is out of this range, it will be adjusted.

func (*NumberEdit) SetSuffix

func (ne *NumberEdit) SetSuffix(suffix string) error

SetSuffix sets the text that appears in the NumberEdit after the number.

func (*NumberEdit) SetTextSelection

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

SetTextSelection sets the range of the current text selection of the NumberEdit.

func (*NumberEdit) SetValue

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

SetValue sets the value of the NumberEdit.

func (*NumberEdit) SizeHint

func (ne *NumberEdit) SizeHint() Size

SizeHint returns information that is mainly interesting to Layout implementations.

func (*NumberEdit) Suffix

func (ne *NumberEdit) Suffix() string

Suffix returns the text that appears in the NumberEdit after the number.

func (*NumberEdit) TextSelection

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

TextSelection returns the range of the current text selection of the NumberEdit.

func (*NumberEdit) Value

func (ne *NumberEdit) Value() float64

Value returns the value of the NumberEdit.

func (*NumberEdit) ValueChanged

func (ne *NumberEdit) ValueChanged() *Event

ValueChanged returns an Event that can be used to track changes to Value.

func (*NumberEdit) WndProc

func (ne *NumberEdit) WndProc(hwnd win.HWND, msg uint32, wParam, lParam uintptr) uintptr

WndProc is the window procedure of the NumberEdit.

When implementing your own WndProc to add or modify behavior, call the WndProc of the embedded NumberEdit for messages you don't handle yourself.

type Orientation

type Orientation byte
const (
	Horizontal Orientation = iota
	Vertical
)

type PIState

type PIState int
const (
	PINoProgress    PIState = win.TBPF_NOPROGRESS
	PIIndeterminate PIState = win.TBPF_INDETERMINATE
	PINormal        PIState = win.TBPF_NORMAL
	PIError         PIState = win.TBPF_ERROR
	PIPaused        PIState = win.TBPF_PAUSED
)

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 = win.PS_SOLID
	PenDash        PenStyle = win.PS_DASH
	PenDot         PenStyle = win.PS_DOT
	PenDashDot     PenStyle = win.PS_DASHDOT
	PenDashDotDot  PenStyle = win.PS_DASHDOTDOT
	PenNull        PenStyle = win.PS_NULL
	PenInsideFrame PenStyle = win.PS_INSIDEFRAME
	PenUserStyle   PenStyle = win.PS_USERSTYLE
	PenAlternate   PenStyle = win.PS_ALTERNATE
)

Pen styles

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

Pen cap styles (geometric pens only)

const (
	PenJoinBevel PenStyle = win.PS_JOIN_BEVEL
	PenJoinMiter PenStyle = win.PS_JOIN_MITER
	PenJoinRound PenStyle = win.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 Populator

type Populator interface {
	// Populate initializes the slot specified by index.
	//
	// For best performance it is probably a good idea to populate more than a
	// single slot of the slice at once.
	Populate(index int) error
}

Populator is an interface that can be implemented by Reflect*Models and slice types to populate themselves on demand.

Widgets like TableView, ListBox and ComboBox support lazy population of a Reflect*Model or slice, if it implements this interface.

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 ProgressIndicator

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

func (*ProgressIndicator) Completed

func (pi *ProgressIndicator) Completed() uint32

func (*ProgressIndicator) SetCompleted

func (pi *ProgressIndicator) SetCompleted(completed uint32) error

func (*ProgressIndicator) SetState

func (pi *ProgressIndicator) SetState(state PIState) error

func (*ProgressIndicator) SetTotal

func (pi *ProgressIndicator) SetTotal(total uint32)

func (*ProgressIndicator) State

func (pi *ProgressIndicator) State() PIState

func (*ProgressIndicator) Total

func (pi *ProgressIndicator) Total() uint32

type Property

type Property interface {
	ReadOnly() bool
	Get() interface{}
	Set(value interface{}) error
	Changed() *Event
	Source() interface{}
	SetSource(source interface{}) error
	Validatable() bool
	Validator() Validator
	SetValidator(validator Validator) error
}

func NewBoolProperty

func NewBoolProperty(get func() bool, set func(b bool) error, changed *Event) Property

func NewProperty

func NewProperty(get func() interface{}, set func(v interface{}) error, changed *Event) Property

func NewReadOnlyBoolProperty

func NewReadOnlyBoolProperty(get func() bool, changed *Event) Property

func NewReadOnlyProperty

func NewReadOnlyProperty(get func() interface{}, changed *Event) Property

type PushButton

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

func NewPushButton

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

func (*PushButton) Image

func (pb *PushButton) Image() interface{}

func (*PushButton) ImageAboveText

func (pb *PushButton) ImageAboveText() bool

func (*PushButton) LayoutFlags

func (*PushButton) LayoutFlags() LayoutFlags

func (*PushButton) MinSizeHint

func (pb *PushButton) MinSizeHint() Size

func (*PushButton) SetImage

func (pb *PushButton) SetImage(image interface{}) error

func (*PushButton) SetImageAboveText

func (pb *PushButton) SetImageAboveText(value bool) error

func (*PushButton) SizeHint

func (pb *PushButton) SizeHint() Size

func (*PushButton) WndProc

func (pb *PushButton) WndProc(hwnd win.HWND, msg uint32, wParam, lParam uintptr) uintptr

type RadioButton

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

func NewRadioButton

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

func (*RadioButton) Group

func (rb *RadioButton) Group() *RadioButtonGroup

func (*RadioButton) LayoutFlags

func (*RadioButton) LayoutFlags() LayoutFlags

func (*RadioButton) MinSizeHint

func (rb *RadioButton) MinSizeHint() Size

func (*RadioButton) SetValue

func (rb *RadioButton) SetValue(value interface{})

func (*RadioButton) SizeHint

func (rb *RadioButton) SizeHint() Size

func (*RadioButton) Value

func (rb *RadioButton) Value() interface{}

func (*RadioButton) WndProc

func (rb *RadioButton) WndProc(hwnd win.HWND, msg uint32, wParam, lParam uintptr) uintptr

type RadioButtonGroup

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

func (*RadioButtonGroup) Buttons

func (rbg *RadioButtonGroup) Buttons() []*RadioButton

func (*RadioButtonGroup) CheckedButton

func (rbg *RadioButtonGroup) CheckedButton() *RadioButton

type RangeValidator

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

func NewRangeValidator

func NewRangeValidator(min, max float64) (*RangeValidator, error)

func (*RangeValidator) Max

func (rv *RangeValidator) Max() float64

func (*RangeValidator) Min

func (rv *RangeValidator) Min() float64

func (*RangeValidator) Validate

func (rv *RangeValidator) Validate(v interface{}) error

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 ReflectListModel

type ReflectListModel interface {
	// Items returns the model data, which must be a slice of pointer to struct.
	Items() 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
	// contains filtered or unexported methods
}

ReflectListModel provides an alternative to the ListModel interface. It uses reflection to obtain data.

type ReflectListModelBase

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

ReflectListModelBase implements the ItemsReset and ItemChanged methods of the ReflectListModel interface.

func (*ReflectListModelBase) Value

func (rlmb *ReflectListModelBase) Value(index int) interface{}

type ReflectTableModel

type ReflectTableModel interface {
	// Items returns the model data, which must be a slice of pointer to struct.
	Items() interface{}

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

	// RowChanged returns the event that the model should publish when an item
	// was changed.
	RowChanged() *IntEvent
	// contains filtered or unexported methods
}

ReflectTableModel provides an alternative to the TableModel interface. It uses reflection to obtain data.

type ReflectTableModelBase

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

ReflectTableModelBase implements the ItemsReset and ItemChanged methods of the ReflectTableModel interface.

func (*ReflectTableModelBase) Value

func (rtmb *ReflectTableModelBase) Value(row, col int) interface{}

type RegexpValidator

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

func NewRegexpValidator

func NewRegexpValidator(pattern string) (*RegexpValidator, error)

func (*RegexpValidator) Pattern

func (rv *RegexpValidator) Pattern() string

func (*RegexpValidator) Validate

func (rv *RegexpValidator) Validate(v interface{}) error

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 Settings

type Settings interface {
	Get(key string) (string, bool)
	Timestamp(key string) (time.Time, bool)
	Put(key, value string) error
	PutExpiring(key, value string) error
	Remove(key string) error
	ExpireDuration() time.Duration
	SetExpireDuration(expireDuration time.Duration)
	Load() error
	Save() error
}

type Shortcut

type Shortcut struct {
	Modifiers Modifiers
	Key       Key
}

func (Shortcut) String

func (s Shortcut) String() string

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 SortOrder

type SortOrder int

SortOrder specifies the order by which items are sorted.

const (
	// SortAscending specifies ascending sort order.
	SortAscending SortOrder = iota

	// SortDescending specifies descending sort order.
	SortDescending
)

type SortedReflectTableModelBase

type SortedReflectTableModelBase struct {
	ReflectTableModelBase
	SorterBase
	// contains filtered or unexported fields
}

SortedReflectTableModelBase implements the RowsReset and RowChanged methods of the ReflectTableModel interface as well as the Sorter interface for pre-implemented in-memory sorting.

func (*SortedReflectTableModelBase) Sort

func (srtmb *SortedReflectTableModelBase) Sort(col int, order SortOrder) error

type Sorter

type Sorter interface {
	// ColumnSortable returns whether column col is sortable.
	ColumnSortable(col int) bool

	// Sort sorts column col in order order.
	//
	// If col is -1 then no column is to be sorted. Sort must publish the event
	// returned from SortChanged() after sorting.
	Sort(col int, order SortOrder) error

	// SortChanged returns an event that is published after sorting.
	SortChanged() *Event

	// SortedColumn returns the index of the currently sorted column, or -1 if
	// no column is currently sorted.
	SortedColumn() int

	// SortOrder returns the current sort order.
	SortOrder() SortOrder
}

Sorter is the interface that a model must implement to support sorting with a widget like TableView.

type SorterBase

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

SorterBase implements the Sorter interface.

You still need to provide your own implementation of at least the Sort method to actually sort and reset the model. Your Sort method should call the SorterBase implementation so the SortChanged event, that e.g. a TableView widget depends on, is published.

func (*SorterBase) ColumnSortable

func (sb *SorterBase) ColumnSortable(col int) bool

func (*SorterBase) Sort

func (sb *SorterBase) Sort(col int, order SortOrder) error

func (*SorterBase) SortChanged

func (sb *SorterBase) SortChanged() *Event

func (*SorterBase) SortOrder

func (sb *SorterBase) SortOrder() SortOrder

func (*SorterBase) SortedColumn

func (sb *SorterBase) SortedColumn() int

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 NewHSplitter

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

func NewVSplitter

func NewVSplitter(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) SetPersistent

func (s *Splitter) SetPersistent(value bool)

func (*Splitter) SizeHint

func (s *Splitter) SizeHint() Size

type StatusBar

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

StatusBar is a widget that displays status messages.

func NewStatusBar

func NewStatusBar(parent Container) (*StatusBar, error)

NewStatusBar returns a new StatusBar as child of container parent.

func (*StatusBar) Items

func (sb *StatusBar) Items() *StatusBarItemList

Items returns the list of items in the StatusBar.

func (*StatusBar) LayoutFlags

func (*StatusBar) LayoutFlags() LayoutFlags

LayoutFlags returns information useful to a Layout implementation.

func (*StatusBar) SetVisible

func (sb *StatusBar) SetVisible(visible bool)

SetVisible sets whether the StatusBar is visible.

func (*StatusBar) SizeHint

func (sb *StatusBar) SizeHint() Size

SizeHint returns information useful to a Layout implementation.

type StatusBarItem

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

StatusBarItem represents a section of a StatusBar that can have its own icon, text, tool tip text and width.

func NewStatusBarItem

func NewStatusBarItem() *StatusBarItem

NewStatusBarItem returns a new StatusBarItem.

func (*StatusBarItem) Icon

func (sbi *StatusBarItem) Icon() *Icon

Icon returns the Icon of the StatusBarItem.

func (*StatusBarItem) SetIcon

func (sbi *StatusBarItem) SetIcon(icon *Icon) error

SetIcon sets the Icon of the StatusBarItem.

func (*StatusBarItem) SetText

func (sbi *StatusBarItem) SetText(text string) error

SetText sets the text of the StatusBarItem.

func (*StatusBarItem) SetToolTipText

func (sbi *StatusBarItem) SetToolTipText(toolTipText string) error

SetToolTipText sets the tool tip text of the StatusBarItem.

func (*StatusBarItem) SetWidth

func (sbi *StatusBarItem) SetWidth(width int) error

SetWidth sets the width of the StatusBarItem.

func (*StatusBarItem) Text

func (sbi *StatusBarItem) Text() string

Text returns the text of the StatusBarItem.

func (*StatusBarItem) ToolTipText

func (sbi *StatusBarItem) ToolTipText() string

ToolTipText returns the tool tip text of the StatusBarItem.

func (*StatusBarItem) Width

func (sbi *StatusBarItem) Width() int

Width returns the width of the StatusBarItem.

type StatusBarItemList

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

func (*StatusBarItemList) Add

func (l *StatusBarItemList) Add(item *StatusBarItem) error

func (*StatusBarItemList) At

func (l *StatusBarItemList) At(index int) *StatusBarItem