tk

package
v0.0.0-...-572ab07 Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2019 License: LGPL-2.1 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AnchorCenter = iota
	AnchorNorth
	AnchorEast
	AnchorSouth
	AnchorWest
	AnchorNorthEast
	AnchorNorthWest
	AnchorSouthEast
	AnchorSouthWest
)
View Source
const (
	StickyCenter Sticky = 1 << iota
	StickyN
	StickyS
	StickyE
	StickyW
	StickyNS  = StickyN | StickyS
	StickyEW  = StickyE | StickyW
	StickyAll = StickyN | StickyS | StickyE | StickyW
)
View Source
const (
	DirectionBelow = iota
	DirectionAbove
	DirectionLeft
	DirectionRight
)
View Source
const (
	CompoundNone = iota
	CompoundTop
	CompoundBottom
	CompoundLeft
	CompoundRight
	CompoundCenter
)
View Source
const (
	StateNormal = iota
	StateActive
	StateDisable
	StateReadOnly
)
View Source
const (
	ListSelectSingle = iota
	ListSelectBrowse
	ListSelectMultiple
	ListSelectExtended
)
View Source
const (
	DisplyCursorNone = iota
	DisplyCursorHollow
	DisplyCursorSolid
)
View Source
const (
	LineWrapNone = iota
	LineWrapChar
	LineWrapWord
)
View Source
const (
	TreeSelectExtended = iota
	TreeSelectBrowse
	TreeSelectNode
)

Variables

View Source
var (
	ErrInvalid   = errors.New("invalid argument")
	ErrExist     = errors.New("already exists")
	ErrNotExist  = errors.New("does not exist")
	ErrClosed    = errors.New("already closed")
	ErrUnsupport = errors.New("unsupport")
)
View Source
var (
	ErrorInvalidWidgetInfo  = fmt.Errorf("invalid widget info")
	ErrorNotMatchWidgetInfo = fmt.Errorf("widget info not match")
)
View Source
var (
	TtkTheme = &ttkTheme{}
)

Functions

func AddVirtualEventPhysicalEvent

func AddVirtualEventPhysicalEvent(virtual string, event string, events ...string) error

Associates the virtual event virtual with the physical event sequence(s) given by the sequence arguments, so that the virtual event will trigger whenever any one of the sequences occurs. Virtual may be any string value and sequence may have any of the values allowed for the sequence argument to the bind command. If virtual is already defined, the new physical event sequences add to the existing sequences for the event.

func Async

func Async(fn func())

func BindEvent

func BindEvent(tag string, event string, fn func(e *Event)) error

add bind event

func BindInfo

func BindInfo(tag string) []string

func BindKeyEventEx

func BindKeyEventEx(tag string, fnPress func(e *KeyEvent), fnRelease func(e *KeyEvent)) error

TODO: almost check key modifier

func ChooseColor

func ChooseColor(parent Widget, title string, initcolor string) (string, error)

tk_chooseColor — pops up a dialog box for the user to select a color.

func ChooseDirectory

func ChooseDirectory(parent Widget, title string, initialdir string, mustexist bool) (string, error)

tk_chooseDirectory — pops up a dialog box for the user to select a directory.

func ClearBindEvent

func ClearBindEvent(tag string, event string) error

clear tag event

func DestroyWidget

func DestroyWidget(w Widget) error

func DumpWidget

func DumpWidget(w Widget) string

func DumpWidgetEx

func DumpWidgetEx(w Widget, offset string) string

func FontFamilieList

func FontFamilieList() []string

func GetOpenFile

func GetOpenFile(parent Widget, title string, filetypes []FileType, initialdir string, initialfile string) (string, error)

tk_getOpenFile, tk_getSaveFile — pop up a dialog box for the user to select a file to open or save.

func GetOpenMultipleFile

func GetOpenMultipleFile(parent Widget, title string, filetypes []FileType, initialdir string, initialfile string) ([]string, error)

func GetSaveFile

func GetSaveFile(parent Widget, title string, confirmoverwrite bool, defaultextension string, filetypes []FileType, initialdir string, initialfile string) (string, error)

tk_getOpenFile, tk_getSaveFile — pop up a dialog box for the user to select a file to open or save.

func Grid

func Grid(widget Widget, attributes ...*LayoutAttr) error

func GridColumnIndex

func GridColumnIndex(master Widget, index int, attributes ...*GridIndexAttr) error

column index from 0; -1=all

func GridList

func GridList(widgets []Widget, attributes ...*LayoutAttr) error

func GridRemove

func GridRemove(widget Widget) error

func GridRowIndex

func GridRowIndex(master Widget, index int, attributes ...*GridIndexAttr) error

row index from 0; -1=all

func HasTheme

func HasTheme() bool

func Init

func Init() error

func InitEx

func InitEx(tk_window_init_hide bool, tcl_library string, tk_library string) (err error)

func IsEvent

func IsEvent(event string) bool

func IsNilInterface

func IsNilInterface(w Widget) bool

func IsTkClass

func IsTkClass(class string) bool

func IsTtkClass

func IsTtkClass(class string) bool

func IsValidWidget

func IsValidWidget(w Widget) bool

func IsVirtualEvent

func IsVirtualEvent(event string) bool

func MainInterp

func MainInterp() *interp.Interp

func MainLoop

func MainLoop(fn func()) error

func MessageBox

func MessageBox(parent Widget, title string, message string, detail string, defaultbutton string, icon MessageBoxIcon, typ MessageBoxType) (string, error)

tk_messageBox — pops up a message window and waits for user response.

func NewGenInt64Func

func NewGenInt64Func(id int64) func() <-chan int64

func NewGenIntFunc

func NewGenIntFunc(id int) func() <-chan int

func Pack

func Pack(widget Widget, attributes ...*LayoutAttr) error

func PackList

func PackList(widgets []Widget, attributes ...*LayoutAttr) error

func PackRemove

func PackRemove(widget Widget) error

func Place

func Place(widget Widget, attributes ...*LayoutAttr) error

func PlaceRemove

func PlaceRemove(widget Widget) error

func PopupMenu

func PopupMenu(menu *Menu, xpos int, ypos int) error

func Quit

func Quit()

func RegisterWidget

func RegisterWidget(w Widget)

func RemoveVirtualEventPhysicalEvent

func RemoveVirtualEventPhysicalEvent(virtual string, events ...string) error

Deletes each of the sequences from those associated with the virtual event given by virtual. Virtual may be any string value and sequence may have any of the values allowed for the sequence argument to the bind command. Any sequences not currently associated with virtual are ignored. If no sequence argument is provided, all physical event sequences are removed for virtual, so that the virtual event will not trigger anymore.

func SendEvent

func SendEvent(widget Widget, event string, attrs ...*EventAttr) error

func SendEventToFocus

func SendEventToFocus(event string, attrs ...*EventAttr) error

func SetErrorHandle

func SetErrorHandle(fn func(error))

func SetFocusFollowsMouse

func SetFocusFollowsMouse() error

func SetMainTheme

func SetMainTheme(theme Theme)

func SetMenuTearoff

func SetMenuTearoff(enable bool)

func SubString

func SubString(text string, start int, end int) string

func TclLibary

func TclLibary() (path string)

func TclVersion

func TclVersion() (ver string)

func TkLibrary

func TkLibrary() (path string)

func TkVersion

func TkVersion() (ver string)

func Update

func Update()

func VirtualEventInfo

func VirtualEventInfo(virtual string) []string

Types

type Action

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

func NewAction

func NewAction(label string) *Action

func NewActionEx

func NewActionEx(label string, cmd func()) *Action

func NewCheckAction

func NewCheckAction(label string) *Action

func NewCheckActionEx

func NewCheckActionEx(label string, cmd func()) *Action

func NewRadioAction

func NewRadioAction(group *ActionGroup, label string) *Action

func NewSeparatorAction

func NewSeparatorAction() *Action

func (*Action) Data

func (a *Action) Data() interface{}

func (*Action) Invoke

func (a *Action) Invoke()

func (*Action) IsCheckAction

func (a *Action) IsCheckAction() bool

func (*Action) IsChecked

func (a *Action) IsChecked() bool

func (*Action) IsRadioAction

func (a *Action) IsRadioAction() bool

func (*Action) IsSeparator

func (a *Action) IsSeparator() bool

func (*Action) Label

func (a *Action) Label() string

func (*Action) OnCommand

func (a *Action) OnCommand(fn func()) error

func (*Action) SetChecked

func (a *Action) SetChecked(b bool)

func (*Action) SetData

func (a *Action) SetData(data interface{})

func (*Action) String

func (a *Action) String() string

type ActionGroup

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

func NewActionGroup

func NewActionGroup() *ActionGroup

func (*ActionGroup) Actions

func (a *ActionGroup) Actions() []*Action

func (*ActionGroup) AddNewRadioAction

func (a *ActionGroup) AddNewRadioAction(label string) *Action

func (*ActionGroup) AddRadioAction

func (a *ActionGroup) AddRadioAction(act *Action) error

func (*ActionGroup) CheckedAction

func (a *ActionGroup) CheckedAction() *Action

func (*ActionGroup) CheckedActionIndex

func (a *ActionGroup) CheckedActionIndex() int

func (*ActionGroup) OnCommand

func (a *ActionGroup) OnCommand(fn func())

func (*ActionGroup) SetCheckedAction

func (a *ActionGroup) SetCheckedAction(act *Action) error

func (*ActionGroup) SetCheckedIndex

func (a *ActionGroup) SetCheckedIndex(index int) error

type Anchor

type Anchor int

func (Anchor) String

func (v Anchor) String() string

type BaseFont

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

func (*BaseFont) Clone

func (w *BaseFont) Clone() *UserFont

func (*BaseFont) Description

func (w *BaseFont) Description() string

func (*BaseFont) Family

func (w *BaseFont) Family() string

func (*BaseFont) Id

func (f *BaseFont) Id() string

func (*BaseFont) IsBold

func (w *BaseFont) IsBold() bool

func (*BaseFont) IsItalic

func (w *BaseFont) IsItalic() bool

func (*BaseFont) IsOverstrike

func (w *BaseFont) IsOverstrike() bool

func (*BaseFont) IsUnderline

func (w *BaseFont) IsUnderline() bool

func (*BaseFont) IsValid

func (f *BaseFont) IsValid() bool

func (*BaseFont) MeasureTextWidth

func (w *BaseFont) MeasureTextWidth(text string) int

func (*BaseFont) Size

func (w *BaseFont) Size() int

func (*BaseFont) String

func (w *BaseFont) String() string

type BaseWidget

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

func (*BaseWidget) BindEvent

func (w *BaseWidget) BindEvent(event string, fn func(e *Event)) error

func (*BaseWidget) BindInfo

func (w *BaseWidget) BindInfo() []string

func (*BaseWidget) BindKeyEvent

func (w *BaseWidget) BindKeyEvent(fn func(e *KeyEvent)) error

func (*BaseWidget) BindKeyEventEx

func (w *BaseWidget) BindKeyEventEx(fnPress func(e *KeyEvent), fnRelease func(e *KeyEvent)) error

func (*BaseWidget) Children

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

func (*BaseWidget) ClearBind

func (w *BaseWidget) ClearBind(event string) error

func (*BaseWidget) Destroy

func (w *BaseWidget) Destroy() error

func (*BaseWidget) DestroyChildren

func (w *BaseWidget) DestroyChildren() error

func (*BaseWidget) FocusNextWidget

func (w *BaseWidget) FocusNextWidget() Widget

func (*BaseWidget) FocusPrevWidget

func (w *BaseWidget) FocusPrevWidget() Widget

func (*BaseWidget) Id

func (w *BaseWidget) Id() string

func (*BaseWidget) Info

func (w *BaseWidget) Info() *WidgetInfo

func (*BaseWidget) IsFocus

func (w *BaseWidget) IsFocus() bool

func (*BaseWidget) IsValid

func (w *BaseWidget) IsValid() bool

func (*BaseWidget) Lower

func (w *BaseWidget) Lower(below Widget) error

func (*BaseWidget) NativeAttribute

func (w *BaseWidget) NativeAttribute(key string) string

func (*BaseWidget) NativeAttributes

func (w *BaseWidget) NativeAttributes(keys ...string) (attributes []NativeAttr)

func (*BaseWidget) Parent

func (w *BaseWidget) Parent() Widget

func (*BaseWidget) Raise

func (w *BaseWidget) Raise(above Widget) error

func (*BaseWidget) SetAttributes

func (w *BaseWidget) SetAttributes(attributes ...*WidgetAttr) error

func (*BaseWidget) SetFocus

func (w *BaseWidget) SetFocus() error

func (*BaseWidget) SetNativeAttribute

func (w *BaseWidget) SetNativeAttribute(key string, value string) error

func (*BaseWidget) SetNativeAttributes

func (w *BaseWidget) SetNativeAttributes(attributes ...NativeAttr) error

func (*BaseWidget) String

func (w *BaseWidget) String() string

func (*BaseWidget) Type

func (w *BaseWidget) Type() WidgetType

func (*BaseWidget) TypeName

func (w *BaseWidget) TypeName() string

type BorderMode

type BorderMode int
const (
	BorderModeInside BorderMode = iota
	BorderModeOutside
	BorderModeIgnore
)

func (BorderMode) String

func (v BorderMode) String() string

type Button

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

button

func NewButton

func NewButton(parent Widget, text string, attributes ...*WidgetAttr) *Button

func (*Button) Attach

func (w *Button) Attach(id string) error

func (*Button) Compound

func (w *Button) Compound() Compound

func (*Button) Image

func (w *Button) Image() *Image

func (*Button) Invoke

func (w *Button) Invoke()

func (*Button) IsTakeFocus

func (w *Button) IsTakeFocus() bool

func (*Button) OnCommand

func (w *Button) OnCommand(fn func()) error

func (*Button) Padding

func (w *Button) Padding() Pad

func (*Button) PaddingN

func (w *Button) PaddingN() (int, int)

func (*Button) SetCompound

func (w *Button) SetCompound(compound Compound) error

func (*Button) SetImage

func (w *Button) SetImage(image *Image) error

func (*Button) SetPadding

func (w *Button) SetPadding(pad Pad) error

func (*Button) SetPaddingN

func (w *Button) SetPaddingN(padx int, pady int) error

func (*Button) SetState

func (w *Button) SetState(state State) error

func (*Button) SetTakeFocus

func (w *Button) SetTakeFocus(takefocus bool) error

func (*Button) SetText

func (w *Button) SetText(text string) error

func (*Button) SetWidth

func (w *Button) SetWidth(width int) error

func (*Button) State

func (w *Button) State() State

func (*Button) Text

func (w *Button) Text() string

func (*Button) Width

func (w *Button) Width() int

type Canvas

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

Create and manipulate 'canvas' hypergraphics drawing surface widgets

func NewCanvas

func NewCanvas(parent Widget, attributes ...*WidgetAttr) *Canvas

func (*Canvas) Attach

func (w *Canvas) Attach(id string) error

func (*Canvas) Background

func (w *Canvas) Background() string

func (*Canvas) BorderWidth

func (w *Canvas) BorderWidth() int

func (*Canvas) CloseEnough

func (w *Canvas) CloseEnough() float64

func (*Canvas) Height

func (w *Canvas) Height() int

func (*Canvas) HighlightBackground

func (w *Canvas) HighlightBackground() string

func (*Canvas) HighlightColor

func (w *Canvas) HighlightColor() string

func (*Canvas) Highlightthickness

func (w *Canvas) Highlightthickness() int

func (*Canvas) InsertBackground

func (w *Canvas) InsertBackground() string

func (*Canvas) InsertBorderWidth

func (w *Canvas) InsertBorderWidth() int

func (*Canvas) InsertOffTime

func (w *Canvas) InsertOffTime() int

func (*Canvas) InsertOnTime

func (w *Canvas) InsertOnTime() int

func (*Canvas) InsertWidth

func (w *Canvas) InsertWidth() int

func (*Canvas) IsConfine

func (w *Canvas) IsConfine() bool

func (*Canvas) IsTakeFocus

func (w *Canvas) IsTakeFocus() bool

func (*Canvas) ReliefStyle

func (w *Canvas) ReliefStyle() ReliefStyle

func (*Canvas) SelectBackground

func (w *Canvas) SelectBackground() string

func (*Canvas) Selectborderwidth

func (w *Canvas) Selectborderwidth() int

func (*Canvas) Selectforeground

func (w *Canvas) Selectforeground() string

func (*Canvas) SetBackground

func (w *Canvas) SetBackground(color string) error

func (*Canvas) SetBorderWidth

func (w *Canvas) SetBorderWidth(width int) error

func (*Canvas) SetCloseEnough

func (w *Canvas) SetCloseEnough(closeenough float64) error

func (*Canvas) SetConfine

func (w *Canvas) SetConfine(confine bool) error

func (*Canvas) SetHeight

func (w *Canvas) SetHeight(height int) error

func (*Canvas) SetHighlightBackground

func (w *Canvas) SetHighlightBackground(color string) error

func (*Canvas) SetHighlightColor

func (w *Canvas) SetHighlightColor(color string) error

func (*Canvas) SetHighlightthickness

func (w *Canvas) SetHighlightthickness(width int) error

func (*Canvas) SetInsertBackground

func (w *Canvas) SetInsertBackground(color string) error

func (*Canvas) SetInsertBorderWidth

func (w *Canvas) SetInsertBorderWidth(width int) error

func (*Canvas) SetInsertOffTime

func (w *Canvas) SetInsertOffTime(offtime int) error

func (*Canvas) SetInsertOnTime

func (w *Canvas) SetInsertOnTime(ontime int) error

func (*Canvas) SetInsertWidth

func (w *Canvas) SetInsertWidth(width int) error

func (*Canvas) SetReliefStyle

func (w *Canvas) SetReliefStyle(relief ReliefStyle) error

func (*Canvas) SetSelectBackground

func (w *Canvas) SetSelectBackground(color string) error

func (*Canvas) SetSelectborderwidth

func (w *Canvas) SetSelectborderwidth(width int) error

func (*Canvas) SetSelectforeground

func (w *Canvas) SetSelectforeground(color string) error

func (*Canvas) SetState

func (w *Canvas) SetState(state State) error

func (*Canvas) SetTakeFocus

func (w *Canvas) SetTakeFocus(takefocus bool) error

func (*Canvas) SetWidth

func (w *Canvas) SetWidth(width int) error

func (*Canvas) SetXScrollIncrement

func (w *Canvas) SetXScrollIncrement(value int) error

func (*Canvas) SetYScrollIncrement

func (w *Canvas) SetYScrollIncrement(value int) error

func (*Canvas) State

func (w *Canvas) State() State

func (*Canvas) Width

func (w *Canvas) Width() int

func (*Canvas) XScrollIncrement

func (w *Canvas) XScrollIncrement() int

func (*Canvas) YScrollIncrement

func (w *Canvas) YScrollIncrement() int

type CheckButton

type CheckButton struct {
	BaseWidget
	// contains filtered or unexported fields
}

check button

func NewCheckButton

func NewCheckButton(parent Widget, text string, attributes ...*WidgetAttr) *CheckButton

func (*CheckButton) Attach

func (w *CheckButton) Attach(id string) error

func (*CheckButton) Compound

func (w *CheckButton) Compound() Compound

func (*CheckButton) Image

func (w *CheckButton) Image() *Image

func (*CheckButton) Invoke

func (w *CheckButton) Invoke()

func (*CheckButton) IsChecked

func (w *CheckButton) IsChecked() bool

func (*CheckButton) IsTakeFocus

func (w *CheckButton) IsTakeFocus() bool

func (*CheckButton) OnCommand

func (w *CheckButton) OnCommand(fn func()) error

func (*CheckButton) Padding

func (w *CheckButton) Padding() Pad

func (*CheckButton) PaddingN

func (w *CheckButton) PaddingN() (int, int)

func (*CheckButton) SetChecked

func (w *CheckButton) SetChecked(check bool) error

func (*CheckButton) SetCompound

func (w *CheckButton) SetCompound(compound Compound) error

func (*CheckButton) SetImage

func (w *CheckButton) SetImage(image *Image) error

func (*CheckButton) SetPadding

func (w *CheckButton) SetPadding(pad Pad) error

func (*CheckButton) SetPaddingN

func (w *CheckButton) SetPaddingN(padx int, pady int) error

func (*CheckButton) SetState

func (w *CheckButton) SetState(state State) error

func (*CheckButton) SetTakeFocus

func (w *CheckButton) SetTakeFocus(takefocus bool) error

func (*CheckButton) SetText

func (w *CheckButton) SetText(text string) error

func (*CheckButton) SetWidth

func (w *CheckButton) SetWidth(width int) error

func (*CheckButton) State

func (w *CheckButton) State() State

func (*CheckButton) Text

func (w *CheckButton) Text() string

func (*CheckButton) Width

func (w *CheckButton) Width() int

type ComboBox

type ComboBox struct {
	BaseWidget
}

combbox

func NewComboBox

func NewComboBox(parent Widget, attributes ...*WidgetAttr) *ComboBox

func (*ComboBox) Attach

func (w *ComboBox) Attach(id string) error

func (*ComboBox) Background

func (w *ComboBox) Background() string

func (*ComboBox) CurrentIndex

func (w *ComboBox) CurrentIndex() int

func (*ComboBox) CurrentText

func (w *ComboBox) CurrentText() string

func (*ComboBox) Echo

func (w *ComboBox) Echo() string

func (*ComboBox) Entry

func (w *ComboBox) Entry() *Entry

func (*ComboBox) Font

func (w *ComboBox) Font() Font

func (*ComboBox) Forground

func (w *ComboBox) Forground() string

func (*ComboBox) Height

func (w *ComboBox) Height() int

func (*ComboBox) IsTakeFocus

func (w *ComboBox) IsTakeFocus() bool

func (*ComboBox) Justify

func (w *ComboBox) Justify() Justify

func (*ComboBox) OnEditReturn

func (w *ComboBox) OnEditReturn(fn func()) error

func (*ComboBox) OnSelected

func (w *ComboBox) OnSelected(fn func()) error

func (*ComboBox) SetBackground

func (w *ComboBox) SetBackground(color string) error

func (*ComboBox) SetCurrentIndex

func (w *ComboBox) SetCurrentIndex(index int) *ComboBox

func (*ComboBox) SetCurrentText

func (w *ComboBox) SetCurrentText(text string) *ComboBox

func (*ComboBox) SetEcho

func (w *ComboBox) SetEcho(echo string) error

func (*ComboBox) SetFont

func (w *ComboBox) SetFont(font Font) error

func (*ComboBox) SetForground

func (w *ComboBox) SetForground(color string) error

func (*ComboBox) SetHeight

func (w *ComboBox) SetHeight(height int) error

func (*ComboBox) SetJustify

func (w *ComboBox) SetJustify(justify Justify) error

func (*ComboBox) SetState

func (w *ComboBox) SetState(state State) error

func (*ComboBox) SetTakeFocus

func (w *ComboBox) SetTakeFocus(takefocus bool) error

func (*ComboBox) SetValues

func (w *ComboBox) SetValues(values []string) error

func (*ComboBox) SetWidth

func (w *ComboBox) SetWidth(width int) error

func (*ComboBox) State

func (w *ComboBox) State() State

func (*ComboBox) Values

func (w *ComboBox) Values() []string

func (*ComboBox) Width

func (w *ComboBox) Width() int

type Command

type Command struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

func (*Command) Bind

func (c *Command) Bind(fn func())

func (*Command) Clear

func (c *Command) Clear()

func (*Command) Invoke

func (c *Command) Invoke()

type CommandEx

type CommandEx struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

func (*CommandEx) Bind

func (c *CommandEx) Bind(fn func([]string) error)

func (*CommandEx) Clear

func (c *CommandEx) Clear()

func (*CommandEx) Invoke

func (c *CommandEx) Invoke(args []string)

type Compound

type Compound int

func (Compound) String

func (v Compound) String() string

type Direction

type Direction int

func (Direction) String

func (v Direction) String() string

type DisplyCursor

type DisplyCursor int

func (DisplyCursor) String

func (v DisplyCursor) String() string

type Entry

type Entry struct {
	BaseWidget
	// contains filtered or unexported fields
}

entry

func NewEntry

func NewEntry(parent Widget, attributes ...*WidgetAttr) *Entry

func (*Entry) Append

func (w *Entry) Append(str string) error

func (*Entry) Attach

func (w *Entry) Attach(id string) error

func (*Entry) Background

func (w *Entry) Background() string

func (*Entry) BindXScrollBar

func (w *Entry) BindXScrollBar(bar *ScrollBar) error

func (*Entry) Clear

func (w *Entry) Clear()

func (*Entry) ClearSelection

func (w *Entry) ClearSelection()

func (*Entry) Copy

func (w *Entry) Copy()

func (*Entry) CursorPosition

func (w *Entry) CursorPosition() int

func (*Entry) Cut

func (w *Entry) Cut()

func (*Entry) Delete

func (w *Entry) Delete(index int)

func (*Entry) DeleteRange

func (w *Entry) DeleteRange(start int, end int)

func (*Entry) Font

func (w *Entry) Font() Font

func (*Entry) Foreground

func (w *Entry) Foreground() string

func (*Entry) HasSelectedText

func (w *Entry) HasSelectedText() bool

func (*Entry) Index

func (w *Entry) Index(index int) int

func (*Entry) Insert

func (w *Entry) Insert(index int, str string) error

func (*Entry) IsExportSelection

func (w *Entry) IsExportSelection() bool

func (*Entry) IsTakeFocus

func (w *Entry) IsTakeFocus() bool

func (*Entry) Justify

func (w *Entry) Justify() Justify

func (*Entry) OnEditReturn

func (w *Entry) OnEditReturn(fn func()) error

func (*Entry) OnUpdate

func (w *Entry) OnUpdate(fn func()) error

func (*Entry) OnXScrollEx

func (w *Entry) OnXScrollEx(fn func([]string) error) error

func (*Entry) Paste

func (w *Entry) Paste()

func (*Entry) SelectAll

func (w *Entry) SelectAll()

func (*Entry) SelectedText

func (w *Entry) SelectedText() string

func (*Entry) SelectionEnd

func (w *Entry) SelectionEnd() int

func (*Entry) SelectionStart

func (w *Entry) SelectionStart() int

func (*Entry) SetBackground

func (w *Entry) SetBackground(color string) error

func (*Entry) SetCursorPosition

func (w *Entry) SetCursorPosition(pos int) *Entry

func (*Entry) SetExportSelection

func (w *Entry) SetExportSelection(export bool) error

func (*Entry) SetFont

func (w *Entry) SetFont(font Font) error

func (*Entry) SetForeground

func (w *Entry) SetForeground(color string) error

func (*Entry) SetJustify

func (w *Entry) SetJustify(justify Justify) error

func (*Entry) SetSelection

func (w *Entry) SetSelection(start int, end int)

func (*Entry) SetShow

func (w *Entry) SetShow(show string) error

func (*Entry) SetState

func (w *Entry) SetState(state State) error

func (*Entry) SetTakeFocus

func (w *Entry) SetTakeFocus(takefocus bool) error

func (*Entry) SetText

func (w *Entry) SetText(text string) error

func (*Entry) SetWidth

func (w *Entry) SetWidth(width int) error

func (*Entry) SetXViewArgs

func (w *Entry) SetXViewArgs(args []string) error

func (*Entry) Show

func (w *Entry) Show() string

func (*Entry) State

func (w *Entry) State() State

func (*Entry) Text

func (w *Entry) Text() string

func (*Entry) TextLength

func (w *Entry) TextLength() int

func (*Entry) Width

func (w *Entry) Width() int

type Event

type Event struct {
	//The type field from the event. Valid for all event types.
	Type int

	//The send_event field from the event. Valid for all event types.
	//0 indicates that this is a “normal” event, 1 indicates that it is a “synthetic” event generated by SendEvent.
	Synthetic bool

	//The path name of the window to which the event was reported (the window field from the event). Valid for all event types.
	Widget Widget

	//The time field from the event. This is the X server timestamp (typically the time since the last server reset) in milliseconds,
	//when the event occurred. Valid for most events.
	Timestamp int64

	//The number of the button that was pressed or released.
	//Valid only for ButtonPress and ButtonRelease events.
	MouseButton int

	//The x and y fields from the event. For ButtonPress, ButtonRelease, Motion, KeyPress, KeyRelease, and MouseWheel events,
	//%x and %y indicate the position of the mouse pointer relative to the receiving window.
	//For Enter and Leave events, the position where the mouse pointer crossed the window, relative to the receiving window.
	//For Configure and Create requests, the x and y coordinates of the window relative to its parent window.
	PosX int
	PosY int

	GlobalPosX int
	GlobalPosY int

	//This reports the delta value of a MouseWheel event.
	//The delta value represents the rotation units the mouse wheel has been moved.
	//The sign of the value represents the direction the mouse wheel was scrolled.
	WheelDelta int

	//The keycode field from the event. Valid only for KeyPress and KeyRelease events.
	KeyCode int
	KeySym  string
	KeyText string
	KeyRune rune

	//The detail or user_data field from the event. The %d is replaced by a string identifying the detail.
	//For Enter, Leave, FocusIn, and FocusOut events, the string will be one of the following:
	//NotifyAncestor NotifyNonlinearVirtual NotifyDetailNone
	//NotifyPointer NotifyInferior NotifyPointerRoot NotifyNonlinear NotifyVirtual
	//For ConfigureRequest events, the string will be one of:
	//Above Opposite Below None BottomIf TopIf
	//For virtual events, the string will be whatever value is stored in the user_data field when the event was created (typically with event generate),
	//or the empty string if the field is NULL. Virtual events corresponding to key sequence presses (see event add for details) set the user_data to NULL.
	//For events other than these, the substituted string is undefined.
	UserData string

	//The focus field from the event (0 or 1). Valid only for Enter and Leave events.
	//1 if the receiving window is the focus window or a descendant of the focus window, 0 otherwise.
	Focus bool

	//The width/height field from the event. Valid for the Configure, ConfigureRequest, Create, ResizeRequest, and Expose events.
	//Indicates the new or requested width/height of the window.
	Width  int
	Height int

	//The mode field from the event. The substituted string is one of NotifyNormal, NotifyGrab, NotifyUngrab, or NotifyWhileGrabbed.
	//Valid only for Enter, FocusIn, FocusOut, and Leave events.
	Mode string

	//The override_redirect field from the event. Valid only for Map, Reparent, and Configure events.
	OverrideRedirect string

	//The place field from the event, substituted as one of the strings PlaceOnTop or PlaceOnBottom.
	//Valid only for Circulate and CirculateRequest events.
	Place string

	//The state field from the event. For ButtonPress, ButtonRelease, Enter, KeyPress, KeyRelease, Leave, and Motion events,
	//a decimal string is substituted. For Visibility, one of the strings VisibilityUnobscured, VisibilityPartiallyObscured, and VisibilityFullyObscured is substituted.
	//For Property events, substituted with either the string NewValue (indicating that the property has been created or modified) or Delete (indicating that the property has been removed).
	State string
}

type EventAttr

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

TODO: event attr

func NativeEventAttr

func NativeEventAttr(key string, value string) *EventAttr

type FileType

type FileType struct {
	Info string
	Ext  string
}

func (FileType) String

func (v FileType) String() string

type Fill

type Fill int
const (
	FillNone Fill = iota
	FillX
	FillY
	FillBoth
)

func (Fill) String

func (v Fill) String() string

type Font

type Font interface {
	Id() string
	IsValid() bool
	String() string
	Description() string
	Family() string
	Size() int
	IsBold() bool
	IsItalic() bool
	IsUnderline() bool
	IsOverstrike() bool
}

type FontAttr

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

func FontAttrBold

func FontAttrBold() *FontAttr

func FontAttrItalic

func FontAttrItalic() *FontAttr

func FontAttrOverstrike

func FontAttrOverstrike() *FontAttr

func FontAttrUnderline

func FontAttrUnderline() *FontAttr

type Frame

type Frame struct {
	BaseWidget
}

frame

func NewFrame

func NewFrame(parent Widget, attributes ...*WidgetAttr) *Frame

func (*Frame) Attach

func (w *Frame) Attach(id string) error

func (*Frame) BorderWidth

func (w *Frame) BorderWidth() int

func (*Frame) Height

func (w *Frame) Height() int

func (*Frame) IsTakeFocus

func (w *Frame) IsTakeFocus() bool

func (*Frame) Padding

func (w *Frame) Padding() Pad

func (*Frame) PaddingN

func (w *Frame) PaddingN() (int, int)

func (*Frame) ReliefStyle

func (w *Frame) ReliefStyle() ReliefStyle

func (*Frame) SetBorderWidth

func (w *Frame) SetBorderWidth(width int) error

func (*Frame) SetHeight

func (w *Frame) SetHeight(height int) error

func (*Frame) SetPadding

func (w *Frame) SetPadding(pad Pad) error

func (*Frame) SetPaddingN

func (w *Frame) SetPaddingN(padx int, pady int) error

func (*Frame) SetReliefStyle

func (w *Frame) SetReliefStyle(relief ReliefStyle) error

func (*Frame) SetTakeFocus

func (w *Frame) SetTakeFocus(takefocus bool) error

func (*Frame) SetWidth

func (w *Frame) SetWidth(width int) error

func (*Frame) Width

func (w *Frame) Width() int

type Geometry

type Geometry struct {
	X      int
	Y      int
	Width  int
	Height int
}

type GridIndexAttr

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

func GridIndexAttrMinSize

func GridIndexAttrMinSize(amount int) *GridIndexAttr

func GridIndexAttrPad

func GridIndexAttrPad(amount int) *GridIndexAttr

func GridIndexAttrUniform

func GridIndexAttrUniform(groupname string) *GridIndexAttr

func GridIndexAttrWeight

func GridIndexAttrWeight(value int) *GridIndexAttr

type GridLayout

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

func NewGridLayout

func NewGridLayout(parent Widget) *GridLayout

func (*GridLayout) AddWidget

func (w *GridLayout) AddWidget(widget Widget, attrs ...*LayoutAttr) error

func (*GridLayout) AddWidgetEx

func (w *GridLayout) AddWidgetEx(widget Widget, row int, column int, rowspan int, columnspan int, sticky Sticky) error

func (*GridLayout) AddWidgetList

func (w *GridLayout) AddWidgetList(widgets []Widget, attrs ...*LayoutAttr) error

func (*GridLayout) AddWidgets

func (w *GridLayout) AddWidgets(widgets ...Widget) error

func (*GridLayout) BorderWidth

func (w *GridLayout) BorderWidth() int

func (*GridLayout) RemoveWidget

func (w *GridLayout) RemoveWidget(widget Widget) error

func (*GridLayout) Repack

func (w *GridLayout) Repack() error

func (*GridLayout) SetBorderWidth

func (w *GridLayout) SetBorderWidth(width int) error

func (*GridLayout) SetColumnAttr

func (w *GridLayout) SetColumnAttr(column int, pad int, weight int, group string) error

column index from 0, -1=all

func (*GridLayout) SetRowAttr

func (w *GridLayout) SetRowAttr(row int, pad int, weight int, group string) error

row index from 0, -1=all

type Image

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

func LoadImage

func LoadImage(file string, attributes ...*ImageAttr) (*Image, error)

func NewImage

func NewImage(attributes ...*ImageAttr) *Image

func (*Image) Blank

func (i *Image) Blank() *Image

func (*Image) Gamma

func (i *Image) Gamma() float64

func (*Image) Id

func (i *Image) Id() string

func (*Image) IsValid

func (i *Image) IsValid() bool

func (*Image) SetGamma

func (i *Image) SetGamma(v float64) *Image

func (*Image) SetImage

func (i *Image) SetImage(img image.Image) *Image

func (*Image) SetSize

func (i *Image) SetSize(sz Size) *Image

func (*Image) SetSizeN

func (i *Image) SetSizeN(width int, height int) *Image

func (*Image) SetZoomedImage

func (i *Image) SetZoomedImage(img image.Image, zoomX, zoomY, subsampleX, subsampleY int) *Image

func (*Image) Size

func (i *Image) Size() Size

func (*Image) SizeN

func (i *Image) SizeN() (width int, height int)

func (*Image) ToImage

func (i *Image) ToImage() image.Image

type ImageAttr

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

func ImageAttrGamma

func ImageAttrGamma(gamma float64) *ImageAttr

func ImageAttrTk85AlphaColor

func ImageAttrTk85AlphaColor(color color.Color) *ImageAttr

type Justify

type Justify int
const (
	JustifyCenter Justify = iota
	JustifyLeft
	JustifyRight
)

func (Justify) String

func (v Justify) String() string

type KeyEvent

type KeyEvent struct {
	*Event
	KeyModifier KeyModifier
}

type KeyModifier

type KeyModifier int
const (
	KeyModifierNone KeyModifier = 1 << iota
	KeyModifierShift
	KeyModifierControl
	KeyModifierAlt
	KeyModifierMeta
	KeyModifierFn
)

func (KeyModifier) String

func (k KeyModifier) String() string

type Label

type Label struct {
	BaseWidget
}

tk::label

func NewLabel

func NewLabel(parent Widget, text string, attributes ...*WidgetAttr) *Label

func (*Label) Anchor

func (w *Label) Anchor() Anchor

func (*Label) Attach

func (w *Label) Attach(id string) error

func (*Label) Background

func (w *Label) Background() string

func (*Label) BorderWidth

func (w *Label) BorderWidth() int

func (*Label) Compound

func (w *Label) Compound() Compound

func (*Label) Font

func (w *Label) Font() Font

func (*Label) Forground

func (w *Label) Forground() string

func (*Label) Image

func (w *Label) Image() *Image

func (*Label) IsTakeFocus

func (w *Label) IsTakeFocus() bool

func (*Label) Justify

func (w *Label) Justify() Justify

func (*Label) Padding

func (w *Label) Padding() Pad

func (*Label) PaddingN

func (w *Label) PaddingN() (int, int)

func (*Label) ReliefStyle

func (w *Label) ReliefStyle() ReliefStyle

func (*Label) SetAnchor

func (w *Label) SetAnchor(anchor Anchor) error

func (*Label) SetBackground

func (w *Label) SetBackground(color string) error

func (*Label) SetBorderWidth

func (w *Label) SetBorderWidth(width int) error

func (*Label) SetCompound

func (w *Label) SetCompound(compound Compound) error

func (*Label) SetFont

func (w *Label) SetFont(font Font) error

func (*Label) SetForground

func (w *Label) SetForground(color string) error

func (*Label) SetImage

func (w *Label) SetImage(image *Image) error

func (*Label) SetJustify

func (w *Label) SetJustify(justify Justify) error

func (*Label) SetPadding

func (w *Label) SetPadding(pad Pad) error

func (*Label) SetPaddingN

func (w *Label) SetPaddingN(padx int, pady int) error

func (*Label) SetReliefStyle

func (w *Label) SetReliefStyle(relief ReliefStyle) error

func (*Label) SetState

func (w *Label) SetState(state State) error

func (*Label) SetTakeFocus

func (w *Label) SetTakeFocus(takefocus bool) error

func (*Label) SetText

func (w *Label) SetText(text string) error

func (*Label) SetWidth

func (w *Label) SetWidth(width int) error

func (*Label) SetWrapLength

func (w *Label) SetWrapLength(wraplength int) error

func (*Label) State

func (w *Label) State() State

func (*Label) Text

func (w *Label) Text() string

func (*Label) Width

func (w *Label) Width() int

func (*Label) WrapLength

func (w *Label) WrapLength() int

type LabelFrame

type LabelFrame struct {
	BaseWidget
}

label frame

func NewLabelFrame

func NewLabelFrame(parent Widget, attributes ...*WidgetAttr) *LabelFrame

func (*LabelFrame) Attach

func (w *LabelFrame) Attach(id string) error

func (*LabelFrame) BorderWidth

func (w *LabelFrame) BorderWidth() int

func (*LabelFrame) Height

func (w *LabelFrame) Height() int

func (*LabelFrame) IsTakeFocus

func (w *LabelFrame) IsTakeFocus() bool

func (*LabelFrame) LabelAnchor

func (w *LabelFrame) LabelAnchor() Anchor

func (*LabelFrame) LabelText

func (w *LabelFrame) LabelText() string

func (*LabelFrame) Padding

func (w *LabelFrame) Padding() Pad

func (*LabelFrame) PaddingN

func (w *LabelFrame) PaddingN() (int, int)

func (*LabelFrame) ReliefStyle

func (w *LabelFrame) ReliefStyle() ReliefStyle

func (*LabelFrame) SetBorderWidth

func (w *LabelFrame) SetBorderWidth(width int) error

func (*LabelFrame) SetHeight

func (w *LabelFrame) SetHeight(height int) error

func (*LabelFrame) SetLabelAnchor

func (w *LabelFrame) SetLabelAnchor(anchor Anchor) error

func (*LabelFrame) SetLabelText

func (w *LabelFrame) SetLabelText(text string) error

func (*LabelFrame) SetPadding

func (w *LabelFrame) SetPadding(pad Pad) error

func (*LabelFrame) SetPaddingN

func (w *LabelFrame) SetPaddingN(padx int, pady int) error

func (*LabelFrame) SetReliefStyle

func (w *LabelFrame) SetReliefStyle(relief ReliefStyle) error

func (*LabelFrame) SetTakeFocus

func (w *LabelFrame) SetTakeFocus(takefocus bool) error

func (*LabelFrame) SetWidth

func (w *LabelFrame) SetWidth(width int) error

func (*LabelFrame) Width

func (w *LabelFrame) Width() int

type Layout

type Layout interface {
	Widget
	AddWidget(widget Widget, attrs ...*LayoutAttr)
	AddLayout(layout Layout, attrs ...*LayoutAttr)
	RemoveWidget(widget Widget) bool
	RemoveLayout(layout Layout) bool
}

type LayoutAttr

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

func AppendLayoutAttrs

func AppendLayoutAttrs(org []*LayoutAttr, attributes ...*LayoutAttr) []*LayoutAttr

func GridAttrColumn

func GridAttrColumn(n int) *LayoutAttr

func GridAttrColumnSpan

func GridAttrColumnSpan(n int) *LayoutAttr

func GridAttrInMaster

func GridAttrInMaster(w Widget) *LayoutAttr

func GridAttrIpadx

func GridAttrIpadx(padx int) *LayoutAttr

func GridAttrIpady

func GridAttrIpady(pady int) *LayoutAttr

func GridAttrPadx

func GridAttrPadx(padx int) *LayoutAttr

func GridAttrPady

func GridAttrPady(pady int) *LayoutAttr

func GridAttrRow

func GridAttrRow(n int) *LayoutAttr

func GridAttrRowSpan

func GridAttrRowSpan(n int) *LayoutAttr

func GridAttrSticky

func GridAttrSticky(v Sticky) *LayoutAttr

func PackAttrAfter

func PackAttrAfter(w Widget) *LayoutAttr

func PackAttrAnchor

func PackAttrAnchor(anchor Anchor) *LayoutAttr

func PackAttrBefore

func PackAttrBefore(w Widget) *LayoutAttr

func PackAttrExpand

func PackAttrExpand(b bool) *LayoutAttr

func PackAttrFill

func PackAttrFill(fill Fill) *LayoutAttr

func PackAttrFillBoth

func PackAttrFillBoth() *LayoutAttr

func PackAttrFillNone

func PackAttrFillNone() *LayoutAttr

func PackAttrFillX

func PackAttrFillX() *LayoutAttr

func PackAttrFillY

func PackAttrFillY() *LayoutAttr

func PackAttrInMaster

func PackAttrInMaster(w Widget) *LayoutAttr

func PackAttrIpadx

func PackAttrIpadx(padx int) *LayoutAttr

func PackAttrIpady

func PackAttrIpady(pady int) *LayoutAttr

func PackAttrPadx

func PackAttrPadx(padx int) *LayoutAttr

func PackAttrPady

func PackAttrPady(pady int) *LayoutAttr

func PackAttrSide

func PackAttrSide(side Side) *LayoutAttr

func PackAttrSideBottom

func PackAttrSideBottom() *LayoutAttr

func PackAttrSideLeft

func PackAttrSideLeft() *LayoutAttr

func PackAttrSideRight

func PackAttrSideRight() *LayoutAttr

func PackAttrSideTop

func PackAttrSideTop() *LayoutAttr

func PlaceAttrAnchor

func PlaceAttrAnchor(anchor Anchor) *LayoutAttr

func PlaceAttrBorderMode

func PlaceAttrBorderMode(mode BorderMode) *LayoutAttr

func PlaceAttrHeight

func PlaceAttrHeight(size int) *LayoutAttr

func PlaceAttrInMaster

func PlaceAttrInMaster(w Widget) *LayoutAttr

func PlaceAttrRelHeight

func PlaceAttrRelHeight(size float64) *LayoutAttr

func PlaceAttrRelWidth

func PlaceAttrRelWidth(size float64) *LayoutAttr

func PlaceAttrRelX

func PlaceAttrRelX(location float64) *LayoutAttr

func PlaceAttrRelY

func PlaceAttrRelY(location float64) *LayoutAttr

func PlaceAttrWidth

func PlaceAttrWidth(size int) *LayoutAttr

func PlaceAttrX

func PlaceAttrX(location int) *LayoutAttr

func PlaceAttrY

func PlaceAttrY(location int) *LayoutAttr

type LayoutFrame

type LayoutFrame struct {
	BaseWidget
}

func NewLayoutFrame

func NewLayoutFrame(parent Widget, attributes ...*WidgetAttr) *LayoutFrame

func (*LayoutFrame) Type

func (w *LayoutFrame) Type() WidgetType

func (*LayoutFrame) TypeName

func (w *LayoutFrame) TypeName() string

type LayoutItem

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

type LayoutSpacer

type LayoutSpacer struct {
	BaseWidget
	// contains filtered or unexported fields
}

func NewLayoutSpacer

func NewLayoutSpacer(parent Widget, space int, expand bool) *LayoutSpacer

func (*LayoutSpacer) Height

func (w *LayoutSpacer) Height() int

func (*LayoutSpacer) IsExpand

func (w *LayoutSpacer) IsExpand() bool

func (*LayoutSpacer) SetExpand

func (w *LayoutSpacer) SetExpand(expand bool) *LayoutSpacer

func (*LayoutSpacer) SetHeight

func (w *LayoutSpacer) SetHeight(height int) *LayoutSpacer

height ignore for PackLayout

func (*LayoutSpacer) SetSpace

func (w *LayoutSpacer) SetSpace(space int) *LayoutSpacer

func (*LayoutSpacer) SetWidth

func (w *LayoutSpacer) SetWidth(width int) *LayoutSpacer

width ignore for PackLayout

func (*LayoutSpacer) Space

func (w *LayoutSpacer) Space() int

func (*LayoutSpacer) Type

func (w *LayoutSpacer) Type() WidgetType

func (*LayoutSpacer) TypeName

func (w *LayoutSpacer) TypeName() string

func (*LayoutSpacer) Width

func (w *LayoutSpacer) Width() int

type LayoutWidget

type LayoutWidget interface {
	Widget
	LayoutWidget() Widget
}

type LineWrapMode

type LineWrapMode int

func (LineWrapMode) String

func (v LineWrapMode) String() string

type ListBox

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

listbox

func NewListBox

func NewListBox(parent Widget, attributes ...*WidgetAttr) *ListBox

func (*ListBox) AppendItem

func (w *ListBox) AppendItem(index int, item string) *ListBox

func (*ListBox) AppendItems

func (w *ListBox) AppendItems(items []string) *ListBox

func (*ListBox) Attach

func (w *ListBox) Attach(id string) error

func (*ListBox) Background

func (w *ListBox) Background() string

func (*ListBox) BindXScrollBar

func (w *ListBox) BindXScrollBar(bar *ScrollBar) error

func (*ListBox) BindYScrollBar

func (w *ListBox) BindYScrollBar(bar *ScrollBar) error

func (*ListBox) BorderWidth

func (w *ListBox) BorderWidth() int

func (*ListBox) ClearSelection

func (w *ListBox) ClearSelection() *ListBox

func (*ListBox) Font

func (w *ListBox) Font() Font

func (*ListBox) Forground

func (w *ListBox) Forground() string

func (*ListBox) Height

func (w *ListBox) Height() int

func (*ListBox) InsertItem

func (w *ListBox) InsertItem(index int, item string) *ListBox

func (*ListBox) IsTakeFocus

func (w *ListBox) IsTakeFocus() bool

func (*ListBox) ItemCount

func (w *ListBox) ItemCount() int

func (*ListBox) ItemText

func (w *ListBox) ItemText(index int) string

func (*ListBox) Items

func (w *ListBox) Items() []string

func (*ListBox) Justify

func (w *ListBox) Justify() Justify

func (*ListBox) OnSelectionChanged

func (w *ListBox) OnSelectionChanged(fn func()) error

func (*ListBox) OnXScrollEx

func (w *ListBox) OnXScrollEx(fn func([]string) error) error

func (*ListBox) OnYScrollEx

func (w *ListBox) OnYScrollEx(fn func([]string) error) error

func (*ListBox) Padding

func (w *ListBox) Padding() Pad

func (*ListBox) PaddingN

func (w *ListBox) PaddingN() (int, int)

func (*ListBox) ReliefStyle

func (w *ListBox) ReliefStyle() ReliefStyle

func (*ListBox) RemoveItem

func (w *ListBox) RemoveItem(index int) error

func (*ListBox) RemoveItemRange

func (w *ListBox) RemoveItemRange(start int, end int) error

func (*ListBox) SelectMode

func (w *ListBox) SelectMode() ListSelectMode

func (*ListBox) SelectedIndexs

func (w *ListBox) SelectedIndexs() []int

func (*ListBox) SelectedItems

func (w *ListBox) SelectedItems() (items []string)

func (*ListBox) SetBackground

func (w *ListBox) SetBackground(color string) error

func (*ListBox) SetBorderWidth

func (w *ListBox) SetBorderWidth(width int) error

func (*ListBox) SetFont

func (w *ListBox) SetFont(font Font) error

func (*ListBox) SetForground

func (w *ListBox) SetForground(color string) error

func (*ListBox) SetHeight

func (w *ListBox) SetHeight(height int) error

func (*ListBox) SetItemText

func (w *ListBox) SetItemText(index int, item string) *ListBox

func (*ListBox) SetItems

func (w *ListBox) SetItems(items []string) *ListBox

func (*ListBox) SetJustify

func (w *ListBox) SetJustify(justify Justify) error

func (*ListBox) SetPadding

func (w *ListBox) SetPadding(pad Pad) error

func (*ListBox) SetPaddingN

func (w *ListBox) SetPaddingN(padx int, pady int) error

func (*ListBox) SetReliefStyle

func (w *ListBox) SetReliefStyle(relief ReliefStyle) error

func (*ListBox) SetSelectMode

func (w *ListBox) SetSelectMode(mode ListSelectMode) error

func (*ListBox) SetSelectionRange

func (w *ListBox) SetSelectionRange(start int, end int) *ListBox

func (*ListBox) SetState

func (w *ListBox) SetState(state State) error

func (*ListBox) SetTakeFocus

func (w *ListBox) SetTakeFocus(takefocus bool) error

func (*ListBox) SetWidth

func (w *ListBox) SetWidth(width int) error

func (*ListBox) SetXViewArgs

func (w *ListBox) SetXViewArgs(args []string) error

func (*ListBox) SetYViewArgs

func (w *ListBox) SetYViewArgs(args []string) error

func (*ListBox) State

func (w *ListBox) State() State

func (*ListBox) Width

func (w *ListBox) Width() int

type ListBoxEx

type ListBoxEx struct {
	*ScrollLayout
	*ListBox
}

func NewListBoxEx

func NewListBoxEx(parent Widget, attributs ...*WidgetAttr) *ListBoxEx

type ListSelectMode

type ListSelectMode int

func (ListSelectMode) String

func (v ListSelectMode) String() string
type Menu struct {
	BaseWidget
}

menu

func NewMenu

func NewMenu(parent Widget, attributes ...*WidgetAttr) *Menu
func (w *Menu) ActiveBackground() string
func (w *Menu) ActiveBorderWidth() int
func (w *Menu) ActiveForground() string
func (w *Menu) AddAction(act *Action) error
func (w *Menu) AddActions(actions []*Action)
func (w *Menu) AddNewSubMenu(label string, attributes ...*WidgetAttr) *Menu
func (w *Menu) AddSeparator() error
func (w *Menu) AddSubMenu(label string, sub *Menu) error
func (w *Menu) Attach(id string) error
func (w *Menu) Background() string
func (w *Menu) BorderWidth() int
func (w *Menu) DisabledForground() string
func (w *Menu) Font() Font
func (w *Menu) Forground() string
func (w *Menu) InsertAction(index int, act *Action) error
func (w *Menu) InsertNewSubMenu(index int, label string, attributes ...*WidgetAttr) *Menu
func (w *Menu) InsertSeparator(index int) error
func (w *Menu) InsertSubMenu(index int, label string, sub *Menu) error
func (w *Menu) IsTakeFocus() bool
func (w *Menu) IsTearoff() bool
func (w *Menu) ReliefStyle() ReliefStyle
func (w *Menu) SelectColor() string
func (w *Menu) SetActiveBackground(color string) error
func (w *Menu) SetActiveBorderWidth(width int) error
func (w *Menu) SetActiveForground(color string) error
func (w *Menu) SetBackground(color string) error
func (w *Menu) SetBorderWidth(width int) error
func (w *Menu) SetDisabledForground(color string) error
func (w *Menu) SetFont(font Font) error
func (w *Menu) SetForground(color string) error
func (w *Menu) SetReliefStyle(relief ReliefStyle) error
func (w *Menu) SetSelectColor(color string) error
func (w *Menu) SetTakeFocus(takefocus bool) error
func (w *Menu) SetTearoff(tearoff bool) error
func (w *Menu) SetTearoffTitle(title string) error
func (w *Menu) TearoffTitle() string
type MenuButton struct {
	BaseWidget
}

menubutton

func NewMenuButton

func NewMenuButton(parent Widget, text string, attributes ...*WidgetAttr) *MenuButton
func (w *MenuButton) Attach(id string) error
func (w *MenuButton) Compound() Compound
func (w *MenuButton) Direction() Direction
func (w *MenuButton) Image() *Image
func (w *MenuButton) IsTakeFocus() bool
func (w *MenuButton) Menu() *Menu
func (w *MenuButton) Padding() Pad
func (w *MenuButton) PaddingN() (int, int)
func (w *MenuButton) SetCompound(compound Compound) error
func (w *MenuButton) SetDirection(direction Direction) error
func (w *MenuButton) SetImage(image *Image) error
func (w *MenuButton) SetMenu(menu *Menu) error
func (w *MenuButton) SetPadding(pad Pad) error
func (w *MenuButton) SetPaddingN(padx int, pady int) error
func (w *MenuButton) SetState(state State) error
func (w *MenuButton) SetTakeFocus(takefocus bool) error
func (w *MenuButton) SetText(text string) error
func (w *MenuButton) SetWidth(width int) error
func (w *MenuButton) State() State
func (w *MenuButton) Text() string
func (w *MenuButton) Width() int

type MessageBoxIcon

type MessageBoxIcon int
const (
	MessageBoxIconNone MessageBoxIcon = iota
	MessageBoxIconError
	MessageBoxIconInfo
	MessageBoxIconQuestion
	MessageBoxIconWarning
)

func (MessageBoxIcon) String

func (v MessageBoxIcon) String() string

type MessageBoxType

type MessageBoxType int
const (
	MessageBoxTypeOk MessageBoxType = iota
	MessageBoxTypeOkCancel
	MessageBoxTypeAbortRetryIgnore
	MessageBoxTypeRetryCancel
	MessageBoxTypeYesNo
	MessageBoxTypeYesNoCancel
)

func (MessageBoxType) String

func (v MessageBoxType) String() string

type MetaClass

type MetaClass struct {
	Command    string
	Class      string
	Attributes []string
}

func (*MetaClass) HasAttribute

func (m *MetaClass) HasAttribute(attr string) bool

type MetaType

type MetaType struct {
	Type string
	Tk   *MetaClass
	Ttk  *MetaClass
}

type NamedId

type NamedId interface {
	GetId(name string) string
}

func NewNamedId

func NewNamedId(safe bool) NamedId

type NativeAttr

type NativeAttr struct {
	Key   string
	Value string
}

type Notebook

type Notebook struct {
	BaseWidget
}

notebook

func NewNotebook

func NewNotebook(parent Widget, attributes ...*WidgetAttr) *Notebook

func (*Notebook) AddTab

func (w *Notebook) AddTab(widget Widget, text string, attributes ...*WidgetAttr) error

func (*Notebook) Attach

func (w *Notebook) Attach(id string) error

func (*Notebook) CurrentTab

func (w *Notebook) CurrentTab() Widget

func (*Notebook) CurrentTabIndex

func (w *Notebook) CurrentTabIndex() int

func (*Notebook) Height

func (w *Notebook) Height() int

func (*Notebook) InsertTab

func (w *Notebook) InsertTab(pos int, widget Widget, text string, attributes ...*WidgetAttr) error

func (*Notebook) IsTakeFocus

func (w *Notebook) IsTakeFocus() bool

func (*Notebook) Padding

func (w *Notebook) Padding() Pad

func (*Notebook) PaddingN

func (w *Notebook) PaddingN() (int, int)

func (*Notebook) RemoveTab

func (w *Notebook) RemoveTab(widget Widget) error

func (*Notebook) SetCurrentTab

func (w *Notebook) SetCurrentTab(widget Widget) error

func (*Notebook) SetHeight

func (w *Notebook) SetHeight(height int) error

func (*Notebook) SetPadding

func (w *Notebook) SetPadding(pad Pad) error

func (*Notebook) SetPaddingN

func (w *Notebook) SetPaddingN(padx int, pady int) error

func (*Notebook) SetTab

func (w *Notebook) SetTab(widget Widget, text string, attributes ...*WidgetAttr) error

func (*Notebook) SetTakeFocus

func (w *Notebook) SetTakeFocus(takefocus bool) error

func (*Notebook) SetWidth

func (w *Notebook) SetWidth(width int) error

func (*Notebook) TabCount

func (w *Notebook) TabCount() int

func (*Notebook) TabIndex

func (w *Notebook) TabIndex(widget Widget) int

func (*Notebook) Width

func (w *Notebook) Width() int

type Orient

type Orient int
const (
	Vertical Orient = iota
	Horizontal
)

func (Orient) String

func (v Orient) String() string

type PackLayout

type PackLayout struct {
	*LayoutFrame
	// contains filtered or unexported fields
}

func NewHPackLayout

func NewHPackLayout(parent Widget) *PackLayout

func NewPackLayout

func NewPackLayout(parent Widget, side Side) *PackLayout

func NewVPackLayout

func NewVPackLayout(parent Widget) *PackLayout

func (*PackLayout) AddWidget

func (w *PackLayout) AddWidget(widget Widget, attributes ...*LayoutAttr) error

func (*PackLayout) AddWidgetEx

func (w *PackLayout) AddWidgetEx(widget Widget, fill Fill, expand bool, anchor Anchor) error

func (*PackLayout) AddWidgetList

func (w *PackLayout) AddWidgetList(widgets []Widget, attributes ...*LayoutAttr) error

func (*PackLayout) AddWidgets

func (w *PackLayout) AddWidgets(widgets ...Widget) error

func (*PackLayout) BorderWidth

func (w *PackLayout) BorderWidth() int

func (*PackLayout) InsertWidget

func (w *PackLayout) InsertWidget(index int, widget Widget, attributes ...*LayoutAttr) error

func (*PackLayout) InsertWidgetEx

func (w *PackLayout) InsertWidgetEx(index int, widget Widget, fill Fill, expand bool, anchor Anchor) error

func (*PackLayout) RemoveWidget

func (w *PackLayout) RemoveWidget(widget Widget) error

func (*PackLayout) Repack

func (w *PackLayout) Repack() error

func (*PackLayout) SetBorderWidth

func (w *PackLayout) SetBorderWidth(width int) error

func (*PackLayout) SetPadding

func (w *PackLayout) SetPadding(pad Pad) error

func (*PackLayout) SetPaddingN

func (w *PackLayout) SetPaddingN(padx int, pady int) error

func (*PackLayout) SetSide

func (w *PackLayout) SetSide(side Side) error

func (*PackLayout) SetWidgetAttr

func (w *PackLayout) SetWidgetAttr(widget Widget, attributes ...*LayoutAttr) error

type Pad

type Pad struct {
	X int
	Y int
}

type Paned

type Paned struct {
	BaseWidget
}

panedwindow

func NewPaned

func NewPaned(parent Widget, orient Orient, attributes ...*WidgetAttr) *Paned

func (*Paned) AddWidget

func (w *Paned) AddWidget(widget Widget, weight int) error

func (*Paned) Attach

func (w *Paned) Attach(id string) error

func (*Paned) Height

func (w *Paned) Height() int

func (*Paned) InsertWidget

func (w *Paned) InsertWidget(pane int, widget Widget, weight int) error

func (*Paned) RemovePane

func (w *Paned) RemovePane(pane int) error

func (*Paned) SetHeight

func (w *Paned) SetHeight(height int) error

func (*Paned) SetPane

func (w *Paned) SetPane(pane int, weight int) error

func (*Paned) SetWidth

func (w *Paned) SetWidth(width int) error

func (*Paned) Width

func (w *Paned) Width() int

type PlaceFrame

type PlaceFrame struct {
	*Frame
	// contains filtered or unexported fields
}

func NewPlaceFrame

func NewPlaceFrame(parent Widget) *PlaceFrame

func (*PlaceFrame) AddWidget

func (w *PlaceFrame) AddWidget(widget Widget, attributes ...*LayoutAttr) error

func (*PlaceFrame) InsertWidget

func (w *PlaceFrame) InsertWidget(index int, widget Widget, attributes ...*LayoutAttr) error

func (*PlaceFrame) RemoveWidget

func (w *PlaceFrame) RemoveWidget(widget Widget) error

func (*PlaceFrame) Repack

func (w *PlaceFrame) Repack() error

func (*PlaceFrame) SetWidgetAttr

func (w *PlaceFrame) SetWidgetAttr(widget Widget, attributes ...*LayoutAttr) error

type Pos

type Pos struct {
	X int
	Y int
}

type ProgressBar

type ProgressBar struct {
	BaseWidget
}

progressbar

func NewProgressBar

func NewProgressBar(parent Widget, orient Orient, attributes ...*WidgetAttr) *ProgressBar

func (*ProgressBar) Attach

func (w *ProgressBar) Attach(id string) error

func (*ProgressBar) IsDeterminateMode

func (w *ProgressBar) IsDeterminateMode() bool

func (*ProgressBar) IsTakeFocus

func (w *ProgressBar) IsTakeFocus() bool

func (*ProgressBar) Length

func (w *ProgressBar) Length() int

func (*ProgressBar) Maximum

func (w *ProgressBar) Maximum() float64

func (*ProgressBar) Orient

func (w *ProgressBar) Orient() Orient

func (*ProgressBar) Pause

func (w *ProgressBar) Pause() error

func (*ProgressBar) Phase

func (w *ProgressBar) Phase() int

func (*ProgressBar) SetDeterminateMode

func (w *ProgressBar) SetDeterminateMode(b bool) error

func (*ProgressBar) SetLength

func (w *ProgressBar) SetLength(length int) error

func (*ProgressBar) SetMaximum

func (w *ProgressBar) SetMaximum(maximum float64) error

func (*ProgressBar) SetOrient

func (w *ProgressBar) SetOrient(orient Orient) error

func (*ProgressBar) SetTakeFocus

func (w *ProgressBar) SetTakeFocus(takefocus bool) error

func (*ProgressBar) SetValue

func (w *ProgressBar) SetValue(value float64) error

func (*ProgressBar) Start

func (w *ProgressBar) Start() error

func (*ProgressBar) StartEx

func (w *ProgressBar) StartEx(ms int) error

func (*ProgressBar) Stop

func (w *ProgressBar) Stop() error

func (*ProgressBar) Value

func (w *ProgressBar) Value() float64

type RadioButton

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

radio button

func NewRadioButton

func NewRadioButton(parent Widget, text string, attributes ...*WidgetAttr) *RadioButton

func (*RadioButton) Attach

func (w *RadioButton) Attach(id string) error

func (*RadioButton) Compound

func (w *RadioButton) Compound() Compound

func (*RadioButton) Image

func (w *RadioButton) Image() *Image

func (*RadioButton) Invoke

func (w *RadioButton) Invoke()

func (*RadioButton) IsChecked

func (w *RadioButton) IsChecked() bool

func (*RadioButton) IsTakeFocus

func (w *RadioButton) IsTakeFocus() bool

func (*RadioButton) OnCommand

func (w *RadioButton) OnCommand(fn func()) error

func (*RadioButton) Padding

func (w *RadioButton) Padding() Pad

func (*RadioButton) PaddingN

func (w *RadioButton) PaddingN() (int, int)

func (*RadioButton) SetChecked

func (w *RadioButton) SetChecked(check bool) *RadioButton

func (*RadioButton) SetCompound

func (w *RadioButton) SetCompound(compound Compound) error

func (*RadioButton) SetImage

func (w *RadioButton) SetImage(image *Image) error

func (*RadioButton) SetPadding

func (w *RadioButton) SetPadding(pad Pad) error

func (*RadioButton) SetPaddingN

func (w *RadioButton) SetPaddingN(padx int, pady int) error

func (*RadioButton) SetState

func (w *RadioButton) SetState(state State) error

func (*RadioButton) SetTakeFocus

func (w *RadioButton) SetTakeFocus(takefocus bool) error

func (*RadioButton) SetText

func (w *RadioButton) SetText(text string) error

func (*RadioButton) SetWidth

func (w *RadioButton) SetWidth(width int) error

func (*RadioButton) State

func (w *RadioButton) State() State

func (*RadioButton) Text

func (w *RadioButton) Text() string

func (*RadioButton) Width

func (w *RadioButton) Width() int

type RadioGroup

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

func NewRadioGroup

func NewRadioGroup() *RadioGroup

func (*RadioGroup) AddNewRadio

func (w *RadioGroup) AddNewRadio(parent Widget, text string, data interface{}, attributes ...*WidgetAttr) *RadioButton

func (*RadioGroup) AddRadio

func (w *RadioGroup) AddRadio(btn *RadioButton, data interface{}) error

func (*RadioGroup) AddRadios

func (w *RadioGroup) AddRadios(btns ...*RadioButton) error

func (*RadioGroup) CheckedData

func (w *RadioGroup) CheckedData() interface{}

func (*RadioGroup) CheckedIndex

func (w *RadioGroup) CheckedIndex() int

func (*RadioGroup) CheckedRadio

func (w *RadioGroup) CheckedRadio() *RadioButton

func (*RadioGroup) IsValid

func (w *RadioGroup) IsValid() bool

func (*RadioGroup) OnRadioChanged

func (w *RadioGroup) OnRadioChanged(fn func()) error

func (*RadioGroup) RadioData

func (w *RadioGroup) RadioData(btn *RadioButton) interface{}

func (*RadioGroup) RadioList

func (w *RadioGroup) RadioList() (lst []*RadioButton)

func (*RadioGroup) SetCheckedIndex

func (w *RadioGroup) SetCheckedIndex(index int) error

func (*RadioGroup) SetCheckedRadio

func (w *RadioGroup) SetCheckedRadio(btn *RadioButton) error

func (*RadioGroup) SetRadioData

func (w *RadioGroup) SetRadioData(btn *RadioButton, data interface{}) error

func (*RadioGroup) WidgetList

func (w *RadioGroup) WidgetList() (lst []Widget)

type ReliefStyle

type ReliefStyle int
const (
	ReliefStyleFlat ReliefStyle = iota
	ReliefStyleGroove
	ReliefStyleRaised
	ReliefStyleRidge
	ReliefStyleSolid
	ReliefStyleSunken
)

func (ReliefStyle) String

func (v ReliefStyle) String() string

type Scale

type Scale struct {
	BaseWidget
	// contains filtered or unexported fields
}

scale

func NewScale

func NewScale(parent Widget, orient Orient, attributes ...*WidgetAttr) *Scale

func (*Scale) Attach

func (w *Scale) Attach(id string) error

func (*Scale) From

func (w *Scale) From() float64

func (*Scale) IsTakeFocus

func (w *Scale) IsTakeFocus() bool

func (*Scale) Length

func (w *Scale) Length() int

func (*Scale) OnCommand

func (w *Scale) OnCommand(fn func()) error

func (*Scale) Orient

func (w *Scale) Orient() Orient

func (*Scale) SetFrom

func (w *Scale) SetFrom(from float64) error

func (*Scale) SetLength

func (w *Scale) SetLength(length int) error

func (*Scale) SetOrient

func (w *Scale) SetOrient(orient Orient) error

func (*Scale) SetTakeFocus

func (w *Scale) SetTakeFocus(takefocus bool) error

func (*Scale) SetTo

func (w *Scale) SetTo(to float64) error

func (*Scale) SetValue

func (w *Scale) SetValue(value float64) error

func (*Scale) To

func (w *Scale) To() float64

func (*Scale) Value

func (w *Scale) Value() float64

type ScrollBar

type ScrollBar struct {
	BaseWidget
	// contains filtered or unexported fields
}

scrollbar

func NewScrollBar

func NewScrollBar(parent Widget, orient Orient, attributes ...*WidgetAttr) *ScrollBar

func (*ScrollBar) Attach

func (w *ScrollBar) Attach(id string) error

func (*ScrollBar) IsTakeFocus

func (w *ScrollBar) IsTakeFocus() bool

func (*ScrollBar) OnCommandEx

func (w *ScrollBar) OnCommandEx(fn func([]string) error) error

func (*ScrollBar) Orient

func (w *ScrollBar) Orient() Orient

func (*ScrollBar) SetOrient

func (w *ScrollBar) SetOrient(orient Orient) error

func (*ScrollBar) SetScroll

func (w *ScrollBar) SetScroll(first float64, last float64) error

func (*ScrollBar) SetScrollArgs

func (w *ScrollBar) SetScrollArgs(args []string) error

func (*ScrollBar) SetTakeFocus

func (w *ScrollBar) SetTakeFocus(takefocus bool) error

type ScrollLayout

type ScrollLayout struct {
	*GridLayout
	XScrollBar *ScrollBar
	YScrollBar *ScrollBar
}

func NewScrollLayout

func NewScrollLayout(parent Widget) *ScrollLayout

func (*ScrollLayout) Id

func (w *ScrollLayout) Id() string

func (*ScrollLayout) SetWidget

func (w *ScrollLayout) SetWidget(widget Widget) error

func (*ScrollLayout) ShowXScrollBar

func (w *ScrollLayout) ShowXScrollBar(b bool) (err error)

func (*ScrollLayout) ShowYScrollBar

func (w *ScrollLayout) ShowYScrollBar(b bool) (err error)

type Separator

type Separator struct {
	BaseWidget
}

separator

func NewSeparator

func NewSeparator(parent Widget, orient Orient, attributes ...*WidgetAttr) *Separator

func (*Separator) Attach

func (w *Separator) Attach(id string) error

func (*Separator) IsTakeFocus

func (w *Separator) IsTakeFocus() bool

func (*Separator) Orient

func (w *Separator) Orient() Orient

func (*Separator) SetOrient

func (w *Separator) SetOrient(orient Orient) error

func (*Separator) SetTakeFocus

func (w *Separator) SetTakeFocus(takefocus bool) error

type Side

type Side int
const (
	SideLeft Side = iota
	SideRight
	SideTop
	SideBottom
)

func (Side) String

func (v Side) String() string

type Size

type Size struct {
	Width  int
	Height int
}

type SpinBox

type SpinBox struct {
	BaseWidget
	// contains filtered or unexported fields
}

spinbox

func NewSpinBox

func NewSpinBox(parent Widget, attributes ...*WidgetAttr) *SpinBox

func (*SpinBox) Attach

func (w *SpinBox) Attach(id string) error

func (*SpinBox) Entry

func (w *SpinBox) Entry() *Entry

func (*SpinBox) From

func (w *SpinBox) From() float64

func (*SpinBox) Increment

func (w *SpinBox) Increment() float64

func (*SpinBox) IsTakeFocus

func (w *SpinBox) IsTakeFocus() bool

func (*SpinBox) IsWrap

func (w *SpinBox) IsWrap() bool

func (*SpinBox) OnCommand

func (w *SpinBox) OnCommand(fn func()) error

func (*SpinBox) OnEditReturn

func (w *SpinBox) OnEditReturn(fn func()) error

func (*SpinBox) OnXScrollEx

func (w *SpinBox) OnXScrollEx(fn func([]string) error) error

func (*SpinBox) SetFrom

func (w *SpinBox) SetFrom(from float64) error

func (*SpinBox) SetIncrement

func (w *SpinBox) SetIncrement(increment float64) error

func (*SpinBox) SetRange

func (w *SpinBox) SetRange(from, to float64) error

func (*SpinBox) SetTakeFocus

func (w *SpinBox) SetTakeFocus(takefocus bool) error

func (*SpinBox) SetTextValue

func (w *SpinBox) SetTextValue(value string) error

func (*SpinBox) SetTextValues

func (w *SpinBox) SetTextValues(values []string) error

func (*SpinBox) SetTo

func (w *SpinBox) SetTo(to float64) error

func (*SpinBox) SetValue

func (w *SpinBox) SetValue(value float64) error

func (*SpinBox) SetWrap

func (w *SpinBox) SetWrap(wrap bool) error

func (*SpinBox) TextValue

func (w *SpinBox) TextValue() string

func (*SpinBox) TextValues

func (w *SpinBox) TextValues() []string

func (*SpinBox) To

func (w *SpinBox) To() float64

func (*SpinBox) Value

func (w *SpinBox) Value() float64

type State

type State int

func (State) String

func (v State) String() string

type Sticky

type Sticky int

func (Sticky) String

func (v Sticky) String() string

type SysFont

type SysFont struct {
	BaseFont
}

tk system default font

func LoadSysFont

func LoadSysFont(typ SysFontType) *SysFont

type SysFontType

type SysFontType int
const (
	SysDefaultFont SysFontType = 0
	SysTextFont
	SysFixedFont
	SysMenuFont
	SysHeadingFont
	SysCaptionFont
	SysSmallCaptionFont
	SysIconFont
	SysTooltipFont
)

type Text

type Text struct {
	BaseWidget
	// contains filtered or unexported fields
}

Create and manipulate 'text' hypertext editing widgets

func NewText

func NewText(parent Widget, attributes ...*WidgetAttr) *Text

func (*Text) AppendText

func (w *Text) AppendText(text string) error

func (*Text) Attach

func (w *Text) Attach(id string) error

func (*Text) Background

func (w *Text) Background() string

func (*Text) BindXScrollBar

func (w *Text) BindXScrollBar(bar *ScrollBar) error

func (*Text) BindYScrollBar

func (w *Text) BindYScrollBar(bar *ScrollBar) error

func (*Text) BorderWidth

func (w *Text) BorderWidth() int

func (*Text) Clear

func (w *Text) Clear() error

func (*Text) EndLine

func (w *Text) EndLine() int

func (*Text) Font

func (w *Text) Font() Font

func (*Text) Foreground

func (w *Text) Foreground() string

func (*Text) Height

func (w *Text) Height() int

func (*Text) HighlightBackground

func (w *Text) HighlightBackground() string

func (*Text) HighlightColor

func (w *Text) HighlightColor() string

func (*Text) Highlightthickness

func (w *Text) Highlightthickness() int

func (*Text) InactiveSelectBackground

func (w *Text) InactiveSelectBackground() string

func (*Text) InsertBackground

func (w *Text) InsertBackground() string

func (*Text) InsertBorderWidth

func (w *Text) InsertBorderWidth() int

func (*Text) InsertOffTime

func (w *Text) InsertOffTime() int

func (*Text) InsertOnTime

func (w *Text) InsertOnTime() int

func (*Text) InsertText

func (w *Text) InsertText(pos int, text string) error

func (*Text) InsertUnfocussed

func (w *Text) InsertUnfocussed() DisplyCursor

func (*Text) InsertWidth

func (w *Text) InsertWidth() int

func (*Text) IsAutoSeparatorsOnUndo

func (w *Text) IsAutoSeparatorsOnUndo() bool

func (*Text) IsBlockCursor

func (w *Text) IsBlockCursor() bool

func (*Text) IsEnableUndo

func (w *Text) IsEnableUndo() bool

func (*Text) IsReadOnly

func (w *Text) IsReadOnly() bool

func (*Text) IsTakeFocus

func (w *Text) IsTakeFocus() bool

func (*Text) Length

func (w *Text) Length() int

func (*Text) LineAboveSpace

func (w *Text) LineAboveSpace() int

func (*Text) LineBelowSpace

func (w *Text) LineBelowSpace() int

func (*Text) LineCount

func (w *Text) LineCount() int

func (*Text) LineWrap

func (w *Text) LineWrap() LineWrapMode

func (*Text) LineWrapSpace

func (w *Text) LineWrapSpace() int

func (*Text) MaxUndo

func (w *Text) MaxUndo() int

func (*Text) OnXScrollEx

func (w *Text) OnXScrollEx(fn func([]string) error) error

func (*Text) OnYScrollEx

func (w *Text) OnYScrollEx(fn func([]string) error) error

func (*Text) Padding

func (w *Text) Padding() Pad

func (*Text) PaddingN

func (w *Text) PaddingN() (int, int)

func (*Text) PlainText

func (w *Text) PlainText() string

func (*Text) ReliefStyle

func (w *Text) ReliefStyle() ReliefStyle

func (*Text) SelectBackground

func (w *Text) SelectBackground() string

func (*Text) Selectborderwidth

func (w *Text) Selectborderwidth() int

func (*Text) Selectforeground

func (w *Text) Selectforeground() string

func (*Text) SetAutoSeparatorsOnUndo

func (w *Text) SetAutoSeparatorsOnUndo(autoseparators bool) error

func (*Text) SetBackground

func (w *Text) SetBackground(color string) error

func (*Text) SetBlockCursor

func (w *Text) SetBlockCursor(blockcursor bool) error

func (*Text) SetBorderWidth

func (w *Text) SetBorderWidth(width int) error

func (*Text) SetEnableUndo

func (w *Text) SetEnableUndo(undo bool) error

func (*Text) SetEndLine

func (w *Text) SetEndLine(endline int) error

func (*Text) SetFont

func (w *Text) SetFont(font Font) error

func (*Text) SetForeground

func (w *Text) SetForeground(color string) error

func (*Text) SetHeight

func (w *Text) SetHeight(height int) error

func (*Text) SetHighlightBackground

func (w *Text) SetHighlightBackground(color string) error

func (*Text) SetHighlightColor

func (w *Text) SetHighlightColor(color string) error

func (*Text) SetHighlightthickness

func (w *Text) SetHighlightthickness(width int) error

func (*Text) SetInactiveSelectBackground

func (w *Text) SetInactiveSelectBackground(color string) error

func (*Text) SetInsertBackground

func (w *Text) SetInsertBackground(color string) error

func (*Text) SetInsertBorderWidth

func (w *Text) SetInsertBorderWidth(width int) error

func (*Text) SetInsertOffTime

func (w *Text) SetInsertOffTime(offtime int) error

func (*Text) SetInsertOnTime

func (w *Text) SetInsertOnTime(ontime int) error

func (*Text) SetInsertUnfocussed

func (w *Text) SetInsertUnfocussed(style DisplyCursor) error

func (*Text) SetInsertWidth

func (w *Text) SetInsertWidth(width int) error

func (*Text) SetLineAboveSpace

func (w *Text) SetLineAboveSpace(spacing int) error

func (*Text) SetLineBelowSpace

func (w *Text) SetLineBelowSpace(spacing int) error

func (*Text) SetLineWrap

func (w *Text) SetLineWrap(wrap LineWrapMode) error

func (*Text) SetLineWrapSpace

func (w *Text) SetLineWrapSpace(spacing int) error

func (*Text) SetMaxUndo

func (w *Text) SetMaxUndo(maxundo int) error

func (*Text) SetPadding

func (w *Text) SetPadding(pad Pad) error

func (*Text) SetPaddingN

func (w *Text) SetPaddingN(padx int, pady int) error

func (*Text) SetReadOnly

func (w *Text) SetReadOnly(b bool) error

func (*Text) SetReliefStyle

func (w *Text) SetReliefStyle(relief ReliefStyle) error

func (*Text) SetSelectBackground

func (w *Text) SetSelectBackground(color string) error

func (*Text) SetSelectborderwidth

func (w *Text) SetSelectborderwidth(width int) error

func (*Text) SetSelectforeground

func (w *Text) SetSelectforeground(color string) error

func (*Text) SetStartLine

func (w *Text) SetStartLine(startline int) error

func (*Text) SetTabSize

func (w *Text) SetTabSize(size int) error

func (*Text) SetTakeFocus

func (w *Text) SetTakeFocus(takefocus bool) error

func (*Text) SetText

func (w *Text) SetText(text string) error

func (*Text) SetWidth

func (w *Text) SetWidth(width int) error

func (*Text) SetXViewArgs

func (w *Text) SetXViewArgs(args []string) error

func (*Text) SetYViewArgs

func (w *Text) SetYViewArgs(args []string) error

func (*Text) StartLine

func (w *Text) StartLine() int

func (*Text) TextLength

func (w *Text) TextLength() int

func (*Text) Width

func (w *Text) Width() int

type TextEx

type TextEx struct {
	*ScrollLayout
	*Text
}

func NewTextEx

func NewTextEx(parent Widget, attributs ...*WidgetAttr) *TextEx

type TextIndex

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

func (TextIndex) String

func (t TextIndex) String() string

type Theme

type Theme interface {
	Name() string
	IsTtk() bool
	InitAttributes(typ WidgetType) []NativeAttr
}

func MainTheme

func MainTheme() Theme

type TreeItem

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

func (*TreeItem) Children

func (t *TreeItem) Children() (lst []*TreeItem)

func (*TreeItem) Collapse

func (t *TreeItem) Collapse() error

func (*TreeItem) CollapseAll

func (t *TreeItem) CollapseAll() error

func (*TreeItem) ColumnText

func (t *TreeItem) ColumnText(column int) string

func (*TreeItem) Expand

func (t *TreeItem) Expand() error

func (*TreeItem) ExpandAll

func (t *TreeItem) ExpandAll() error

func (*TreeItem) Id

func (t *TreeItem) Id() string

func (*TreeItem) Image

func (t *TreeItem) Image() *Image

func (*TreeItem) Index

func (t *TreeItem) Index() int

func (*TreeItem) InsertItem

func (t *TreeItem) InsertItem(index int, text string, values []string) *TreeItem

func (*TreeItem) IsExpanded

func (t *TreeItem) IsExpanded() bool

func (*TreeItem) IsRoot

func (t *TreeItem) IsRoot() bool

func (*TreeItem) IsValid

func (t *TreeItem) IsValid() bool

func (*TreeItem) Next

func (t *TreeItem) Next() *TreeItem

func (*TreeItem) Parent

func (t *TreeItem) Parent() *TreeItem

func (*TreeItem) Prev

func (t *TreeItem) Prev() *TreeItem

func (*TreeItem) SetColumnText

func (t *TreeItem) SetColumnText(column int, text string) error

func (*TreeItem) SetExpanded

func (t *TreeItem) SetExpanded(expand bool) error

func (*TreeItem) SetImage

func (t *TreeItem) SetImage(img *Image) error

func (*TreeItem) SetText

func (t *TreeItem) SetText(text string) error

func (*TreeItem) SetValues

func (t *TreeItem) SetValues(values []string) error

func (*TreeItem) Text

func (t *TreeItem) Text() string

func (*TreeItem) Values

func (t *TreeItem) Values() []string

type TreeSelectMode

type TreeSelectMode int

func (TreeSelectMode) String

func (v TreeSelectMode) String() string

type TreeView

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

treeview

func NewTreeView

func NewTreeView(parent Widget, attributes ...*WidgetAttr) *TreeView

func (*TreeView) AddSelectionList

func (w *TreeView) AddSelectionList(items []*TreeItem) error

func (*TreeView) AddSelections

func (w *TreeView) AddSelections(items ...*TreeItem) error

func (*TreeView) Attach

func (w *TreeView) Attach(id string) error

func (*TreeView) BindXScrollBar

func (w *TreeView) BindXScrollBar(bar *ScrollBar) error

func (*TreeView) BindYScrollBar

func (w *TreeView) BindYScrollBar(bar *ScrollBar) error

func (*TreeView) Collapse

func (w *TreeView) Collapse(item *TreeItem) error

func (*TreeView) CollepseAll

func (w *TreeView) CollepseAll() error

func (*TreeView) ColumnAnchor

func (w *TreeView) ColumnAnchor(column int) Anchor

func (*TreeView) ColumnCount

func (w *TreeView) ColumnCount() int

func (*TreeView) ColumnMinimumWidth

func (w *TreeView) ColumnMinimumWidth(column int) int

func (*TreeView) ColumnStretch

func (w *TreeView) ColumnStretch(column int) bool

default all column stretch 1

func (*TreeView) ColumnWidth

func (w *TreeView) ColumnWidth(column int) int

func (*TreeView) CurrentIndex

func (w *TreeView) CurrentIndex() *TreeItem

func (*TreeView) DeleteAllItems

func (w *TreeView) DeleteAllItems() error

func (*TreeView) DeleteItem

func (w *TreeView) DeleteItem(item *TreeItem) error

func (*TreeView) Expand

func (w *TreeView) Expand(item *TreeItem) error

func (*TreeView) ExpandAll

func (w *TreeView) ExpandAll() error

func (*TreeView) FocusItem

func (w *TreeView) FocusItem() *TreeItem

func (*TreeView) HeaderAnchor

func (w *TreeView) HeaderAnchor(column int) Anchor

func (*TreeView) HeaderImage

func (w *TreeView) HeaderImage(column int) *Image

func (*TreeView) HeaderLabel

func (w *TreeView) HeaderLabel(column int) string

func (*TreeView) Height

func (w *TreeView) Height() int

func (*TreeView) InsertItem

func (w *TreeView) InsertItem(parent *TreeItem, index int, text string, values []string) *TreeItem

func (*TreeView) IsExpanded

func (w *TreeView) IsExpanded(item *TreeItem) bool

func (*TreeView) IsHeaderHidden

func (w *TreeView) IsHeaderHidden() bool

func (*TreeView) IsTakeFocus

func (w *TreeView) IsTakeFocus() bool

func (*TreeView) IsValidItem

func (w *TreeView) IsValidItem(item *TreeItem) bool

func (*TreeView) ItemAt

func (w *TreeView) ItemAt(x int, y int) *TreeItem

func (*TreeView) MoveItem

func (w *TreeView) MoveItem(item *TreeItem, parent *TreeItem, index int) error

func (*TreeView) OnDoubleClickedItem

func (w *TreeView) OnDoubleClickedItem(fn func(item *TreeItem))

func (*TreeView) OnItemCollapsed

func (w *TreeView) OnItemCollapsed(fn func()) error

func (*TreeView) OnItemExpanded

func (w *TreeView) OnItemExpanded(fn func()) error

func (*TreeView) OnSelectionChanged

func (w *TreeView) OnSelectionChanged(fn func()) error

func (*TreeView) OnXScrollEx

func (w *TreeView) OnXScrollEx(fn func([]string) error) error

func (*TreeView) OnYScrollEx

func (w *TreeView) OnYScrollEx(fn func([]string) error) error

func (*TreeView) Padding

func (w *TreeView) Padding() Pad

func (*TreeView) PaddingN

func (w *TreeView) PaddingN() (int, int)

func (*TreeView) RemoveSelectionList

func (w *TreeView) RemoveSelectionList(items []*TreeItem) error

func (*TreeView) RemoveSelections

func (w *TreeView) RemoveSelections(items ...*TreeItem) error

func (*TreeView) RootItem

func (w *TreeView) RootItem() *TreeItem

func (*TreeView) ScrollTo

func (w *TreeView) ScrollTo(item *TreeItem) error

func (*TreeView) SelectionList

func (w *TreeView) SelectionList() (lst []*TreeItem)

func (*TreeView) SetColumnAnchor

func (w *TreeView) SetColumnAnchor(column int, anchor Anchor) error

func (*TreeView) SetColumnCount

func (w *TreeView) SetColumnCount(columns int) error

func (*TreeView) SetColumnMinimumWidth

func (w *TreeView) SetColumnMinimumWidth(column int, width int) error

func (*TreeView) SetColumnStretch

func (w *TreeView) SetColumnStretch(column int, stretch bool) error

default all column stretch 1

func (*TreeView) SetColumnWidth

func (w *TreeView) SetColumnWidth(column int, width int) error

func (*TreeView) SetCurrentIndex

func (w *TreeView) SetCurrentIndex(item *TreeItem) error

func (*TreeView) SetExpanded

func (w *TreeView) SetExpanded(item *TreeItem, expand bool) error

func (*TreeView) SetFocusItem

func (w *TreeView) SetFocusItem(item *TreeItem) error

func (*TreeView) SetHeaderAnchor

func (w *TreeView) SetHeaderAnchor(column int, anchor Anchor) error

func (*TreeView) SetHeaderHidden

func (w *TreeView) SetHeaderHidden(hide bool) error

func (*TreeView) SetHeaderImage

func (w *TreeView) SetHeaderImage(column int, img *Image) error

func (*TreeView) SetHeaderLabel

func (w *TreeView) SetHeaderLabel(column int, label string) error

func (*TreeView) SetHeaderLabels

func (w *TreeView) SetHeaderLabels(labels []string) error

func (*TreeView) SetHeight

func (w *TreeView) SetHeight(row int) error

func (*TreeView) SetPadding

func (w *TreeView) SetPadding(pad Pad) error

func (*TreeView) SetPaddingN

func (w *TreeView) SetPaddingN(padx int, pady int) error

func (*TreeView) SetSelectionList

func (w *TreeView) SetSelectionList(items []*TreeItem) error

func (*TreeView) SetSelections

func (w *TreeView) SetSelections(items ...*TreeItem) error

func (*TreeView) SetTakeFocus

func (w *TreeView) SetTakeFocus(takefocus bool) error

func (*TreeView) SetTreeSelectMode

func (w *TreeView) SetTreeSelectMode(mode TreeSelectMode) error

func (*TreeView) SetXViewArgs

func (w *TreeView) SetXViewArgs(args []string) error

func (*TreeView) SetYViewArgs

func (w *TreeView) SetYViewArgs(args []string) error

func (*TreeView) ToggleSelectionList

func (w *TreeView) ToggleSelectionList(items []*TreeItem) error

func (*TreeView) ToggleSelections

func (w *TreeView) ToggleSelections(items ...*TreeItem) error

func (*TreeView) ToplevelItems

func (w *TreeView) ToplevelItems() []*TreeItem

func (*TreeView) TreeSelectMode

func (w *TreeView) TreeSelectMode() TreeSelectMode

type TreeViewEx

type TreeViewEx struct {
	*ScrollLayout
	*TreeView
}

func NewTreeViewEx

func NewTreeViewEx(parent Widget, attributs ...*WidgetAttr) *TreeViewEx

type UserFont

type UserFont struct {
	BaseFont
}

func NewUserFont

func NewUserFont(family string, size int, attributes ...*FontAttr) *UserFont

func NewUserFontFromClone

func NewUserFontFromClone(font Font) *UserFont

func (*UserFont) Destroy

func (f *UserFont) Destroy() error

func (*UserFont) SetBold

func (w *UserFont) SetBold(bold bool) *UserFont

func (*UserFont) SetFamily

func (w *UserFont) SetFamily(family string) *UserFont

func (*UserFont) SetItalic

func (w *UserFont) SetItalic(italic bool) *UserFont

func (*UserFont) SetOverstrike

func (w *UserFont) SetOverstrike(overstrike bool) *UserFont

func (*UserFont) SetSize

func (w *UserFont) SetSize(size int) *UserFont

func (*UserFont) SetUnderline

func (w *UserFont) SetUnderline(underline bool) *UserFont

type Widget

type Widget interface {
	Id() string
	Info() *WidgetInfo
	Type() WidgetType
	TypeName() string
	Parent() Widget
	Children() []Widget
	IsValid() bool
	Destroy() error
	DestroyChildren() error
}

func ChildrenOfWidget

func ChildrenOfWidget(w Widget) (list []Widget)

func FindWidget

func FindWidget(id string) Widget

func FocusWidget

func FocusWidget() Widget

func LookupWidget

func LookupWidget(id string) (w Widget, ok bool)

func ParentOfWidget

func ParentOfWidget(w Widget) Widget

type WidgetAttr

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

widget attribute

func ButtonAttrCompound

func ButtonAttrCompound(compound Compound) *WidgetAttr

func ButtonAttrImage

func ButtonAttrImage(image *Image) *WidgetAttr

func ButtonAttrPadding

func ButtonAttrPadding(padding Pad) *WidgetAttr

func ButtonAttrState

func ButtonAttrState(state State) *WidgetAttr

func ButtonAttrTakeFocus

func ButtonAttrTakeFocus(takefocus bool) *WidgetAttr

func ButtonAttrText

func ButtonAttrText(text string) *WidgetAttr

func ButtonAttrWidth

func ButtonAttrWidth(width int) *WidgetAttr

func CanvasAttrBackground

func CanvasAttrBackground(color string) *WidgetAttr

func CanvasAttrBorderWidth

func CanvasAttrBorderWidth(width int) *WidgetAttr

func CanvasAttrCloseEnough

func CanvasAttrCloseEnough(closeenough float64) *WidgetAttr

func CanvasAttrConfine

func CanvasAttrConfine(confine bool) *WidgetAttr

func CanvasAttrHeight

func CanvasAttrHeight(height int) *WidgetAttr

func CanvasAttrHighlightBackground

func CanvasAttrHighlightBackground(color string) *WidgetAttr

func CanvasAttrHighlightColor

func CanvasAttrHighlightColor(color string) *WidgetAttr

func CanvasAttrHighlightthickness

func CanvasAttrHighlightthickness(width int) *WidgetAttr

func CanvasAttrInsertBackground

func CanvasAttrInsertBackground(color string) *WidgetAttr

func CanvasAttrInsertBorderWidth

func CanvasAttrInsertBorderWidth(width int) *WidgetAttr

func CanvasAttrInsertOffTime

func CanvasAttrInsertOffTime(offtime int) *WidgetAttr

func CanvasAttrInsertOnTime

func CanvasAttrInsertOnTime(ontime int) *WidgetAttr

func CanvasAttrInsertWidth

func CanvasAttrInsertWidth(width int) *WidgetAttr

func CanvasAttrReliefStyle

func CanvasAttrReliefStyle(relief ReliefStyle) *WidgetAttr

func CanvasAttrSelectBackground

func CanvasAttrSelectBackground(color string) *WidgetAttr

func CanvasAttrSelectborderwidth

func CanvasAttrSelectborderwidth(width int) *WidgetAttr

func CanvasAttrSelectforeground

func CanvasAttrSelectforeground(color string) *WidgetAttr

func CanvasAttrState

func CanvasAttrState(state State) *WidgetAttr

func CanvasAttrTakeFocus

func CanvasAttrTakeFocus(takefocus bool) *WidgetAttr

func CanvasAttrWidth

func CanvasAttrWidth(width int) *WidgetAttr

func CanvasAttrXScrollIncrement

func CanvasAttrXScrollIncrement(value int) *WidgetAttr

func CanvasAttrYScrollIncrement

func CanvasAttrYScrollIncrement(value int) *WidgetAttr

func CheckButtonAttrCompound

func CheckButtonAttrCompound(compound Compound) *WidgetAttr

func CheckButtonAttrImage

func CheckButtonAttrImage(image *Image) *WidgetAttr

func CheckButtonAttrPadding

func CheckButtonAttrPadding(padding Pad) *WidgetAttr

func CheckButtonAttrState

func CheckButtonAttrState(state State) *WidgetAttr

func CheckButtonAttrTakeFocus

func CheckButtonAttrTakeFocus(takefocus bool) *WidgetAttr

func CheckButtonAttrText

func CheckButtonAttrText(text string) *WidgetAttr

func CheckButtonAttrWidth

func CheckButtonAttrWidth(width int) *WidgetAttr

func ComboBoxAttrBackground

func ComboBoxAttrBackground(color string) *WidgetAttr

func ComboBoxAttrEcho

func ComboBoxAttrEcho(echo string) *WidgetAttr

func ComboBoxAttrFont

func ComboBoxAttrFont(font Font) *WidgetAttr

func ComboBoxAttrForground

func ComboBoxAttrForground(color string) *WidgetAttr

func ComboBoxAttrHeight

func ComboBoxAttrHeight(height int) *WidgetAttr

func ComboBoxAttrJustify

func ComboBoxAttrJustify(justify Justify) *WidgetAttr

func ComboBoxAttrState

func ComboBoxAttrState(state State) *WidgetAttr

func ComboBoxAttrTakeFocus

func ComboBoxAttrTakeFocus(takefocus bool) *WidgetAttr

func ComboBoxAttrValues

func ComboBoxAttrValues(values []string) *WidgetAttr

func ComboBoxAttrWidth

func ComboBoxAttrWidth(width int) *WidgetAttr

func EntryAttrBackground

func EntryAttrBackground(color string) *WidgetAttr

func EntryAttrExportSelection

func EntryAttrExportSelection(export bool) *WidgetAttr

func EntryAttrFont

func EntryAttrFont(font Font) *WidgetAttr

func EntryAttrForeground

func EntryAttrForeground(color string) *WidgetAttr

func EntryAttrJustify

func EntryAttrJustify(justify Justify) *WidgetAttr

func EntryAttrShow

func EntryAttrShow(show string) *WidgetAttr

func EntryAttrState

func EntryAttrState(state State) *WidgetAttr

func EntryAttrTakeFocus

func EntryAttrTakeFocus(takefocus bool) *WidgetAttr

func EntryAttrWidth

func EntryAttrWidth(width int) *WidgetAttr

func FrameAttrBorderWidth

func FrameAttrBorderWidth(width int) *WidgetAttr

func FrameAttrHeight

func FrameAttrHeight(height int) *WidgetAttr

func FrameAttrPadding

func FrameAttrPadding(pad Pad) *WidgetAttr

func FrameAttrReliefStyle

func FrameAttrReliefStyle(relief ReliefStyle) *WidgetAttr

func FrameAttrTakeFocus

func FrameAttrTakeFocus(takefocus bool) *WidgetAttr

func FrameAttrWidth

func FrameAttrWidth(width int) *WidgetAttr

func LabelAttrAnchor

func LabelAttrAnchor(anchor Anchor) *WidgetAttr

func LabelAttrBackground

func LabelAttrBackground(color string) *WidgetAttr

func LabelAttrBorderWidth

func LabelAttrBorderWidth(width int) *WidgetAttr

func LabelAttrCompound

func LabelAttrCompound(compound Compound) *WidgetAttr

func LabelAttrFont

func LabelAttrFont(font Font) *WidgetAttr

func LabelAttrForground

func LabelAttrForground(color string) *WidgetAttr

func LabelAttrImage

func LabelAttrImage(image *Image) *WidgetAttr

func LabelAttrJustify

func LabelAttrJustify(justify Justify) *WidgetAttr

func LabelAttrPadding

func LabelAttrPadding(padding Pad) *WidgetAttr

func LabelAttrReliefStyle

func LabelAttrReliefStyle(relief ReliefStyle) *WidgetAttr

func LabelAttrState

func LabelAttrState(state State) *WidgetAttr

func LabelAttrTakeFocus

func LabelAttrTakeFocus(takefocus bool) *WidgetAttr

func LabelAttrText

func LabelAttrText(text string) *WidgetAttr

func LabelAttrWidth

func LabelAttrWidth(width int) *WidgetAttr

func LabelAttrWrapLength

func LabelAttrWrapLength(wraplength int) *WidgetAttr

func LabelFrameAttrBorderWidth

func LabelFrameAttrBorderWidth(width int) *WidgetAttr

func LabelFrameAttrHeight

func LabelFrameAttrHeight(height int) *WidgetAttr

func LabelFrameAttrLabelAnchor

func LabelFrameAttrLabelAnchor(anchor Anchor) *WidgetAttr

func LabelFrameAttrLabelText

func LabelFrameAttrLabelText(text string) *WidgetAttr

func LabelFrameAttrPadding

func LabelFrameAttrPadding(pad Pad) *WidgetAttr

func LabelFrameAttrReliefStyle

func LabelFrameAttrReliefStyle(relief ReliefStyle) *WidgetAttr

func LabelFrameAttrTakeFocus

func LabelFrameAttrTakeFocus(takefocus bool) *WidgetAttr

func LabelFrameAttrWidth

func LabelFrameAttrWidth(width int) *WidgetAttr

func ListBoxAttrBackground

func ListBoxAttrBackground(color string) *WidgetAttr

func ListBoxAttrBorderWidth

func ListBoxAttrBorderWidth(width int) *WidgetAttr

func ListBoxAttrFont

func ListBoxAttrFont(font Font) *WidgetAttr

func ListBoxAttrForground

func ListBoxAttrForground(color string) *WidgetAttr

func ListBoxAttrHeight

func ListBoxAttrHeight(height int) *WidgetAttr

func ListBoxAttrJustify

func ListBoxAttrJustify(justify Justify) *WidgetAttr

func ListBoxAttrPadding

func ListBoxAttrPadding(padding Pad) *WidgetAttr

func ListBoxAttrReliefStyle

func ListBoxAttrReliefStyle(relief ReliefStyle) *WidgetAttr

func ListBoxAttrSelectMode

func ListBoxAttrSelectMode(mode ListSelectMode) *WidgetAttr

func ListBoxAttrState

func ListBoxAttrState(state State) *WidgetAttr

func ListBoxAttrTakeFocus

func ListBoxAttrTakeFocus(takefocus bool) *WidgetAttr

func ListBoxAttrWidth

func ListBoxAttrWidth(width int) *WidgetAttr
func MenuAttrActiveBackground(color string) *WidgetAttr
func MenuAttrActiveBorderWidth(width int) *WidgetAttr
func MenuAttrActiveForground(color string) *WidgetAttr
func MenuAttrBackground(color string) *WidgetAttr
func MenuAttrBorderWidth(width int) *WidgetAttr
func MenuAttrDisabledForground(color string) *WidgetAttr
func MenuAttrFont(font Font) *WidgetAttr
func MenuAttrForground(color string) *WidgetAttr
func MenuAttrReliefStyle(relief ReliefStyle) *WidgetAttr
func MenuAttrSelectColor(color string) *WidgetAttr
func MenuAttrTakeFocus(takefocus bool) *WidgetAttr
func MenuAttrTearoff(tearoff bool) *WidgetAttr
func MenuAttrTearoffTitle(title string) *WidgetAttr
func MenuButtonAttrCompound(compound Compound) *WidgetAttr
func MenuButtonAttrDirection(direction Direction) *WidgetAttr
func MenuButtonAttrImage(image *Image) *WidgetAttr
func MenuButtonAttrMenu(menu *Menu) *WidgetAttr
func MenuButtonAttrPadding(padding Pad) *WidgetAttr
func MenuButtonAttrState(state State) *WidgetAttr
func MenuButtonAttrTakeFocus(takefocus bool) *WidgetAttr
func MenuButtonAttrText(text string) *WidgetAttr
func MenuButtonAttrWidth(width int) *WidgetAttr

func NotebookAttrHeight

func NotebookAttrHeight(height int) *WidgetAttr

func NotebookAttrPadding

func NotebookAttrPadding(padding Pad) *WidgetAttr

func NotebookAttrTakeFocus

func NotebookAttrTakeFocus(takefocus bool) *WidgetAttr

func NotebookAttrWidth

func NotebookAttrWidth(width int) *WidgetAttr

func PanedAttrHeight

func PanedAttrHeight(height int) *WidgetAttr

func PanedAttrWidth

func PanedAttrWidth(width int) *WidgetAttr

func ProgressBarAttrLength

func ProgressBarAttrLength(length int) *WidgetAttr

func ProgressBarAttrMaximum

func ProgressBarAttrMaximum(maximum float64) *WidgetAttr

func ProgressBarAttrOrient

func ProgressBarAttrOrient(orient Orient) *WidgetAttr

func ProgressBarAttrTakeFocus

func ProgressBarAttrTakeFocus(takefocus bool) *WidgetAttr

func ProgressBarAttrValue

func ProgressBarAttrValue(value float64) *WidgetAttr

func RadioButtonAttrCompound

func RadioButtonAttrCompound(compound Compound) *WidgetAttr

func RadioButtonAttrImage

func RadioButtonAttrImage(image *Image) *WidgetAttr

func RadioButtonAttrPadding

func RadioButtonAttrPadding(padding Pad) *WidgetAttr

func RadioButtonAttrState

func RadioButtonAttrState(state State) *WidgetAttr

func RadioButtonAttrTakeFocus

func RadioButtonAttrTakeFocus(takefocus bool) *WidgetAttr

func RadioButtonAttrText

func RadioButtonAttrText(text string) *WidgetAttr

func RadioButtonAttrWidth

func RadioButtonAttrWidth(width int) *WidgetAttr

func ScaleAttrFrom

func ScaleAttrFrom(from float64) *WidgetAttr

func ScaleAttrLength

func ScaleAttrLength(length int) *WidgetAttr

func ScaleAttrOrient

func ScaleAttrOrient(orient Orient) *WidgetAttr

func ScaleAttrTakeFocus

func ScaleAttrTakeFocus(takefocus bool) *WidgetAttr

func ScaleAttrTo

func ScaleAttrTo(to float64) *WidgetAttr

func ScaleAttrValue

func ScaleAttrValue(value float64) *WidgetAttr

func ScrollBarAttrOrient

func ScrollBarAttrOrient(orient Orient) *WidgetAttr

func ScrollBarAttrTakeFocus

func ScrollBarAttrTakeFocus(takefocus bool) *WidgetAttr

func SeparatorAttrOrient

func SeparatorAttrOrient(orient Orient) *WidgetAttr

func SeparatorAttrTakeFocus

func SeparatorAttrTakeFocus(takefocus bool) *WidgetAttr

func SpinBoxAttrFrom

func SpinBoxAttrFrom(from float64) *WidgetAttr

func SpinBoxAttrIncrement

func SpinBoxAttrIncrement(increment float64) *WidgetAttr

func SpinBoxAttrTakeFocus

func SpinBoxAttrTakeFocus(takefocus bool) *WidgetAttr

func SpinBoxAttrTextValues

func SpinBoxAttrTextValues(values []string) *WidgetAttr

func SpinBoxAttrTo

func SpinBoxAttrTo(to float64) *WidgetAttr

func SpinBoxAttrWrap

func SpinBoxAttrWrap(wrap bool) *WidgetAttr

func TabAttrCompound

func TabAttrCompound(compound Compound) *WidgetAttr

func TabAttrImage

func TabAttrImage(image *Image) *WidgetAttr

func TabAttrPadding

func TabAttrPadding(padding Pad) *WidgetAttr

func TabAttrState

func TabAttrState(state State) *WidgetAttr

func TabAttrSticky

func TabAttrSticky(sticky Sticky) *WidgetAttr

func TabAttrText

func TabAttrText(text string) *WidgetAttr

func TextAttrAutoSeparatorsOnUndo

func TextAttrAutoSeparatorsOnUndo(autoseparators bool) *WidgetAttr

func TextAttrBackground

func TextAttrBackground(color string) *WidgetAttr

func TextAttrBlockCursor

func TextAttrBlockCursor(blockcursor bool) *WidgetAttr

func TextAttrBorderWidth

func TextAttrBorderWidth(width int) *WidgetAttr

func TextAttrEnableUndo

func TextAttrEnableUndo(undo bool) *WidgetAttr

func TextAttrEndLine

func TextAttrEndLine(endline int) *WidgetAttr

func TextAttrFont

func TextAttrFont(font Font) *WidgetAttr

func TextAttrForeground

func TextAttrForeground(color string) *WidgetAttr

func TextAttrHeight

func TextAttrHeight(height int) *WidgetAttr

func TextAttrHighlightBackground

func TextAttrHighlightBackground(color string) *WidgetAttr

func TextAttrHighlightColor

func TextAttrHighlightColor(color string) *WidgetAttr

func TextAttrHighlightthickness

func TextAttrHighlightthickness(width int) *WidgetAttr

func TextAttrInactiveSelectBackground

func TextAttrInactiveSelectBackground(color string) *WidgetAttr

func TextAttrInsertBackground

func TextAttrInsertBackground(color string) *WidgetAttr

func TextAttrInsertBorderWidth

func TextAttrInsertBorderWidth(width int) *WidgetAttr

func TextAttrInsertOffTime

func TextAttrInsertOffTime(offtime int) *WidgetAttr

func TextAttrInsertOnTime

func TextAttrInsertOnTime(ontime int) *WidgetAttr

func TextAttrInsertUnfocussed

func TextAttrInsertUnfocussed(style DisplyCursor) *WidgetAttr

func TextAttrInsertWidth

func TextAttrInsertWidth(width int) *WidgetAttr

func TextAttrLineAboveSpace

func TextAttrLineAboveSpace(spacing int) *WidgetAttr

func TextAttrLineBelowSpace

func TextAttrLineBelowSpace(spacing int) *WidgetAttr

func TextAttrLineWrap

func TextAttrLineWrap(wrap LineWrapMode) *WidgetAttr

func TextAttrLineWrapSpace

func TextAttrLineWrapSpace(spacing int) *WidgetAttr

func TextAttrMaxUndo

func TextAttrMaxUndo(maxundo int) *WidgetAttr

func TextAttrPadding

func TextAttrPadding(padding Pad) *WidgetAttr

func TextAttrReliefStyle

func TextAttrReliefStyle(relief ReliefStyle) *WidgetAttr

func TextAttrSelectBackground

func TextAttrSelectBackground(color string) *WidgetAttr

func TextAttrSelectborderwidth

func TextAttrSelectborderwidth(width int) *WidgetAttr

func TextAttrSelectforeground

func TextAttrSelectforeground(color string) *WidgetAttr

func TextAttrStartLine

func TextAttrStartLine(startline int) *WidgetAttr

func TextAttrTakeFocus

func TextAttrTakeFocus(takefocus bool) *WidgetAttr

func TextAttrWidth

func TextAttrWidth(width int) *WidgetAttr

func TreeViewAttrHeight

func TreeViewAttrHeight(row int) *WidgetAttr

func TreeViewAttrPadding

func TreeViewAttrPadding(padding Pad) *WidgetAttr

func TreeViewAttrTakeFocus

func TreeViewAttrTakeFocus(takefocus bool) *WidgetAttr

func TreeViewAttrTreeSelectMode

func TreeViewAttrTreeSelectMode(mode TreeSelectMode) *WidgetAttr

func WidgetAttrBorderWidth

func WidgetAttrBorderWidth(width int) *WidgetAttr

setup widget border width

func WidgetAttrFont

func WidgetAttrFont(font Font) *WidgetAttr

setup widget font

func WidgetAttrHeight

func WidgetAttrHeight(height int) *WidgetAttr

setup widget height pixel or line

func WidgetAttrImage

func WidgetAttrImage(image *Image) *WidgetAttr

setup widget image

func WidgetAttrInitUseTheme

func WidgetAttrInitUseTheme(use bool) *WidgetAttr

setup widget init enable/disable theme

func WidgetAttrPadding

func WidgetAttrPadding(pad Pad) *WidgetAttr

setup widget padding (ttk padding or tk padx/pady)

func WidgetAttrPaddingN

func WidgetAttrPaddingN(padx int, pady int) *WidgetAttr

setup widget padding (ttk padding or tk padx/pady)

func WidgetAttrReliefStyle

func WidgetAttrReliefStyle(style ReliefStyle) *WidgetAttr

setup widget border style (tk relief attribute)

func WidgetAttrText

func WidgetAttrText(text string) *WidgetAttr

setup widget text

func WidgetAttrWidth

func WidgetAttrWidth(width int) *WidgetAttr

setup widget width

func WindowOptBorderWidth

func WindowOptBorderWidth(width int) *WidgetAttr

func WindowOptId

func WindowOptId(id string) *WidgetAttr

func WindowOptPadx

func WindowOptPadx(padx int) *WidgetAttr

func WindowOptPady

func WindowOptPady(pady int) *WidgetAttr

func WindowOptReliefStyle

func WindowOptReliefStyle(style ReliefStyle) *WidgetAttr

type WidgetInfo

type WidgetInfo struct {
	Type      WidgetType
	TypeName  string
	IsTtk     bool
	MetaClass *MetaClass
}

func CheckWidgetInfo

func CheckWidgetInfo(id string, typ WidgetType) (*WidgetInfo, error)

func CreateWidgetInfo

func CreateWidgetInfo(iid string, typ WidgetType, theme bool, attributes []*WidgetAttr) *WidgetInfo

func FindWidgetInfo

func FindWidgetInfo(id string) *WidgetInfo

type WidgetType

type WidgetType int
const (
	WidgetTypeNone WidgetType = iota
	WidgetTypeButton
	WidgetTypeCanvas
	WidgetTypeCheckButton
	WidgetTypeComboBox
	WidgetTypeEntry
	WidgetTypeFrame
	WidgetTypeLabel
	WidgetTypeLabelFrame
	WidgetTypeListBox
	WidgetTypeMenu
	WidgetTypeMenuButton
	WidgetTypeNotebook
	WidgetTypePaned
	WidgetTypeProgressBar
	WidgetTypeRadioButton
	WidgetTypeScale
	WidgetTypeScrollBar
	WidgetTypeSeparator
	WidgetTypeSizeGrip
	WidgetTypeSpinBox
	WidgetTypeText
	WidgetTypeWindow
	WidgetTypeTreeView
	WidgetTypeLayoutFrame
	WidgetTypeLayoutSpacer
	WidgetTypeLast
)

func (WidgetType) MetaClass

func (typ WidgetType) MetaClass(theme bool) (typName string, meta *MetaClass, ttk bool)

func (WidgetType) ThemeConfigure

func (typ WidgetType) ThemeConfigure() string

type Window

type Window struct {
	BaseWidget
}

func NewWindow

func NewWindow(attributes ...*WidgetAttr) *Window

func RootWindow

func RootWindow() *Window

func (*Window) Alpha

func (w *Window) Alpha() float64

func (*Window) Attach

func (w *Window) Attach(id string) error

func (*Window) Center

func (w *Window) Center() error

func (*Window) Deiconify

func (w *Window) Deiconify() error

func (*Window) Geometry

func (w *Window) Geometry() Geometry

func (*Window) GeometryN

func (w *Window) GeometryN() (x int, y int, width int, height int)

func (*Window) Height

func (w *Window) Height() (height int)

func (*Window) Hide

func (w *Window) Hide() error

func (*Window) Iconify

func (w *Window) Iconify() error

func (*Window) IsFullScreen

func (w *Window) IsFullScreen() bool

func (*Window) IsIconify

func (w *Window) IsIconify() bool

func (*Window) IsMaximized

func (w *Window) IsMaximized() bool

func (*Window) IsMinimized

func (w *Window) IsMinimized() bool

func (*Window) IsResizable

func (w *Window) IsResizable() (enableWidth bool, enableHeight bool)

func (*Window) IsTopmost

func (w *Window) IsTopmost() bool

func (*Window) IsVisible

func (w *Window) IsVisible() bool

func (*Window) MaximumSize

func (w *Window) MaximumSize() Size

func (*Window) MaximumSizeN

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

func (*Window) Menu

func (w *Window) Menu() *Menu

func (*Window) MinimumSize

func (w *Window) MinimumSize() Size

func (*Window) MinimumSizeN

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

func (*Window) Move

func (w *Window) Move(pos Pos) error

func (*Window) MoveN

func (w *Window) MoveN(x int, y int) error

func (*Window) OnClose

func (w *Window) OnClose(fn func() (accept bool)) error

func (*Window) Pos

func (w *Window) Pos() Pos

func (*Window) PosN

func (w *Window) PosN() (x int, y int)

func (*Window) Resize

func (w *Window) Resize(sz Size) error

func (*Window) ResizeN

func (w *Window) ResizeN(width int, height int) error

func (*Window) ScreenSize

func (w *Window) ScreenSize() Size

func (*Window) ScreenSizeN

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

func (*Window) SetAlpha

func (w *Window) SetAlpha(alpha float64) error

func (*Window) SetFullScreen

func (w *Window) SetFullScreen(full bool) error

func (*Window) SetGeometry

func (w *Window) SetGeometry(v Geometry) error

func (*Window) SetGeometryN

func (w *Window) SetGeometryN(x int, y int, width int, height int) error

func (*Window) SetHeight

func (w *Window) SetHeight(height int) error

func (*Window) SetMaximumSize

func (w *Window) SetMaximumSize(sz Size) error

func (*Window) SetMaximumSizeN

func (w *Window) SetMaximumSizeN(width int, height int) error

func (*Window) SetMenu

func (w *Window) SetMenu(m *Menu) error

func (*Window) SetMinimumSize

func (w *Window) SetMinimumSize(sz Size) error

func (*Window) SetMinimumSizeN

func (w *Window) SetMinimumSizeN(width int, height int) error

func (*Window) SetNaturalSize

func (w *Window) SetNaturalSize() error

func (*Window) SetPos

func (w *Window) SetPos(pos Pos) error

func (*Window) SetPosN

func (w *Window) SetPosN(x int, y int) error

func (*Window) SetResizable

func (w *Window) SetResizable(enableWidth bool, enableHeight bool) error

func (*Window) SetSize

func (w *Window) SetSize(sz Size) error

func (*Window) SetSizeN

func (w *Window) SetSizeN(width int, height int) error

func (*Window) SetTitle

func (w *Window) SetTitle(title string) error

func (*Window) SetTopmost

func (w *Window) SetTopmost(full bool) error

func (*Window) SetVisible

func (w *Window) SetVisible(b bool) error

func (*Window) SetWidth

func (w *Window) SetWidth(width int) error

func (*Window) ShowFullScreen

func (w *Window) ShowFullScreen() error

func (*Window) ShowMaximized

func (w *Window) ShowMaximized() error

func (*Window) ShowMinimized

func (w *Window) ShowMinimized() error

func (*Window) ShowNormal

func (w *Window) ShowNormal() error

func (*Window) Size

func (w *Window) Size() Size

func (*Window) SizeN

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

func (*Window) Title

func (w *Window) Title() string

func (*Window) Width

func (w *Window) Width() (width int)

type WindowInfo

type WindowInfo struct {
	X      int
	Y      int
	Width  int
	Height int
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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