Documentation
¶
Index ¶
- Constants
- Variables
- func ClipboardFiles() (files []string, ok bool)
- func ClipboardImage() (img image.Image, ok bool)
- func ClipboardText() (text string, ok bool)
- func EnableDPIAwareness() bool
- func Enabled(c EnabledControl) bool
- func InputDialog(title, prompt, initial string) (text string, ok bool)
- func MessageBox(caption, text string)
- func MessageBoxCustom(caption, text string, flags uint) int
- func MessageBoxError(caption, text string)
- func MessageBoxFor(parent *Window, caption, text string, flags uint) int
- func MessageBoxInfo(caption, text string)
- func MessageBoxOKCancel(caption, text string) bool
- func MessageBoxQuestion(caption, text string)
- func MessageBoxWarning(caption, text string)
- func MessageBoxYesNo(caption, text string) bool
- func OpenURL(url string)
- func PasswordDialog(title, prompt string) (text string, ok bool)
- func ScaleForDPI(px, dpi int) int
- func SelectRadio(item *MenuString, group ...*MenuString)
- func SetClipboardImage(img image.Image) bool
- func SetClipboardText(text string) bool
- func SetControlTheme(c Control, theme string)
- func SingleInstance(name string) bool
- func Visible(c VisibleControl) bool
- type Anchor
- type BalloonKind
- type BoxLayout
- type Button
- func (c *Button) Focus()
- func (c *Button) Font() *Font
- func (c *Button) HasFocus() bool
- func (b *Button) OnClick() func()
- func (b *Button) OnTabFocus() func()
- func (b *Button) SetDefault(on bool)
- func (b *Button) SetDropDownMenu(m *PopupMenu)
- func (c *Button) SetFont(font *Font)
- func (b *Button) SetIcon(icon *Icon)
- func (b *Button) SetImages(il *ImageList)
- func (b *Button) SetKind(k ButtonKind)
- func (b *Button) SetNote(text string)
- func (b *Button) SetOnClick(f func())
- func (b *Button) SetOnDropDown(f func())
- func (b *Button) SetOnTabFocus(f func())
- func (c *Button) SetText(text string)
- func (c *Button) Text() string
- type ButtonKind
- type Canvas
- func (c *Canvas) Arc(x, y, width, height int, fromClockAngle, dAngle float64, color Color)
- func (c *Canvas) Bezier(p []Point, color Color)
- func (c *Canvas) Clear(color Color)
- func (c *Canvas) ClearDrawRegions()
- func (c *Canvas) Curve(p []Point, color Color)
- func (c *Canvas) DrawEllipse(x, y, width, height int, color Color)
- func (c *Canvas) DrawFocusRect(x, y, width, height int)
- func (c *Canvas) DrawImage(img *Image, src Rectangle, destX, destY int)
- func (c *Canvas) DrawImageAlpha(img *Image, src Rectangle, destX, destY int, alpha uint8)
- func (c *Canvas) DrawImageScaled(img *Image, src, dest Rectangle)
- func (c *Canvas) DrawPie(x, y, width, height int, fromClockAngle, dAngle float64, color Color)
- func (c *Canvas) DrawPolygon(p []Point, color Color)
- func (c *Canvas) DrawRect(x, y, width, height int, color Color)
- func (c *Canvas) DrawRoundRect(x, y, width, height, radius int, color Color)
- func (c *Canvas) FillEllipse(x, y, width, height int, color Color)
- func (c *Canvas) FillEllipseOutline(x, y, width, height int, fill, outline Color)
- func (c *Canvas) FillGradientH(x, y, width, height int, left, right Color)
- func (c *Canvas) FillGradientV(x, y, width, height int, top, bottom Color)
- func (c *Canvas) FillPie(x, y, width, height int, fromClockAngle, dAngle float64, color Color)
- func (c *Canvas) FillPolygonOutline(p []Point, fill, outline Color)
- func (c *Canvas) FillRect(x, y, width, height int, color Color)
- func (c *Canvas) FillRectAlpha(x, y, width, height int, color Color, alpha uint8)
- func (c *Canvas) FillRectOutline(x, y, width, height int, fill, outline Color)
- func (c *Canvas) FillRoundRect(x, y, width, height, radius int, color Color)
- func (c *Canvas) FillRoundRectOutline(x, y, width, height, radius int, fill, outline Color)
- func (c *Canvas) Handle() uintptr
- func (c *Canvas) Height() int
- func (c *Canvas) Line(x1, y1, x2, y2 int, color Color)
- func (c *Canvas) Pixel(x, y int) Color
- func (c *Canvas) Polygon(p []Point, color Color)
- func (c *Canvas) Polyline(p []Point, color Color)
- func (c *Canvas) PopDrawRegion()
- func (c *Canvas) PushDrawEllipse(x, y, width, height int)
- func (c *Canvas) PushDrawPolygon(p []Point)
- func (c *Canvas) PushDrawRegion(x, y, width, height int)
- func (c *Canvas) PushDrawRoundRect(x, y, width, height, radius int)
- func (c *Canvas) Restore()
- func (c *Canvas) Save()
- func (c *Canvas) SetFont(font *Font)
- func (c *Canvas) SetLineStyle(s LineStyle)
- func (c *Canvas) SetLineWidth(width int)
- func (c *Canvas) SetPixel(x, y int, color Color)
- func (c *Canvas) SetStroke(s Stroke)
- func (c *Canvas) Size() (width, height int)
- func (c *Canvas) Stroke() Stroke
- func (c *Canvas) TextExtent(s string) (width, height int)
- func (c *Canvas) TextOut(x, y int, s string, color Color)
- func (c *Canvas) TextRect(x, y, w, h int, s string, color Color)
- func (c *Canvas) TextRectEllipsis(x, y, width, height int, s string, color Color)
- func (c *Canvas) TextRectExtent(s string, givenWidth int) (width, height int)
- func (c *Canvas) TextRectFormat(x, y, w, h int, s string, format Format, color Color)
- func (c *Canvas) Width() int
- type CheckBox
- func (c *CheckBox) Checked() bool
- func (c *CheckBox) Focus()
- func (c *CheckBox) Font() *Font
- func (c *CheckBox) HasFocus() bool
- func (c *CheckBox) Indeterminate() bool
- func (c *CheckBox) OnTabFocus() func()
- func (c *CheckBox) SetChecked(checked bool)
- func (c *CheckBox) SetFont(font *Font)
- func (c *CheckBox) SetIndeterminate(on bool)
- func (c *CheckBox) SetOnChange(f func(checked bool))
- func (c *CheckBox) SetOnTabFocus(f func())
- func (c *CheckBox) SetPushLike(on bool)
- func (c *CheckBox) SetText(text string)
- func (c *CheckBox) SetTextColor(col Color)
- func (c *CheckBox) SetThreeState(on bool)
- func (c *CheckBox) Text() string
- func (c *CheckBox) ThreeState() bool
- type Color
- type ColorDialog
- type ColumnAlign
- type ComboBox
- func (e *ComboBox) AddItem(s string)
- func (e *ComboBox) Clear()
- func (e *ComboBox) Editable() bool
- func (c *ComboBox) Focus()
- func (c *ComboBox) Font() *Font
- func (c *ComboBox) HasFocus() bool
- func (e *ComboBox) Items() []string
- func (c *ComboBox) OnTabFocus() func()
- func (e *ComboBox) SelectedIndex() int
- func (e *ComboBox) SetEditable(on bool)
- func (c *ComboBox) SetFont(font *Font)
- func (e *ComboBox) SetItems(items []string)
- func (e *ComboBox) SetOnChange(f func(newIndex int))
- func (c *ComboBox) SetOnTabFocus(f func())
- func (e *ComboBox) SetOnTextChange(f func())
- func (e *ComboBox) SetSelectedIndex(i int)
- func (c *ComboBox) SetText(text string)
- func (c *ComboBox) Text() string
- type Container
- type Control
- type Cursor
- type DarkPalette
- type DatePicker
- func (c *DatePicker) Anchors() (horizontal, vertical Anchor)
- func (c *DatePicker) BackgroundColor() Color
- func (c *DatePicker) Bounds() (x, y, width, height int)
- func (c *DatePicker) ContextMenu() *PopupMenu
- func (c *DatePicker) Enabled() bool
- func (c *DatePicker) Focus()
- func (c *DatePicker) Handle() uintptr
- func (c *DatePicker) HasBackgroundColor() bool
- func (c *DatePicker) HasFocus() bool
- func (c *DatePicker) HasTextColor() bool
- func (c *DatePicker) Height() int
- func (c *DatePicker) HorizontalAnchor() Anchor
- func (d *DatePicker) Mode() DatePickerMode
- func (d *DatePicker) OnChange() func(time.Time)
- func (c *DatePicker) OnDropFiles() DropFilesFunc
- func (c *DatePicker) OnResize() func()
- func (c *DatePicker) Parent() Container
- func (c *DatePicker) Position() (x, y int)
- func (c *DatePicker) ResetBackgroundColor()
- func (c *DatePicker) ResetTextColor()
- func (c *DatePicker) SetAnchors(horizontal, vertical Anchor)
- func (c *DatePicker) SetBackgroundColor(col Color)
- func (c *DatePicker) SetBounds(x, y, width, height int)
- func (c *DatePicker) SetContextMenu(m *PopupMenu)
- func (c *DatePicker) SetCursor(cur *Cursor)
- func (c *DatePicker) SetEnabled(e bool)
- func (c *DatePicker) SetHeight(height int)
- func (c *DatePicker) SetHorizontalAnchor(a Anchor)
- func (d *DatePicker) SetMode(m DatePickerMode)
- func (c *DatePicker) SetOnBlur(f func())
- func (d *DatePicker) SetOnChange(f func(time.Time))
- func (c *DatePicker) SetOnChar(f func(r rune))
- func (c *DatePicker) SetOnDoubleClick(f func(x, y int, button MouseButton))
- func (c *DatePicker) SetOnDropFiles(f DropFilesFunc)
- func (c *DatePicker) SetOnFocus(f func())
- func (c *DatePicker) SetOnKeyDown(f func(key int))
- func (c *DatePicker) SetOnKeyUp(f func(key int))
- func (c *DatePicker) SetOnMouseDown(f func(x, y int, button MouseButton))
- func (c *DatePicker) SetOnMouseEnter(f func())
- func (c *DatePicker) SetOnMouseLeave(f func())
- func (c *DatePicker) SetOnMouseMove(f func(x, y int))
- func (c *DatePicker) SetOnMouseUp(f func(x, y int, button MouseButton))
- func (c *DatePicker) SetOnMouseWheel(f func(x, y int, delta float64))
- func (c *DatePicker) SetOnResize(f func())
- func (c *DatePicker) SetPosition(x, y int)
- func (c *DatePicker) SetSize(width, height int)
- func (c *DatePicker) SetTabStop(on bool)
- func (c *DatePicker) SetTextColor(col Color)
- func (c *DatePicker) SetToolTip(text string)
- func (d *DatePicker) SetValue(t time.Time)
- func (c *DatePicker) SetVerticalAnchor(a Anchor)
- func (c *DatePicker) SetVisible(v bool)
- func (c *DatePicker) SetWidth(width int)
- func (c *DatePicker) SetX(x int)
- func (c *DatePicker) SetY(y int)
- func (c *DatePicker) Size() (width, height int)
- func (c *DatePicker) TabStop() bool
- func (c *DatePicker) TextColor() Color
- func (c *DatePicker) ToolTip() string
- func (d *DatePicker) Value() time.Time
- func (c *DatePicker) VerticalAnchor() Anchor
- func (c *DatePicker) Visible() bool
- func (c *DatePicker) Width() int
- func (c *DatePicker) X() int
- func (c *DatePicker) Y() int
- type DatePickerMode
- type DialogResult
- type DockLayout
- type DockStyle
- type DropFilesFunc
- type EditAlign
- type EditLine
- func (c *EditLine) AppendText(text string)
- func (c *EditLine) CanUndo() bool
- func (e *EditLine) CharacterLimit() int
- func (c *EditLine) Copy()
- func (c *EditLine) CursorLine() int
- func (c *EditLine) CursorPosition() (start, end int)
- func (c *EditLine) Cut()
- func (c *EditLine) DeleteSelection()
- func (e *EditLine) IsPassword() bool
- func (c *EditLine) LineCount() int
- func (e *EditLine) OnTabFocus() func()
- func (e *EditLine) OnTextChange() func()
- func (c *EditLine) Paste()
- func (e *EditLine) ReadOnly() bool
- func (c *EditLine) ReplaceSelection(text string)
- func (c *EditLine) ScrollToCaret()
- func (c *EditLine) SelectAll()
- func (c *EditLine) SelectedText() string
- func (e *EditLine) SetCharacterLimit(count int)
- func (c *EditLine) SetCueBanner(text string, showWhenFocused bool)
- func (c *EditLine) SetCursorPosition(pos int)
- func (e *EditLine) SetIsPassword(isPassword bool)
- func (c *EditLine) SetNumbersOnly(on bool)
- func (e *EditLine) SetOnTabFocus(f func())
- func (e *EditLine) SetOnTextChange(f func())
- func (e *EditLine) SetReadOnly(readOnly bool)
- func (c *EditLine) SetSelection(start, end int)
- func (c *EditLine) SetTextAlign(a EditAlign)
- func (c *EditLine) Undo() bool
- type EnabledControl
- type FileOpenDialog
- func (dlg *FileOpenDialog) AddFilter(text, ext1 string, exts ...string)
- func (dlg *FileOpenDialog) ExecuteMultiSelection(parent *Window) (bool, []string)
- func (dlg *FileOpenDialog) ExecuteSingleSelection(parent *Window) (bool, string)
- func (dlg *FileOpenDialog) SetFilterIndex(i int)
- func (dlg *FileOpenDialog) SetInitialPath(path string)
- func (dlg *FileOpenDialog) SetTitle(title string)
- type FileSaveDialog
- func (dlg *FileSaveDialog) AddFilter(text, ext1 string, exts ...string)
- func (dlg *FileSaveDialog) Execute(parent *Window) (bool, string)
- func (dlg *FileSaveDialog) SetAppendExt(ext bool)
- func (dlg *FileSaveDialog) SetFilterIndex(i int)
- func (dlg *FileSaveDialog) SetInitialPath(path string)
- func (dlg *FileSaveDialog) SetTitle(title string)
- type FloatUpDown
- func (c *FloatUpDown) AppendText(text string)
- func (c *FloatUpDown) CanUndo() bool
- func (c *FloatUpDown) Copy()
- func (c *FloatUpDown) CursorLine() int
- func (c *FloatUpDown) CursorPosition() (start, end int)
- func (c *FloatUpDown) Cut()
- func (c *FloatUpDown) DeleteSelection()
- func (c *FloatUpDown) LineCount() int
- func (n *FloatUpDown) Max() float64
- func (n *FloatUpDown) Min() float64
- func (n *FloatUpDown) MinMax() (min, max float64)
- func (n *FloatUpDown) OnTabFocus() func()
- func (n *FloatUpDown) OnValueChange() func(value float64)
- func (c *FloatUpDown) Paste()
- func (n *FloatUpDown) Precision() int
- func (c *FloatUpDown) ReplaceSelection(text string)
- func (c *FloatUpDown) ScrollToCaret()
- func (c *FloatUpDown) SelectAll()
- func (c *FloatUpDown) SelectedText() string
- func (n *FloatUpDown) SetBounds(x, y, width, height int)
- func (c *FloatUpDown) SetCueBanner(text string, showWhenFocused bool)
- func (c *FloatUpDown) SetCursorPosition(pos int)
- func (n *FloatUpDown) SetHeight(height int)
- func (n *FloatUpDown) SetMax(max float64)
- func (n *FloatUpDown) SetMin(min float64)
- func (n *FloatUpDown) SetMinMax(min, max float64)
- func (c *FloatUpDown) SetNumbersOnly(on bool)
- func (n *FloatUpDown) SetOnTabFocus(f func())
- func (n *FloatUpDown) SetOnValueChange(f func(value float64))
- func (n *FloatUpDown) SetPos(x, y int)
- func (n *FloatUpDown) SetPrecision(p int)
- func (c *FloatUpDown) SetSelection(start, end int)
- func (n *FloatUpDown) SetSize(width, height int)
- func (c *FloatUpDown) SetTextAlign(a EditAlign)
- func (n *FloatUpDown) SetValue(f float64)
- func (n *FloatUpDown) SetWidth(width int)
- func (n *FloatUpDown) SetX(x int)
- func (n *FloatUpDown) SetY(y int)
- func (c *FloatUpDown) Undo() bool
- func (n *FloatUpDown) Value() float64
- type FolderSelectDialog
- type Font
- type FontDesc
- type FontDialog
- type Format
- type GridLayout
- type GroupBox
- type HotKeyEdit
- func (c *HotKeyEdit) Focus()
- func (c *HotKeyEdit) Font() *Font
- func (c *HotKeyEdit) HasFocus() bool
- func (h *HotKeyEdit) HotKey() (key int, mods HotKeyMod)
- func (h *HotKeyEdit) OnTabFocus() func()
- func (c *HotKeyEdit) SetFont(font *Font)
- func (h *HotKeyEdit) SetHotKey(key int, mods HotKeyMod)
- func (h *HotKeyEdit) SetOnChange(f func())
- func (h *HotKeyEdit) SetOnTabFocus(f func())
- func (c *HotKeyEdit) SetText(text string)
- func (c *HotKeyEdit) Text() string
- type HotKeyMod
- type IPAddressEdit
- func (e *IPAddressEdit) Address() (string, bool)
- func (c *IPAddressEdit) Focus()
- func (c *IPAddressEdit) Font() *Font
- func (c *IPAddressEdit) HasFocus() bool
- func (e *IPAddressEdit) OnTabFocus() func()
- func (e *IPAddressEdit) SetAddress(s string) error
- func (c *IPAddressEdit) SetFont(font *Font)
- func (e *IPAddressEdit) SetOnChange(f func())
- func (e *IPAddressEdit) SetOnTabFocus(f func())
- func (c *IPAddressEdit) SetText(text string)
- func (c *IPAddressEdit) Text() string
- type Icon
- type Image
- type ImageList
- type ImageMode
- type ImageView
- func (c ImageView) Anchors() (horizontal, vertical Anchor)
- func (c ImageView) BackgroundColor() Color
- func (c ImageView) Bounds() (x, y, width, height int)
- func (c ImageView) ContextMenu() *PopupMenu
- func (c ImageView) Enabled() bool
- func (c ImageView) Focus()
- func (c ImageView) Handle() uintptr
- func (c ImageView) HasBackgroundColor() bool
- func (c ImageView) HasFocus() bool
- func (c ImageView) HasTextColor() bool
- func (c ImageView) Height() int
- func (c ImageView) HorizontalAnchor() Anchor
- func (v *ImageView) Image() *Image
- func (v *ImageView) Mode() ImageMode
- func (c ImageView) OnDropFiles() DropFilesFunc
- func (c ImageView) OnResize() func()
- func (c ImageView) Parent() Container
- func (c ImageView) Position() (x, y int)
- func (c ImageView) ResetBackgroundColor()
- func (c ImageView) ResetTextColor()
- func (c ImageView) SetAnchors(horizontal, vertical Anchor)
- func (v *ImageView) SetBackColor(c Color)
- func (c ImageView) SetBackgroundColor(col Color)
- func (c ImageView) SetBounds(x, y, width, height int)
- func (c ImageView) SetContextMenu(m *PopupMenu)
- func (c ImageView) SetCursor(cur *Cursor)
- func (c ImageView) SetEnabled(e bool)
- func (c ImageView) SetHeight(height int)
- func (c ImageView) SetHorizontalAnchor(a Anchor)
- func (v *ImageView) SetImage(img image.Image)
- func (v *ImageView) SetImageFromFile(path string) error
- func (v *ImageView) SetMode(m ImageMode)
- func (c ImageView) SetOnBlur(f func())
- func (c ImageView) SetOnChar(f func(r rune))
- func (c ImageView) SetOnDropFiles(f DropFilesFunc)
- func (c ImageView) SetOnFocus(f func())
- func (c ImageView) SetOnKeyDown(f func(key int))
- func (c ImageView) SetOnKeyUp(f func(key int))
- func (c ImageView) SetOnMouseEnter(f func())
- func (c ImageView) SetOnMouseLeave(f func())
- func (c ImageView) SetOnMouseWheel(f func(x, y int, delta float64))
- func (c ImageView) SetOnResize(f func())
- func (c ImageView) SetPosition(x, y int)
- func (c ImageView) SetSize(width, height int)
- func (c ImageView) SetTabStop(on bool)
- func (c ImageView) SetTextColor(col Color)
- func (c ImageView) SetToolTip(text string)
- func (c ImageView) SetVerticalAnchor(a Anchor)
- func (c ImageView) SetVisible(v bool)
- func (c ImageView) SetWidth(width int)
- func (c ImageView) SetX(x int)
- func (c ImageView) SetY(y int)
- func (c ImageView) Size() (width, height int)
- func (c ImageView) TabStop() bool
- func (c ImageView) TextColor() Color
- func (c ImageView) ToolTip() string
- func (c ImageView) VerticalAnchor() Anchor
- func (c ImageView) Visible() bool
- func (c ImageView) Width() int
- func (c ImageView) X() int
- func (c ImageView) Y() int
- type IntUpDown
- func (c *IntUpDown) AppendText(text string)
- func (c *IntUpDown) CanUndo() bool
- func (c *IntUpDown) Copy()
- func (c *IntUpDown) CursorLine() int
- func (c *IntUpDown) CursorPosition() (start, end int)
- func (c *IntUpDown) Cut()
- func (c *IntUpDown) DeleteSelection()
- func (c *IntUpDown) LineCount() int
- func (n *IntUpDown) Max() int
- func (n *IntUpDown) Min() int
- func (n *IntUpDown) MinMax() (min, max int)
- func (n *IntUpDown) OnTabFocus() func()
- func (n *IntUpDown) OnValueChange() func(value int)
- func (c *IntUpDown) Paste()
- func (c *IntUpDown) ReplaceSelection(text string)
- func (c *IntUpDown) ScrollToCaret()
- func (c *IntUpDown) SelectAll()
- func (c *IntUpDown) SelectedText() string
- func (n *IntUpDown) SetBounds(x, y, width, height int)
- func (c *IntUpDown) SetCueBanner(text string, showWhenFocused bool)
- func (c *IntUpDown) SetCursorPosition(pos int)
- func (n *IntUpDown) SetHeight(height int)
- func (n *IntUpDown) SetMax(max int)
- func (n *IntUpDown) SetMin(min int)
- func (n *IntUpDown) SetMinMax(min, max int)
- func (c *IntUpDown) SetNumbersOnly(on bool)
- func (n *IntUpDown) SetOnTabFocus(f func())
- func (n *IntUpDown) SetOnValueChange(f func(value int))
- func (n *IntUpDown) SetPos(x, y int)
- func (c *IntUpDown) SetSelection(start, end int)
- func (n *IntUpDown) SetSize(width, height int)
- func (c *IntUpDown) SetTextAlign(a EditAlign)
- func (n *IntUpDown) SetValue(v int)
- func (n *IntUpDown) SetVisible(v bool)
- func (n *IntUpDown) SetWidth(width int)
- func (n *IntUpDown) SetX(x int)
- func (n *IntUpDown) SetY(y int)
- func (c *IntUpDown) Undo() bool
- func (n *IntUpDown) Value() int
- type Key
- type Label
- type Layout
- type LineCap
- type LineJoin
- type LineStyle
- type LinkLabel
- func (c *LinkLabel) Focus()
- func (c *LinkLabel) Font() *Font
- func (c *LinkLabel) HasFocus() bool
- func (l *LinkLabel) OnTabFocus() func()
- func (c *LinkLabel) SetFont(font *Font)
- func (l *LinkLabel) SetOnClick(f func(url, id string))
- func (l *LinkLabel) SetOnTabFocus(f func())
- func (c *LinkLabel) SetText(text string)
- func (c *LinkLabel) Text() string
- type ListView
- func (l *ListView) AddColumn(title string, width int) int
- func (l *ListView) AddItem(cells ...string) *ListViewItem
- func (l *ListView) AutoSizeColumns()
- func (l *ListView) Clear()
- func (l *ListView) ColumnCount() int
- func (l *ListView) Count() int
- func (l *ListView) EnsureVisible(index int)
- func (c *ListView) Focus()
- func (c *ListView) Font() *Font
- func (c *ListView) HasFocus() bool
- func (l *ListView) Item(index int) *ListViewItem
- func (l *ListView) Items() []*ListViewItem
- func (l *ListView) MultiSelect() bool
- func (l *ListView) OnTabFocus() func()
- func (l *ListView) Refresh()
- func (l *ListView) RemoveItem(index int)
- func (l *ListView) SelectAll()
- func (l *ListView) SelectedIndex() int
- func (l *ListView) SelectedIndices() []int
- func (l *ListView) SelectedItems() []*ListViewItem
- func (l *ListView) SetCheckBoxes(on bool)
- func (l *ListView) SetColumnAlignment(col int, a ColumnAlign)
- func (l *ListView) SetColumnTitle(col int, title string)
- func (l *ListView) SetColumnWidth(col, width int)
- func (l *ListView) SetColumns(titles []string)
- func (l *ListView) SetCompare(f func(a, b string) int)
- func (l *ListView) SetEditable(on bool)
- func (c *ListView) SetFont(font *Font)
- func (l *ListView) SetFullRowSelect(on bool)
- func (l *ListView) SetGridLines(on bool)
- func (l *ListView) SetHeaderVisible(on bool)
- func (l *ListView) SetItems(rows []string)
- func (l *ListView) SetLargeImages(il *ImageList)
- func (l *ListView) SetMultiSelect(on bool)
- func (l *ListView) SetOnActivate(f func(index int))
- func (l *ListView) SetOnColumnClick(f func(column int))
- func (l *ListView) SetOnItemCheck(f func(item *ListViewItem, checked bool))
- func (l *ListView) SetOnLabelEdit(f func(item *ListViewItem, newText string) bool)
- func (l *ListView) SetOnSelect(f func(index int))
- func (l *ListView) SetOnTabFocus(f func())
- func (l *ListView) SetSelectedIndex(index int)
- func (l *ListView) SetSmallImages(il *ImageList)
- func (l *ListView) SetSortable(on bool)
- func (c *ListView) SetText(text string)
- func (l *ListView) SetView(v ListViewView)
- func (l *ListView) SetVirtual(count int, text func(row, col int) string)
- func (l *ListView) SetVirtualCount(count int)
- func (l *ListView) SetVirtualImage(f func(row int) int)
- func (l *ListView) Sort(col int, ascending bool)
- func (c *ListView) Text() string
- func (l *ListView) View() ListViewView
- type ListViewItem
- func (it *ListViewItem) Cell(col int) string
- func (it *ListViewItem) Checked() bool
- func (it *ListViewItem) EditLabel()
- func (it *ListViewItem) Image() int
- func (it *ListViewItem) Index() int
- func (it *ListViewItem) Select()
- func (it *ListViewItem) SetCell(col int, text string)
- func (it *ListViewItem) SetChecked(checked bool)
- func (it *ListViewItem) SetImage(index int)
- type ListViewView
- type Menu
- type MenuItem
- type MenuString
- func (m *MenuString) Checked() bool
- func (m *MenuString) Enabled() bool
- func (m *MenuString) OnClick() func()
- func (m *MenuString) SetChecked(c bool)
- func (m *MenuString) SetEnabled(on bool)
- func (m *MenuString) SetImage(img *Image)
- func (m *MenuString) SetOnClick(f func()) *MenuString
- func (m *MenuString) SetRadio(on bool)
- func (m *MenuString) SetText(s string)
- func (m *MenuString) Text() string
- type MessageCallback
- type MonthCalendar
- func (m *MonthCalendar) Date() time.Time
- func (c *MonthCalendar) Focus()
- func (c *MonthCalendar) Font() *Font
- func (c *MonthCalendar) HasFocus() bool
- func (m *MonthCalendar) OnTabFocus() func()
- func (m *MonthCalendar) PreferredSize() (width, height int)
- func (m *MonthCalendar) SetDate(t time.Time)
- func (c *MonthCalendar) SetFont(font *Font)
- func (m *MonthCalendar) SetOnChange(f func(date time.Time))
- func (m *MonthCalendar) SetOnTabFocus(f func())
- func (m *MonthCalendar) SetShowWeekNumbers(on bool)
- func (c *MonthCalendar) SetText(text string)
- func (c *MonthCalendar) Text() string
- type MouseButton
- type NativeToolBar
- func (t *NativeToolBar) AddButton(text string, image int, onClick func()) *NativeToolButton
- func (t *NativeToolBar) AddDropDown(text string, image int, onClick func(), menu *PopupMenu) *NativeToolButton
- func (t *NativeToolBar) AddSeparator()
- func (t *NativeToolBar) AddToggle(text string, image int, onToggle func(on bool)) *NativeToolButton
- func (c *NativeToolBar) Anchors() (horizontal, vertical Anchor)
- func (c *NativeToolBar) BackgroundColor() Color
- func (c *NativeToolBar) Bounds() (x, y, width, height int)
- func (t *NativeToolBar) Buttons() []*NativeToolButton
- func (c *NativeToolBar) ContextMenu() *PopupMenu
- func (c *NativeToolBar) Enabled() bool
- func (c *NativeToolBar) Focus()
- func (c *NativeToolBar) Handle() uintptr
- func (c *NativeToolBar) HasBackgroundColor() bool
- func (c *NativeToolBar) HasFocus() bool
- func (c *NativeToolBar) HasTextColor() bool
- func (c *NativeToolBar) Height() int
- func (c *NativeToolBar) HorizontalAnchor() Anchor
- func (c *NativeToolBar) OnDropFiles() DropFilesFunc
- func (c *NativeToolBar) OnResize() func()
- func (c *NativeToolBar) Parent() Container
- func (c *NativeToolBar) Position() (x, y int)
- func (t *NativeToolBar) PreferredHeight() int
- func (c *NativeToolBar) ResetBackgroundColor()
- func (c *NativeToolBar) ResetTextColor()
- func (c *NativeToolBar) SetAnchors(horizontal, vertical Anchor)
- func (c *NativeToolBar) SetBackgroundColor(col Color)
- func (c *NativeToolBar) SetBounds(x, y, width, height int)
- func (c *NativeToolBar) SetContextMenu(m *PopupMenu)
- func (c *NativeToolBar) SetCursor(cur *Cursor)
- func (c *NativeToolBar) SetEnabled(e bool)
- func (c *NativeToolBar) SetHeight(height int)
- func (c *NativeToolBar) SetHorizontalAnchor(a Anchor)
- func (t *NativeToolBar) SetImages(il *ImageList)
- func (c *NativeToolBar) SetOnBlur(f func())
- func (c *NativeToolBar) SetOnChar(f func(r rune))
- func (c *NativeToolBar) SetOnDoubleClick(f func(x, y int, button MouseButton))
- func (c *NativeToolBar) SetOnDropFiles(f DropFilesFunc)
- func (c *NativeToolBar) SetOnFocus(f func())
- func (c *NativeToolBar) SetOnKeyDown(f func(key int))
- func (c *NativeToolBar) SetOnKeyUp(f func(key int))
- func (c *NativeToolBar) SetOnMouseDown(f func(x, y int, button MouseButton))
- func (c *NativeToolBar) SetOnMouseEnter(f func())
- func (c *NativeToolBar) SetOnMouseLeave(f func())
- func (c *NativeToolBar) SetOnMouseMove(f func(x, y int))
- func (c *NativeToolBar) SetOnMouseUp(f func(x, y int, button MouseButton))
- func (c *NativeToolBar) SetOnMouseWheel(f func(x, y int, delta float64))
- func (c *NativeToolBar) SetOnResize(f func())
- func (c *NativeToolBar) SetPosition(x, y int)
- func (t *NativeToolBar) SetShowText(on bool)
- func (c *NativeToolBar) SetSize(width, height int)
- func (c *NativeToolBar) SetTabStop(on bool)
- func (c *NativeToolBar) SetTextColor(col Color)
- func (c *NativeToolBar) SetToolTip(text string)
- func (c *NativeToolBar) SetVerticalAnchor(a Anchor)
- func (c *NativeToolBar) SetVisible(v bool)
- func (c *NativeToolBar) SetWidth(width int)
- func (c *NativeToolBar) SetX(x int)
- func (c *NativeToolBar) SetY(y int)
- func (c *NativeToolBar) Size() (width, height int)
- func (c *NativeToolBar) TabStop() bool
- func (c *NativeToolBar) TextColor() Color
- func (c *NativeToolBar) ToolTip() string
- func (c *NativeToolBar) VerticalAnchor() Anchor
- func (c *NativeToolBar) Visible() bool
- func (c *NativeToolBar) Width() int
- func (c *NativeToolBar) X() int
- func (c *NativeToolBar) Y() int
- type NativeToolButton
- type PaintBox
- func (c *PaintBox) Anchors() (horizontal, vertical Anchor)
- func (c *PaintBox) BackgroundColor() Color
- func (c *PaintBox) Bounds() (x, y, width, height int)
- func (c *PaintBox) ContextMenu() *PopupMenu
- func (c *PaintBox) Enabled() bool
- func (c *PaintBox) Focus()
- func (c *PaintBox) Handle() uintptr
- func (c *PaintBox) HasBackgroundColor() bool
- func (c *PaintBox) HasFocus() bool
- func (c *PaintBox) HasTextColor() bool
- func (c *PaintBox) Height() int
- func (c *PaintBox) HorizontalAnchor() Anchor
- func (p *PaintBox) OnDoubleClick() func(x, y int, button MouseButton)
- func (c *PaintBox) OnDropFiles() DropFilesFunc
- func (p *PaintBox) OnMouseDown() func(x, y int, button MouseButton)
- func (p *PaintBox) OnMouseMove() func(x, y int)
- func (p *PaintBox) OnMouseUp() func(x, y int, button MouseButton)
- func (p *PaintBox) OnPaint() func(*Canvas)
- func (c *PaintBox) OnResize() func()
- func (p *PaintBox) Paint()
- func (c *PaintBox) Parent() Container
- func (c *PaintBox) Position() (x, y int)
- func (c *PaintBox) ResetBackgroundColor()
- func (c *PaintBox) ResetTextColor()
- func (c *PaintBox) SetAnchors(horizontal, vertical Anchor)
- func (c *PaintBox) SetBackgroundColor(col Color)
- func (c *PaintBox) SetBounds(x, y, width, height int)
- func (c *PaintBox) SetContextMenu(m *PopupMenu)
- func (c *PaintBox) SetCursor(cur *Cursor)
- func (c *PaintBox) SetEnabled(e bool)
- func (c *PaintBox) SetHeight(height int)
- func (c *PaintBox) SetHorizontalAnchor(a Anchor)
- func (c *PaintBox) SetOnBlur(f func())
- func (c *PaintBox) SetOnChar(f func(r rune))
- func (p *PaintBox) SetOnDoubleClick(f func(x, y int, button MouseButton))
- func (c *PaintBox) SetOnDropFiles(f DropFilesFunc)
- func (c *PaintBox) SetOnFocus(f func())
- func (c *PaintBox) SetOnKeyDown(f func(key int))
- func (c *PaintBox) SetOnKeyUp(f func(key int))
- func (p *PaintBox) SetOnMouseDown(f func(x, y int, button MouseButton))
- func (c *PaintBox) SetOnMouseEnter(f func())
- func (c *PaintBox) SetOnMouseLeave(f func())
- func (p *PaintBox) SetOnMouseMove(f func(x, y int))
- func (p *PaintBox) SetOnMouseUp(f func(x, y int, button MouseButton))
- func (c *PaintBox) SetOnMouseWheel(f func(x, y int, delta float64))
- func (p *PaintBox) SetOnPaint(f func(*Canvas))
- func (c *PaintBox) SetOnResize(f func())
- func (c *PaintBox) SetPosition(x, y int)
- func (c *PaintBox) SetSize(width, height int)
- func (c *PaintBox) SetTabStop(on bool)
- func (c *PaintBox) SetTextColor(col Color)
- func (c *PaintBox) SetToolTip(text string)
- func (c *PaintBox) SetVerticalAnchor(a Anchor)
- func (c *PaintBox) SetVisible(v bool)
- func (c *PaintBox) SetWidth(width int)
- func (c *PaintBox) SetX(x int)
- func (c *PaintBox) SetY(y int)
- func (c *PaintBox) Size() (width, height int)
- func (c *PaintBox) TabStop() bool
- func (c *PaintBox) TextColor() Color
- func (c *PaintBox) ToolTip() string
- func (c *PaintBox) VerticalAnchor() Anchor
- func (c *PaintBox) Visible() bool
- func (c *PaintBox) Width() int
- func (c *PaintBox) X() int
- func (c *PaintBox) Y() int
- type Panel
- func (p *Panel) Add(c Control)
- func (c *Panel) Anchors() (horizontal, vertical Anchor)
- func (c *Panel) BackgroundColor() Color
- func (p *Panel) BorderStyle() PanelBorderStyle
- func (c *Panel) Bounds() (x, y, width, height int)
- func (p *Panel) Children() []Control
- func (c *Panel) ContextMenu() *PopupMenu
- func (c *Panel) Enabled() bool
- func (c *Panel) Focus()
- func (p *Panel) Font() *Font
- func (c *Panel) Handle() uintptr
- func (c *Panel) HasBackgroundColor() bool
- func (c *Panel) HasFocus() bool
- func (c *Panel) HasTextColor() bool
- func (c *Panel) Height() int
- func (c *Panel) HorizontalAnchor() Anchor
- func (p *Panel) InnerBounds() (x, y, width, height int)
- func (p *Panel) InnerHeight() int
- func (p *Panel) InnerPosition() (x, y int)
- func (p *Panel) InnerSize() (width, height int)
- func (p *Panel) InnerWidth() int
- func (p *Panel) InnerX() int
- func (p *Panel) InnerY() int
- func (p *Panel) Layout() Layout
- func (c *Panel) OnDropFiles() DropFilesFunc
- func (c *Panel) OnResize() func()
- func (c *Panel) Parent() Container
- func (c *Panel) Position() (x, y int)
- func (p *Panel) Relayout()
- func (p *Panel) Remove(c Control)
- func (c *Panel) ResetBackgroundColor()
- func (c *Panel) ResetTextColor()
- func (c *Panel) SetAnchors(horizontal, vertical Anchor)
- func (c *Panel) SetBackgroundColor(col Color)
- func (p *Panel) SetBorderStyle(s PanelBorderStyle)
- func (p *Panel) SetBounds(x, y, width, height int)
- func (c *Panel) SetContextMenu(m *PopupMenu)
- func (c *Panel) SetCursor(cur *Cursor)
- func (c *Panel) SetEnabled(e bool)
- func (p *Panel) SetFont(f *Font)
- func (p *Panel) SetHeight(height int)
- func (c *Panel) SetHorizontalAnchor(a Anchor)
- func (p *Panel) SetInnerBounds(x, y, width, height int)
- func (p *Panel) SetInnerHeight(height int)
- func (p *Panel) SetInnerPosition(x, y int)
- func (p *Panel) SetInnerSize(width, height int)
- func (p *Panel) SetInnerWidth(width int)
- func (p *Panel) SetInnerX(x int)
- func (p *Panel) SetInnerY(y int)
- func (p *Panel) SetLayout(l Layout)
- func (c *Panel) SetOnBlur(f func())
- func (c *Panel) SetOnChar(f func(r rune))
- func (c *Panel) SetOnDoubleClick(f func(x, y int, button MouseButton))
- func (c *Panel) SetOnDropFiles(f DropFilesFunc)
- func (c *Panel) SetOnFocus(f func())
- func (c *Panel) SetOnKeyDown(f func(key int))
- func (c *Panel) SetOnKeyUp(f func(key int))
- func (c *Panel) SetOnMouseDown(f func(x, y int, button MouseButton))
- func (c *Panel) SetOnMouseEnter(f func())
- func (c *Panel) SetOnMouseLeave(f func())
- func (c *Panel) SetOnMouseMove(f func(x, y int))
- func (c *Panel) SetOnMouseUp(f func(x, y int, button MouseButton))
- func (c *Panel) SetOnMouseWheel(f func(x, y int, delta float64))
- func (c *Panel) SetOnResize(f func())
- func (p *Panel) SetPosition(x, y int)
- func (p *Panel) SetSize(width, height int)
- func (c *Panel) SetTabStop(on bool)
- func (c *Panel) SetTextColor(col Color)
- func (c *Panel) SetToolTip(text string)
- func (c *Panel) SetVerticalAnchor(a Anchor)
- func (c *Panel) SetVisible(v bool)
- func (p *Panel) SetWidth(width int)
- func (p *Panel) SetX(x int)
- func (p *Panel) SetY(y int)
- func (c *Panel) Size() (width, height int)
- func (c *Panel) TabStop() bool
- func (c *Panel) TextColor() Color
- func (c *Panel) ToolTip() string
- func (c *Panel) VerticalAnchor() Anchor
- func (c *Panel) Visible() bool
- func (c *Panel) Width() int
- func (c *Panel) X() int
- func (c *Panel) Y() int
- type PanelBorderStyle
- type Point
- type PopupMenu
- type ProgressBar
- func (c *ProgressBar) Anchors() (horizontal, vertical Anchor)
- func (c *ProgressBar) BackgroundColor() Color
- func (c *ProgressBar) Bounds() (x, y, width, height int)
- func (c *ProgressBar) ContextMenu() *PopupMenu
- func (c *ProgressBar) Enabled() bool
- func (c *ProgressBar) Focus()
- func (c *ProgressBar) Handle() uintptr
- func (c *ProgressBar) HasBackgroundColor() bool
- func (c *ProgressBar) HasFocus() bool
- func (c *ProgressBar) HasTextColor() bool
- func (c *ProgressBar) Height() int
- func (c *ProgressBar) HorizontalAnchor() Anchor
- func (p *ProgressBar) MovesForever() bool
- func (c *ProgressBar) OnDropFiles() DropFilesFunc
- func (c *ProgressBar) OnResize() func()
- func (c *ProgressBar) Parent() Container
- func (c *ProgressBar) Position() (x, y int)
- func (c *ProgressBar) ResetBackgroundColor()
- func (c *ProgressBar) ResetTextColor()
- func (c *ProgressBar) SetAnchors(horizontal, vertical Anchor)
- func (c *ProgressBar) SetBackgroundColor(col Color)
- func (c *ProgressBar) SetBounds(x, y, width, height int)
- func (c *ProgressBar) SetContextMenu(m *PopupMenu)
- func (c *ProgressBar) SetCursor(cur *Cursor)
- func (c *ProgressBar) SetEnabled(e bool)
- func (c *ProgressBar) SetHeight(height int)
- func (c *ProgressBar) SetHorizontalAnchor(a Anchor)
- func (p *ProgressBar) SetMovesForever(move bool)
- func (c *ProgressBar) SetOnBlur(f func())
- func (c *ProgressBar) SetOnChar(f func(r rune))
- func (c *ProgressBar) SetOnDoubleClick(f func(x, y int, button MouseButton))
- func (c *ProgressBar) SetOnDropFiles(f DropFilesFunc)
- func (c *ProgressBar) SetOnFocus(f func())
- func (c *ProgressBar) SetOnKeyDown(f func(key int))
- func (c *ProgressBar) SetOnKeyUp(f func(key int))
- func (c *ProgressBar) SetOnMouseDown(f func(x, y int, button MouseButton))
- func (c *ProgressBar) SetOnMouseEnter(f func())
- func (c *ProgressBar) SetOnMouseLeave(f func())
- func (c *ProgressBar) SetOnMouseMove(f func(x, y int))
- func (c *ProgressBar) SetOnMouseUp(f func(x, y int, button MouseButton))
- func (c *ProgressBar) SetOnMouseWheel(f func(x, y int, delta float64))
- func (c *ProgressBar) SetOnResize(f func())
- func (c *ProgressBar) SetPosition(x, y int)
- func (c *ProgressBar) SetSize(width, height int)
- func (p *ProgressBar) SetState(s ProgressState)
- func (c *ProgressBar) SetTabStop(on bool)
- func (c *ProgressBar) SetTextColor(col Color)
- func (c *ProgressBar) SetToolTip(text string)
- func (p *ProgressBar) SetValue(v float64)
- func (p *ProgressBar) SetVertical(v bool)
- func (c *ProgressBar) SetVerticalAnchor(a Anchor)
- func (c *ProgressBar) SetVisible(v bool)
- func (c *ProgressBar) SetWidth(width int)
- func (c *ProgressBar) SetX(x int)
- func (c *ProgressBar) SetY(y int)
- func (c *ProgressBar) Size() (width, height int)
- func (p *ProgressBar) State() ProgressState
- func (c *ProgressBar) TabStop() bool
- func (c *ProgressBar) TextColor() Color
- func (c *ProgressBar) ToolTip() string
- func (p *ProgressBar) Value() float64
- func (p *ProgressBar) Vertical() bool
- func (c *ProgressBar) VerticalAnchor() Anchor
- func (c *ProgressBar) Visible() bool
- func (c *ProgressBar) Width() int
- func (c *ProgressBar) X() int
- func (c *ProgressBar) Y() int
- type ProgressState
- type RadioButton
- func (r *RadioButton) Checked() bool
- func (c *RadioButton) Focus()
- func (c *RadioButton) Font() *Font
- func (c *RadioButton) HasFocus() bool
- func (r *RadioButton) OnCheck() func(checked bool)
- func (r *RadioButton) OnTabFocus() func()
- func (r *RadioButton) SetChecked(checked bool)
- func (c *RadioButton) SetFont(font *Font)
- func (r *RadioButton) SetOnCheck(f func(checked bool))
- func (r *RadioButton) SetOnTabFocus(f func())
- func (c *RadioButton) SetText(text string)
- func (r *RadioButton) SetTextColor(col Color)
- func (c *RadioButton) Text() string
- type Rectangle
- type RichEdit
- func (c *RichEdit) AppendText(text string)
- func (r *RichEdit) CanRedo() bool
- func (c *RichEdit) CanUndo() bool
- func (c *RichEdit) Copy()
- func (c *RichEdit) CursorLine() int
- func (c *RichEdit) CursorPosition() (start, end int)
- func (c *RichEdit) Cut()
- func (c *RichEdit) DeleteSelection()
- func (c *RichEdit) LineCount() int
- func (r *RichEdit) OnTabFocus() func()
- func (c *RichEdit) Paste()
- func (r *RichEdit) RTF() string
- func (r *RichEdit) ReadOnly() bool
- func (r *RichEdit) Redo() bool
- func (c *RichEdit) ReplaceSelection(text string)
- func (c *RichEdit) ScrollToCaret()
- func (c *RichEdit) SelectAll()
- func (r *RichEdit) SelectedText() string
- func (r *RichEdit) SetAllFont(name string, points int)
- func (r *RichEdit) SetAutoDetectLinks(on bool)
- func (r *RichEdit) SetBackgroundColor(c Color)
- func (c *RichEdit) SetCueBanner(text string, showWhenFocused bool)
- func (c *RichEdit) SetCursorPosition(pos int)
- func (c *RichEdit) SetNumbersOnly(on bool)
- func (r *RichEdit) SetOnLinkClick(f func(url string))
- func (r *RichEdit) SetOnSelectionChange(f func())
- func (r *RichEdit) SetOnTabFocus(f func())
- func (r *RichEdit) SetOnTextChange(f func())
- func (r *RichEdit) SetRTF(rtf string)
- func (r *RichEdit) SetReadOnly(ro bool)
- func (c *RichEdit) SetSelection(start, end int)
- func (r *RichEdit) SetSelectionAlignment(a EditAlign)
- func (r *RichEdit) SetSelectionBackColor(c Color)
- func (r *RichEdit) SetSelectionBold(on bool)
- func (r *RichEdit) SetSelectionBullets(on bool)
- func (r *RichEdit) SetSelectionColor(c Color)
- func (r *RichEdit) SetSelectionFont(name string, points int)
- func (r *RichEdit) SetSelectionItalic(on bool)
- func (r *RichEdit) SetSelectionStrikeout(on bool)
- func (r *RichEdit) SetSelectionUnderline(on bool)
- func (c *RichEdit) SetTextAlign(a EditAlign)
- func (r *RichEdit) SetWordWrap(wrap bool)
- func (r *RichEdit) SetWritesTabs(on bool)
- func (c *RichEdit) Undo() bool
- type ScrollBar
- func (c *ScrollBar) Anchors() (horizontal, vertical Anchor)
- func (c *ScrollBar) BackgroundColor() Color
- func (c *ScrollBar) Bounds() (x, y, width, height int)
- func (c *ScrollBar) ContextMenu() *PopupMenu
- func (c *ScrollBar) Enabled() bool
- func (c *ScrollBar) Focus()
- func (c *ScrollBar) Handle() uintptr
- func (c *ScrollBar) HasBackgroundColor() bool
- func (c *ScrollBar) HasFocus() bool
- func (c *ScrollBar) HasTextColor() bool
- func (c *ScrollBar) Height() int
- func (c *ScrollBar) HorizontalAnchor() Anchor
- func (c *ScrollBar) OnDropFiles() DropFilesFunc
- func (c *ScrollBar) OnResize() func()
- func (c *ScrollBar) Parent() Container
- func (s *ScrollBar) Position() int
- func (c *ScrollBar) ResetBackgroundColor()
- func (c *ScrollBar) ResetTextColor()
- func (c *ScrollBar) SetAnchors(horizontal, vertical Anchor)
- func (c *ScrollBar) SetBackgroundColor(col Color)
- func (c *ScrollBar) SetBounds(x, y, width, height int)
- func (c *ScrollBar) SetContextMenu(m *PopupMenu)
- func (c *ScrollBar) SetCursor(cur *Cursor)
- func (c *ScrollBar) SetEnabled(e bool)
- func (c *ScrollBar) SetHeight(height int)
- func (c *ScrollBar) SetHorizontalAnchor(a Anchor)
- func (s *ScrollBar) SetLineSize(n int)
- func (c *ScrollBar) SetOnBlur(f func())
- func (s *ScrollBar) SetOnChange(f func(pos int))
- func (c *ScrollBar) SetOnChar(f func(r rune))
- func (c *ScrollBar) SetOnDoubleClick(f func(x, y int, button MouseButton))
- func (c *ScrollBar) SetOnDropFiles(f DropFilesFunc)
- func (c *ScrollBar) SetOnFocus(f func())
- func (c *ScrollBar) SetOnKeyDown(f func(key int))
- func (c *ScrollBar) SetOnKeyUp(f func(key int))
- func (c *ScrollBar) SetOnMouseDown(f func(x, y int, button MouseButton))
- func (c *ScrollBar) SetOnMouseEnter(f func())
- func (c *ScrollBar) SetOnMouseLeave(f func())
- func (c *ScrollBar) SetOnMouseMove(f func(x, y int))
- func (c *ScrollBar) SetOnMouseUp(f func(x, y int, button MouseButton))
- func (c *ScrollBar) SetOnMouseWheel(f func(x, y int, delta float64))
- func (c *ScrollBar) SetOnResize(f func())
- func (s *ScrollBar) SetPage(page int)
- func (s *ScrollBar) SetPosition(pos int)
- func (s *ScrollBar) SetRange(min, max int)
- func (c *ScrollBar) SetSize(width, height int)
- func (c *ScrollBar) SetTabStop(on bool)
- func (c *ScrollBar) SetTextColor(col Color)
- func (c *ScrollBar) SetToolTip(text string)
- func (s *ScrollBar) SetVertical(vertical bool)
- func (c *ScrollBar) SetVerticalAnchor(a Anchor)
- func (c *ScrollBar) SetVisible(v bool)
- func (c *ScrollBar) SetWidth(width int)
- func (c *ScrollBar) SetX(x int)
- func (c *ScrollBar) SetY(y int)
- func (c *ScrollBar) Size() (width, height int)
- func (c *ScrollBar) TabStop() bool
- func (c *ScrollBar) TextColor() Color
- func (c *ScrollBar) ToolTip() string
- func (c *ScrollBar) VerticalAnchor() Anchor
- func (c *ScrollBar) Visible() bool
- func (c *ScrollBar) Width() int
- func (c *ScrollBar) X() int
- func (c *ScrollBar) Y() int
- type ScrollPanel
- func (s *ScrollPanel) Add(c Control)
- func (c *ScrollPanel) Anchors() (horizontal, vertical Anchor)
- func (c *ScrollPanel) BackgroundColor() Color
- func (c *ScrollPanel) Bounds() (x, y, width, height int)
- func (s *ScrollPanel) ContentPosition() (x, y int)
- func (s *ScrollPanel) ContentSize() (w, h int)
- func (c *ScrollPanel) ContextMenu() *PopupMenu
- func (c *ScrollPanel) Enabled() bool
- func (c *ScrollPanel) Focus()
- func (c *ScrollPanel) Handle() uintptr
- func (c *ScrollPanel) HasBackgroundColor() bool
- func (c *ScrollPanel) HasFocus() bool
- func (c *ScrollPanel) HasTextColor() bool
- func (c *ScrollPanel) Height() int
- func (c *ScrollPanel) HorizontalAnchor() Anchor
- func (c *ScrollPanel) OnDropFiles() DropFilesFunc
- func (c *ScrollPanel) OnResize() func()
- func (c *ScrollPanel) Parent() Container
- func (c *ScrollPanel) Position() (x, y int)
- func (s *ScrollPanel) Remove(c Control)
- func (c *ScrollPanel) ResetBackgroundColor()
- func (c *ScrollPanel) ResetTextColor()
- func (s *ScrollPanel) ScrollIntoView(c Control)
- func (s *ScrollPanel) ScrollTo(x, y int)
- func (c *ScrollPanel) SetAnchors(horizontal, vertical Anchor)
- func (s *ScrollPanel) SetAutoContentSize()
- func (c *ScrollPanel) SetBackgroundColor(col Color)
- func (s *ScrollPanel) SetBounds(x, y, width, height int)
- func (s *ScrollPanel) SetContentSize(width, height int)
- func (c *ScrollPanel) SetContextMenu(m *PopupMenu)
- func (c *ScrollPanel) SetCursor(cur *Cursor)
- func (c *ScrollPanel) SetEnabled(e bool)
- func (c *ScrollPanel) SetHorizontalAnchor(a Anchor)
- func (c *ScrollPanel) SetOnBlur(f func())
- func (c *ScrollPanel) SetOnChar(f func(r rune))
- func (c *ScrollPanel) SetOnDoubleClick(f func(x, y int, button MouseButton))
- func (c *ScrollPanel) SetOnDropFiles(f DropFilesFunc)
- func (c *ScrollPanel) SetOnFocus(f func())
- func (c *ScrollPanel) SetOnKeyDown(f func(key int))
- func (c *ScrollPanel) SetOnKeyUp(f func(key int))
- func (c *ScrollPanel) SetOnMouseDown(f func(x, y int, button MouseButton))
- func (c *ScrollPanel) SetOnMouseEnter(f func())
- func (c *ScrollPanel) SetOnMouseLeave(f func())
- func (c *ScrollPanel) SetOnMouseMove(f func(x, y int))
- func (c *ScrollPanel) SetOnMouseUp(f func(x, y int, button MouseButton))
- func (c *ScrollPanel) SetOnMouseWheel(f func(x, y int, delta float64))
- func (c *ScrollPanel) SetOnResize(f func())
- func (c *ScrollPanel) SetTabStop(on bool)
- func (c *ScrollPanel) SetTextColor(col Color)
- func (c *ScrollPanel) SetToolTip(text string)
- func (c *ScrollPanel) SetVerticalAnchor(a Anchor)
- func (c *ScrollPanel) SetVisible(v bool)
- func (c *ScrollPanel) Size() (width, height int)
- func (c *ScrollPanel) TabStop() bool
- func (c *ScrollPanel) TextColor() Color
- func (c *ScrollPanel) ToolTip() string
- func (s *ScrollPanel) Update()
- func (c *ScrollPanel) VerticalAnchor() Anchor
- func (c *ScrollPanel) Visible() bool
- func (c *ScrollPanel) Width() int
- func (c *ScrollPanel) X() int
- func (c *ScrollPanel) Y() int
- type Slider
- func (c *Slider) Anchors() (horizontal, vertical Anchor)
- func (s *Slider) ArrowIncrement() int
- func (c *Slider) BackgroundColor() Color
- func (c *Slider) Bounds() (x, y, width, height int)
- func (c *Slider) ContextMenu() *PopupMenu
- func (s *Slider) CursorPosition() int
- func (c *Slider) Enabled() bool
- func (c *Slider) Focus()
- func (c *Slider) Handle() uintptr
- func (c *Slider) HasBackgroundColor() bool
- func (c *Slider) HasFocus() bool
- func (c *Slider) HasTextColor() bool
- func (c *Slider) Height() int
- func (c *Slider) HorizontalAnchor() Anchor
- func (s *Slider) Max() int
- func (s *Slider) Min() int
- func (s *Slider) MinMax() (min, max int)
- func (s *Slider) MouseIncrement() int
- func (s *Slider) OnChange() func(cursor int)
- func (c *Slider) OnDropFiles() DropFilesFunc
- func (c *Slider) OnResize() func()
- func (s *Slider) OnTabFocus() func()
- func (s *Slider) Orientation() SliderOrientation
- func (c *Slider) Parent() Container
- func (c *Slider) Position() (x, y int)
- func (c *Slider) ResetBackgroundColor()
- func (c *Slider) ResetTextColor()
- func (c *Slider) SetAnchors(horizontal, vertical Anchor)
- func (s *Slider) SetArrowIncrement(inc int)
- func (c *Slider) SetBackgroundColor(col Color)
- func (c *Slider) SetBounds(x, y, width, height int)
- func (c *Slider) SetContextMenu(m *PopupMenu)
- func (c *Slider) SetCursor(cur *Cursor)
- func (s *Slider) SetCursorPosition(cursor int)
- func (c *Slider) SetEnabled(e bool)
- func (c *Slider) SetHeight(height int)
- func (c *Slider) SetHorizontalAnchor(a Anchor)
- func (s *Slider) SetMax(max int)
- func (s *Slider) SetMin(min int)
- func (s *Slider) SetMinMax(min, max int)
- func (s *Slider) SetMouseIncrement(inc int)
- func (c *Slider) SetOnBlur(f func())
- func (s *Slider) SetOnChange(f func(cursor int))
- func (c *Slider) SetOnChar(f func(r rune))
- func (c *Slider) SetOnDoubleClick(f func(x, y int, button MouseButton))
- func (c *Slider) SetOnDropFiles(f DropFilesFunc)
- func (c *Slider) SetOnFocus(f func())
- func (c *Slider) SetOnKeyDown(f func(key int))
- func (c *Slider) SetOnKeyUp(f func(key int))
- func (c *Slider) SetOnMouseDown(f func(x, y int, button MouseButton))
- func (c *Slider) SetOnMouseEnter(f func())
- func (c *Slider) SetOnMouseLeave(f func())
- func (c *Slider) SetOnMouseMove(f func(x, y int))
- func (c *Slider) SetOnMouseUp(f func(x, y int, button MouseButton))
- func (c *Slider) SetOnMouseWheel(f func(x, y int, delta float64))
- func (c *Slider) SetOnResize(f func())
- func (s *Slider) SetOnTabFocus(f func())
- func (s *Slider) SetOrientation(o SliderOrientation)
- func (c *Slider) SetPosition(x, y int)
- func (c *Slider) SetSize(width, height int)
- func (c *Slider) SetTabStop(on bool)
- func (c *Slider) SetTextColor(col Color)
- func (s *Slider) SetTickFrequency(n int)
- func (s *Slider) SetTickPosition(p TickPosition)
- func (s *Slider) SetTicksVisible(show bool)
- func (c *Slider) SetToolTip(text string)
- func (c *Slider) SetVerticalAnchor(a Anchor)
- func (c *Slider) SetVisible(v bool)
- func (c *Slider) SetWidth(width int)
- func (c *Slider) SetX(x int)
- func (c *Slider) SetY(y int)
- func (c *Slider) Size() (width, height int)
- func (c *Slider) TabStop() bool
- func (c *Slider) TextColor() Color
- func (s *Slider) TickFrequency() int
- func (s *Slider) TickPosition() TickPosition
- func (s *Slider) TicksVisible() bool
- func (c *Slider) ToolTip() string
- func (c *Slider) VerticalAnchor() Anchor
- func (c *Slider) Visible() bool
- func (c *Slider) Width() int
- func (c *Slider) X() int
- func (c *Slider) Y() int
- type SliderOrientation
- type SplitDirection
- type Splitter
- func (c Splitter) Anchors() (horizontal, vertical Anchor)
- func (c Splitter) BackgroundColor() Color
- func (c Splitter) Bounds() (x, y, width, height int)
- func (c Splitter) ContextMenu() *PopupMenu
- func (c Splitter) Enabled() bool
- func (c Splitter) Focus()
- func (c Splitter) Handle() uintptr
- func (c Splitter) HasBackgroundColor() bool
- func (c Splitter) HasFocus() bool
- func (c Splitter) HasTextColor() bool
- func (c Splitter) Height() int
- func (c Splitter) HorizontalAnchor() Anchor
- func (c Splitter) OnDropFiles() DropFilesFunc
- func (c Splitter) OnResize() func()
- func (c Splitter) Parent() Container
- func (c Splitter) Position() (x, y int)
- func (c Splitter) ResetBackgroundColor()
- func (c Splitter) ResetTextColor()
- func (c Splitter) SetAnchors(horizontal, vertical Anchor)
- func (s *Splitter) SetBackColor(c Color)
- func (c Splitter) SetBackgroundColor(col Color)
- func (c Splitter) SetBounds(x, y, width, height int)
- func (c Splitter) SetContextMenu(m *PopupMenu)
- func (c Splitter) SetCursor(cur *Cursor)
- func (c Splitter) SetEnabled(e bool)
- func (c Splitter) SetHeight(height int)
- func (c Splitter) SetHorizontalAnchor(a Anchor)
- func (s *Splitter) SetMinSizes(first, second int)
- func (c Splitter) SetOnBlur(f func())
- func (c Splitter) SetOnChar(f func(r rune))
- func (c Splitter) SetOnDropFiles(f DropFilesFunc)
- func (c Splitter) SetOnFocus(f func())
- func (c Splitter) SetOnKeyDown(f func(key int))
- func (c Splitter) SetOnKeyUp(f func(key int))
- func (c Splitter) SetOnMouseEnter(f func())
- func (c Splitter) SetOnMouseLeave(f func())
- func (c Splitter) SetOnMouseWheel(f func(x, y int, delta float64))
- func (s *Splitter) SetOnMove(f func())
- func (c Splitter) SetOnResize(f func())
- func (c Splitter) SetPosition(x, y int)
- func (c Splitter) SetSize(width, height int)
- func (c Splitter) SetTabStop(on bool)
- func (c Splitter) SetTextColor(col Color)
- func (c Splitter) SetToolTip(text string)
- func (c Splitter) SetVerticalAnchor(a Anchor)
- func (c Splitter) SetVisible(v bool)
- func (c Splitter) SetWidth(width int)
- func (c Splitter) SetX(x int)
- func (c Splitter) SetY(y int)
- func (c Splitter) Size() (width, height int)
- func (c Splitter) TabStop() bool
- func (c Splitter) TextColor() Color
- func (c Splitter) ToolTip() string
- func (c Splitter) VerticalAnchor() Anchor
- func (c Splitter) Visible() bool
- func (c Splitter) Width() int
- func (c Splitter) X() int
- func (c Splitter) Y() int
- type StatusBar
- func (c *StatusBar) Focus()
- func (c *StatusBar) Font() *Font
- func (c *StatusBar) HasFocus() bool
- func (c *StatusBar) SetFont(font *Font)
- func (s *StatusBar) SetPartText(index int, text string)
- func (s *StatusBar) SetParts(widths ...int)
- func (c *StatusBar) SetText(text string)
- func (c *StatusBar) Text() string
- type StringList
- func (l *StringList) AddItem(s string)
- func (l *StringList) Clear()
- func (c *StringList) Focus()
- func (c *StringList) Font() *Font
- func (c *StringList) HasFocus() bool
- func (l *StringList) Items() []string
- func (l *StringList) OnChange() func(newIndex int)
- func (l *StringList) SelectedIndex() int
- func (c *StringList) SetFont(font *Font)
- func (l *StringList) SetItems(items []string)
- func (l *StringList) SetOnChange(f func(newIndex int))
- func (l *StringList) SetSelectedIndex(i int)
- func (c *StringList) SetText(text string)
- func (c *StringList) Text() string
- type StringTable
- func (c *StringTable) Clear()
- func (c *StringTable) ColCount() int
- func (c *StringTable) DeleteRow(row int)
- func (c *StringTable) Focus()
- func (c *StringTable) Font() *Font
- func (c *StringTable) HasFocus() bool
- func (c *StringTable) OnSelectionChange() func()
- func (s *StringTable) OnTabFocus() func()
- func (c *StringTable) RowCount() int
- func (c *StringTable) SelectedRow() int
- func (c *StringTable) SetCell(col, row int, s string)
- func (c *StringTable) SetFont(font *Font)
- func (c *StringTable) SetOnSelectionChange(f func())
- func (s *StringTable) SetOnTabFocus(f func())
- func (c *StringTable) SetText(text string)
- func (c *StringTable) Text() string
- type Stroke
- type TabControl
- func (t *TabControl) AddPage(title string, page Control, image int)
- func (t *TabControl) AddTab(title string)
- func (t *TabControl) AddTabWithImage(title string, image int)
- func (t *TabControl) ContentBounds() (x, y, width, height int)
- func (c *TabControl) Focus()
- func (c *TabControl) Font() *Font
- func (c *TabControl) HasFocus() bool
- func (t *TabControl) OnChange() func(index int)
- func (t *TabControl) Page(index int) Control
- func (t *TabControl) SelectedIndex() int
- func (t *TabControl) SetBounds(x, y, width, height int)
- func (c *TabControl) SetFont(font *Font)
- func (t *TabControl) SetImages(il *ImageList)
- func (t *TabControl) SetOnChange(f func(index int))
- func (t *TabControl) SetSelectedIndex(i int)
- func (t *TabControl) SetTabs(titles []string)
- func (c *TabControl) SetText(text string)
- func (t *TabControl) Tabs() []string
- func (c *TabControl) Text() string
- type TaskButtons
- type TaskIcon
- type TaskbarProgressState
- type TextAlignment
- type TextEdit
- func (c *TextEdit) AppendText(text string)
- func (c *TextEdit) CanUndo() bool
- func (e *TextEdit) CharacterLimit() int
- func (c *TextEdit) Copy()
- func (c *TextEdit) CursorLine() int
- func (c *TextEdit) CursorPosition() (start, end int)
- func (c *TextEdit) Cut()
- func (c *TextEdit) DeleteSelection()
- func (c *TextEdit) LineCount() int
- func (e *TextEdit) OnTabFocus() func()
- func (e *TextEdit) OnTextChange() func()
- func (c *TextEdit) Paste()
- func (e *TextEdit) ReadOnly() bool
- func (c *TextEdit) ReplaceSelection(text string)
- func (c *TextEdit) ScrollToCaret()
- func (c *TextEdit) SelectAll()
- func (c *TextEdit) SelectedText() string
- func (e *TextEdit) SetCharacterLimit(count int)
- func (c *TextEdit) SetCueBanner(text string, showWhenFocused bool)
- func (c *TextEdit) SetCursorPosition(pos int)
- func (c *TextEdit) SetNumbersOnly(on bool)
- func (e *TextEdit) SetOnTabFocus(f func())
- func (e *TextEdit) SetOnTextChange(f func())
- func (e *TextEdit) SetReadOnly(readOnly bool)
- func (c *TextEdit) SetSelection(start, end int)
- func (c *TextEdit) SetTextAlign(a EditAlign)
- func (e *TextEdit) SetWordWrap(wrap bool)
- func (e *TextEdit) SetWritesTabs(tabs bool)
- func (c *TextEdit) Undo() bool
- func (e *TextEdit) WordWrap() bool
- func (e *TextEdit) WritesTabs() bool
- type TickPosition
- type Timer
- type ToolBar
- type TrayIcon
- func (t *TrayIcon) Icon() *Icon
- func (t *TrayIcon) Menu() *PopupMenu
- func (t *TrayIcon) SetIcon(icon *Icon)
- func (t *TrayIcon) SetMenu(m *PopupMenu)
- func (t *TrayIcon) SetOnBalloonClick(f func())
- func (t *TrayIcon) SetOnClick(f func())
- func (t *TrayIcon) SetOnDoubleClick(f func())
- func (t *TrayIcon) SetOnRightClick(f func())
- func (t *TrayIcon) SetRestoreOnClick(restore bool)
- func (t *TrayIcon) SetToolTip(text string)
- func (t *TrayIcon) SetVisible(v bool)
- func (t *TrayIcon) ShowBalloon(title, text string, kind BalloonKind)
- func (t *TrayIcon) ToolTip() string
- func (t *TrayIcon) Visible() bool
- type TreeNode
- func (n *TreeNode) Add(text string) *TreeNode
- func (n *TreeNode) Checked() bool
- func (n *TreeNode) Children() []*TreeNode
- func (n *TreeNode) Collapse()
- func (n *TreeNode) Expand()
- func (n *TreeNode) Parent() *TreeNode
- func (n *TreeNode) Remove()
- func (n *TreeNode) Select()
- func (n *TreeNode) SetChecked(on bool)
- func (n *TreeNode) SetImage(image, selected int)
- func (n *TreeNode) SetText(text string)
- func (n *TreeNode) Text() string
- type TreeView
- func (t *TreeView) Add(text string) *TreeNode
- func (t *TreeView) Clear()
- func (t *TreeView) CollapseAll()
- func (t *TreeView) ExpandAll()
- func (c *TreeView) Focus()
- func (c *TreeView) Font() *Font
- func (c *TreeView) HasFocus() bool
- func (t *TreeView) OnDoubleClick() func(*TreeNode)
- func (t *TreeView) OnSelect() func(*TreeNode)
- func (t *TreeView) Roots() []*TreeNode
- func (t *TreeView) Selected() *TreeNode
- func (t *TreeView) SetCheckBoxes(on bool)
- func (t *TreeView) SetEditable(on bool)
- func (c *TreeView) SetFont(font *Font)
- func (t *TreeView) SetImages(il *ImageList)
- func (t *TreeView) SetOnCheck(f func(n *TreeNode, checked bool))
- func (t *TreeView) SetOnCollapse(f func(*TreeNode))
- func (t *TreeView) SetOnDoubleClick(f func(*TreeNode))
- func (t *TreeView) SetOnExpand(f func(*TreeNode))
- func (t *TreeView) SetOnLabelEdit(f func(n *TreeNode, text string) bool)
- func (t *TreeView) SetOnSelect(f func(*TreeNode))
- func (c *TreeView) SetText(text string)
- func (c *TreeView) Text() string
- type VisibleControl
- type Window
- func (w *Window) AcceptFiles() bool
- func (w *Window) Add(c Control)
- func (w *Window) AddTimer(intervalMs int, f func()) *Timer
- func (w *Window) Alpha() uint8
- func (w *Window) ApplyDarkMode(p DarkPalette)
- func (w *Window) BackgroundColor() Color
- func (w *Window) Bounds() (x, y, width, height int)
- func (w *Window) Center()
- func (w *Window) CenterOnParent()
- func (w *Window) CenterOnScreen()
- func (w *Window) CenterOnShow() bool
- func (w *Window) Children() []Control
- func (w *Window) ClassName() string
- func (w *Window) Close()
- func (w *Window) CloseToTray() bool
- func (w *Window) ContextMenu() *PopupMenu
- func (w *Window) CornerRadius() int
- func (w *Window) Cursor() *Cursor
- func (w *Window) DPI() int
- func (w *Window) Destroy()
- func (w *Window) DisableAltF4()
- func (w *Window) DragByBackground() bool
- func (w *Window) EnableAltF4()
- func (w *Window) Enabled() bool
- func (w *Window) Flash(count int)
- func (w *Window) Font() *Font
- func (w *Window) Fullscreen() bool
- func (w *Window) GetBackground() Color
- func (w *Window) Handle() uintptr
- func (w *Window) HasBorder() bool
- func (w *Window) HasCloseButton() bool
- func (w *Window) HasMaxButton() bool
- func (w *Window) HasMinButton() bool
- func (w *Window) Headless() bool
- func (w *Window) Height() int
- func (w *Window) HideConsoleOnStart()
- func (w *Window) HideToTray()
- func (w *Window) Icon() *Icon
- func (w *Window) InnerBounds() (x, y, width, height int)
- func (w *Window) InnerHeight() int
- func (w *Window) InnerPosition() (x, y int)
- func (w *Window) InnerSize() (width, height int)
- func (w *Window) InnerWidth() int
- func (w *Window) InnerX() int
- func (w *Window) InnerY() int
- func (w *Window) Invoke(f func())
- func (w *Window) InvokeSync(f func())
- func (w *Window) Layout() Layout
- func (w *Window) MaxSize() (width, height int)
- func (w *Window) Menu() *Menu
- func (w *Window) MinSize() (width, height int)
- func (w *Window) MinimizeToTray() bool
- func (w *Window) Monitor() uintptr
- func (w *Window) OnCanClose() func() bool
- func (w *Window) OnChar() func(r rune)
- func (w *Window) OnClose() func()
- func (w *Window) OnDropFiles() DropFilesFunc
- func (w *Window) OnGUIThread() bool
- func (w *Window) OnKeyDown() func(key int)
- func (w *Window) OnKeyUp() func(key int)
- func (w *Window) OnMessage() MessageCallback
- func (w *Window) OnMouseDown() func(button MouseButton, x, y int)
- func (w *Window) OnMouseMove() func(x, y int)
- func (w *Window) OnMouseUp() func(button MouseButton, x, y int)
- func (w *Window) OnMouseWheel() func(x, y int, delta float64)
- func (w *Window) OnResize() func()
- func (w *Window) OnShow() func()
- func (w *Window) Parent() Container
- func (w *Window) Position() (x, y int)
- func (w *Window) Quit()
- func (w *Window) RegisterHotKey(mods HotKeyMod, key int, f func()) (int, error)
- func (w *Window) Relayout()
- func (w *Window) Remove(c Control)
- func (w *Window) Repaint()
- func (w *Window) Resizable() bool
- func (w *Window) RestoreFromTray()
- func (w *Window) Scale(px int) int
- func (w *Window) ScaleFactor() float64
- func (w *Window) Scroll(dx, dy int)
- func (w *Window) SetAcceptFiles(accept bool)
- func (w *Window) SetAlpha(a uint8)
- func (w *Window) SetBackground(c Color)
- func (w *Window) SetBackgroundColor(c Color)
- func (w *Window) SetBounds(x, y, width, height int)
- func (w *Window) SetCancelButton(b *Button)
- func (w *Window) SetCenterOnShow(center bool)
- func (w *Window) SetClassName(name string)
- func (w *Window) SetCloseToTray(on bool)
- func (w *Window) SetContextMenu(m *PopupMenu)
- func (w *Window) SetCornerRadius(radius int)
- func (w *Window) SetCursor(c *Cursor)
- func (w *Window) SetDarkTitleBar(dark bool)
- func (w *Window) SetDefaultButton(b *Button)
- func (w *Window) SetDragByBackground(on bool)
- func (w *Window) SetFont(f *Font)
- func (w *Window) SetFullscreen(on bool)
- func (w *Window) SetHasBorder(border bool)
- func (w *Window) SetHasCloseButton(hasClose bool)
- func (w *Window) SetHasMaxButton(hasMax bool)
- func (w *Window) SetHasMinButton(hasMin bool)
- func (w *Window) SetHeadless(headless bool)
- func (w *Window) SetHeight(height int)
- func (w *Window) SetIcon(icon *Icon)
- func (w *Window) SetInnerBounds(x, y, width, height int)
- func (w *Window) SetInnerHeight(height int)
- func (w *Window) SetInnerPosition(x, y int)
- func (w *Window) SetInnerSize(width, height int)
- func (w *Window) SetInnerWidth(width int)
- func (w *Window) SetInnerX(x int)
- func (w *Window) SetInnerY(y int)
- func (w *Window) SetLayout(l Layout)
- func (w *Window) SetMaxSize(width, height int)
- func (w *Window) SetMenu(m *Menu)
- func (w *Window) SetMinSize(width, height int)
- func (w *Window) SetMinimizeToTray(on bool)
- func (w *Window) SetOnActivate(f func(active bool))
- func (w *Window) SetOnCanClose(f func() bool)
- func (w *Window) SetOnChar(f func(r rune))
- func (w *Window) SetOnClose(f func())
- func (w *Window) SetOnDPIChanged(f func(dpi int))
- func (w *Window) SetOnDropFiles(f DropFilesFunc)
- func (w *Window) SetOnKeyDown(f func(key int))
- func (w *Window) SetOnKeyUp(f func(key int))
- func (w *Window) SetOnMessage(f MessageCallback)
- func (w *Window) SetOnMouseDown(f func(button MouseButton, x, y int))
- func (w *Window) SetOnMouseMove(f func(x, y int))
- func (w *Window) SetOnMouseUp(f func(button MouseButton, x, y int))
- func (w *Window) SetOnMouseWheel(f func(x, y int, delta float64))
- func (w *Window) SetOnMove(f func(x, y int))
- func (w *Window) SetOnResize(f func())
- func (w *Window) SetOnShow(f func())
- func (w *Window) SetOnStateChange(f func(WindowState))
- func (w *Window) SetOwner(parent *Window)
- func (w *Window) SetPosition(x, y int)
- func (w *Window) SetResizable(canResize bool)
- func (w *Window) SetShortcut(f func(), keys ...Key)
- func (w *Window) SetShowInTaskbar(show bool)
- func (w *Window) SetSize(width, height int)
- func (w *Window) SetState(s WindowState)
- func (w *Window) SetTabOrder(controls ...Control)
- func (w *Window) SetTaskbarProgress(state TaskbarProgressState, fraction float64)
- func (w *Window) SetTitle(title string)
- func (w *Window) SetTopMost(on bool)
- func (w *Window) SetTransparent(on bool)
- func (w *Window) SetTransparentColor(c Color)
- func (w *Window) SetTrayEnabled(on bool)
- func (w *Window) SetTrayIcon(t *TrayIcon)
- func (w *Window) SetTrayToolTip(text string)
- func (w *Window) SetWidth(width int)
- func (w *Window) SetX(x int)
- func (w *Window) SetY(y int)
- func (w *Window) Show() error
- func (w *Window) ShowConsoleOnStart()
- func (w *Window) ShowInTaskbar() bool
- func (w *Window) ShowModal() error
- func (w *Window) Size() (width, height int)
- func (w *Window) State() WindowState
- func (w *Window) StopFlashing()
- func (w *Window) Title() string
- func (w *Window) TopMost() bool
- func (w *Window) Transparent() bool
- func (w *Window) TransparentColor() Color
- func (w *Window) TrayEnabled() bool
- func (w *Window) TrayIcon() *TrayIcon
- func (w *Window) TrayToolTip() string
- func (w *Window) UnregisterHotKey(id int)
- func (w *Window) Visible() bool
- func (w *Window) Width() int
- func (w *Window) X() int
- func (w *Window) Y() int
- type WindowState
Constants ¶
const ( KeyLeftMouseButton = w32.VK_LBUTTON KeyRightMouseButton = w32.VK_RBUTTON KeyCancel = w32.VK_CANCEL KeyMiddleMouseButton = w32.VK_MBUTTON KeyXMouseButton1 = w32.VK_XBUTTON1 KeyXMouseButton2 = w32.VK_XBUTTON2 KeyBack = w32.VK_BACK KeyTab = w32.VK_TAB KeyClear = w32.VK_CLEAR KeyReturn = w32.VK_RETURN KeyShift = w32.VK_SHIFT KeyControl = w32.VK_CONTROL KeyAlt = w32.VK_MENU KeyPause = w32.VK_PAUSE KeyCapital = w32.VK_CAPITAL KeyKana = w32.VK_KANA KeyHangul = w32.VK_HANGUL KeyIMEOn = w32.VK_IME_ON KeyJunja = w32.VK_JUNJA KeyFinal = w32.VK_FINAL KeyHanja = w32.VK_HANJA KeyKanji = w32.VK_KANJI KeyIMEOff = w32.VK_IME_OFF KeyEscape = w32.VK_ESCAPE KeyConvert = w32.VK_CONVERT KeyNonConvert = w32.VK_NONCONVERT KeyAccept = w32.VK_ACCEPT KeyModeChange = w32.VK_MODECHANGE KeySpace = w32.VK_SPACE KeyPrior = w32.VK_PRIOR KeyNext = w32.VK_NEXT KeyEnd = w32.VK_END KeyHome = w32.VK_HOME KeyLeft = w32.VK_LEFT KeyUp = w32.VK_UP KeyRight = w32.VK_RIGHT KeyDown = w32.VK_DOWN KeySelect = w32.VK_SELECT KeyPrint = w32.VK_PRINT KeyExecute = w32.VK_EXECUTE KeySnapshot = w32.VK_SNAPSHOT KeyInsert = w32.VK_INSERT KeyDelete = w32.VK_DELETE KeyHelp = w32.VK_HELP Key0 = '0' Key1 = '1' Key2 = '2' Key3 = '3' Key4 = '4' Key5 = '5' Key6 = '6' Key7 = '7' Key8 = '8' Key9 = '9' KeyA = 'A' KeyB = 'B' KeyC = 'C' KeyD = 'D' KeyE = 'E' KeyF = 'F' KeyG = 'G' KeyH = 'H' KeyI = 'I' KeyJ = 'J' KeyK = 'K' KeyL = 'L' KeyM = 'M' KeyN = 'N' KeyO = 'O' KeyP = 'P' KeyQ = 'Q' KeyR = 'R' KeyS = 'S' KeyT = 'T' KeyU = 'U' KeyV = 'V' KeyW = 'W' KeyX = 'X' KeyY = 'Y' KeyZ = 'Z' KeyLeftWindows = w32.VK_LWIN KeyRightWindows = w32.VK_RWIN KeyApps = w32.VK_APPS KeySleep = w32.VK_SLEEP KeyNum0 = w32.VK_NUMPAD0 KeyNum1 = w32.VK_NUMPAD1 KeyNum2 = w32.VK_NUMPAD2 KeyNum3 = w32.VK_NUMPAD3 KeyNum4 = w32.VK_NUMPAD4 KeyNum5 = w32.VK_NUMPAD5 KeyNum6 = w32.VK_NUMPAD6 KeyNum7 = w32.VK_NUMPAD7 KeyNum8 = w32.VK_NUMPAD8 KeyNum9 = w32.VK_NUMPAD9 KeyMultiply = w32.VK_MULTIPLY KeyAdd = w32.VK_ADD KeySeparator = w32.VK_SEPARATOR KeySubtract = w32.VK_SUBTRACT KeyDecimal = w32.VK_DECIMAL KeyDivide = w32.VK_DIVIDE KeyF1 = w32.VK_F1 KeyF2 = w32.VK_F2 KeyF3 = w32.VK_F3 KeyF4 = w32.VK_F4 KeyF5 = w32.VK_F5 KeyF6 = w32.VK_F6 KeyF7 = w32.VK_F7 KeyF8 = w32.VK_F8 KeyF9 = w32.VK_F9 KeyF10 = w32.VK_F10 KeyF11 = w32.VK_F11 KeyF12 = w32.VK_F12 KeyF13 = w32.VK_F13 KeyF14 = w32.VK_F14 KeyF15 = w32.VK_F15 KeyF16 = w32.VK_F16 KeyF17 = w32.VK_F17 KeyF18 = w32.VK_F18 KeyF19 = w32.VK_F19 KeyF20 = w32.VK_F20 KeyF21 = w32.VK_F21 KeyF22 = w32.VK_F22 KeyF23 = w32.VK_F23 KeyF24 = w32.VK_F24 KeyNumLock = w32.VK_NUMLOCK KeyScroll = w32.VK_SCROLL KeyOEMNecEqual = w32.VK_OEM_NEC_EQUAL KeyOEMFjJisho = w32.VK_OEM_FJ_JISHO KeyOEMFjMasshou = w32.VK_OEM_FJ_MASSHOU KeyOEMFjTouroku = w32.VK_OEM_FJ_TOUROKU KeyOEMFjLoya = w32.VK_OEM_FJ_LOYA KeyOEMFjRoya = w32.VK_OEM_FJ_ROYA KeyLeftShift = w32.VK_LSHIFT KeyRightShift = w32.VK_RSHIFT KeyLeftControl = w32.VK_LCONTROL KeyRightControl = w32.VK_RCONTROL KeyLeftAlt = w32.VK_LMENU KeyRightAlt = w32.VK_RMENU KeyBrowserBack = w32.VK_BROWSER_BACK KeyBrowserForward = w32.VK_BROWSER_FORWARD KeyBrowserRefresh = w32.VK_BROWSER_REFRESH KeyBrowserStop = w32.VK_BROWSER_STOP KeyBrowserSearch = w32.VK_BROWSER_SEARCH KeyBrowserFavorites = w32.VK_BROWSER_FAVORITES KeyBrowserHome = w32.VK_BROWSER_HOME KeyVolumeMute = w32.VK_VOLUME_MUTE KeyVolumeDown = w32.VK_VOLUME_DOWN KeyVolumeUp = w32.VK_VOLUME_UP KeyMediaNextTrack = w32.VK_MEDIA_NEXT_TRACK KeyMediaPrevTrack = w32.VK_MEDIA_PREV_TRACK KeyMediaStop = w32.VK_MEDIA_STOP KeyMediaPlayPause = w32.VK_MEDIA_PLAY_PAUSE KeyLaunchMail = w32.VK_LAUNCH_MAIL KeyLaunchMediaSelect = w32.VK_LAUNCH_MEDIA_SELECT KeyLaunchApp1 = w32.VK_LAUNCH_APP1 KeyLaunchApp2 = w32.VK_LAUNCH_APP2 KeyOEM1 = w32.VK_OEM_1 KeyOEMPlus = w32.VK_OEM_PLUS KeyOEMComma = w32.VK_OEM_COMMA KeyOEMMinus = w32.VK_OEM_MINUS KeyOEMPeriod = w32.VK_OEM_PERIOD KeyOEM2 = w32.VK_OEM_2 KeyOEM3 = w32.VK_OEM_3 KeyOEM4 = w32.VK_OEM_4 KeyOEM5 = w32.VK_OEM_5 KeyOEM6 = w32.VK_OEM_6 KeyOEM7 = w32.VK_OEM_7 KeyOEM8 = w32.VK_OEM_8 KeyOEMAx = w32.VK_OEM_AX KeyOEM102 = w32.VK_OEM_102 KeyIcoHelp = w32.VK_ICO_HELP KeyIco00 = w32.VK_ICO_00 KeyProcesskey = w32.VK_PROCESSKEY KeyIcoClear = w32.VK_ICO_CLEAR KeyPacket = w32.VK_PACKET KeyOEMReset = w32.VK_OEM_RESET KeyOEMJump = w32.VK_OEM_JUMP KeyOEMPA1 = w32.VK_OEM_PA1 KeyOEMPA2 = w32.VK_OEM_PA2 KeyOEMPA3 = w32.VK_OEM_PA3 KeyOEMWSControl = w32.VK_OEM_WSCTRL KeyOEMCuSel = w32.VK_OEM_CUSEL KeyOEMAttention = w32.VK_OEM_ATTN KeyOEMFinish = w32.VK_OEM_FINISH KeyOEMCopy = w32.VK_OEM_COPY KeyOEMAuto = w32.VK_OEM_AUTO KeyOEMEnlw = w32.VK_OEM_ENLW KeyOEMBacktab = w32.VK_OEM_BACKTAB KeyAttention = w32.VK_ATTN KeyCrSel = w32.VK_CRSEL KeyExSel = w32.VK_EXSEL KeyErEOF = w32.VK_EREOF KeyPlay = w32.VK_PLAY KeyZoom = w32.VK_ZOOM KeyNoName = w32.VK_NONAME KeyPa1 = w32.VK_PA1 KeyOEMClear = w32.VK_OEM_CLEAR )
These are the keyboard key constants.
const DarkTheme = "DarkMode_Explorer"
DarkTheme is the name of the control theme that gives scroll bars, lists, trees, edit boxes and similar controls a dark look on Windows 10 and 11.
Variables ¶
var ( // Scroll bar gray area. ColorScrollBar = sysColor(w32.COLOR_SCROLLBAR) // Desktop. ColorBackground = sysColor(w32.COLOR_BACKGROUND) // Desktop. ColorDesktop = sysColor(w32.COLOR_DESKTOP) // Active window title bar. The associated foreground color is // COLOR_CAPTIONTEXT. Specifies the left side color in the color gradient of // an active window's title bar if the gradient effect is enabled. ColorActiveCaption = sysColor(w32.COLOR_ACTIVECAPTION) // Inactive window caption. The associated foreground color is // COLOR_INACTIVECAPTIONTEXT. Specifies the left side color in the color // gradient of an inactive window's title bar if the gradient effect is // enabled. ColorInactiveCaption = sysColor(w32.COLOR_INACTIVECAPTION) // Menu background. The associated foreground color is COLOR_MENUTEXT. ColorMenu = sysColor(w32.COLOR_MENU) // Window background. The associated foreground colors are COLOR_WINDOWTEXT // and COLOR_HOTLITE. ColorWindow = sysColor(w32.COLOR_WINDOW) // Window frame. ColorWindowFrame = sysColor(w32.COLOR_WINDOWFRAME) // Text in menus. The associated background color is COLOR_MENU. ColorMenuText = sysColor(w32.COLOR_MENUTEXT) // Text in windows. The associated background color is COLOR_WINDOW. ColorWindowText = sysColor(w32.COLOR_WINDOWTEXT) // Text in caption, size box, and scroll bar arrow box. The associated // background color is COLOR_ACTIVECAPTION. ColorCaptionText = sysColor(w32.COLOR_CAPTIONTEXT) // Active window border. ColorActiveBorder = sysColor(w32.COLOR_ACTIVEBORDER) // Inactive window border. ColorInactiveBorder = sysColor(w32.COLOR_INACTIVEBORDER) // Background color of multiple document interface (MDI) applications. ColorAppWorkspace = sysColor(w32.COLOR_APPWORKSPACE) // Item(s) selected in a control. The associated foreground color is // COLOR_HIGHLIGHTTEXT. ColorHighlight = sysColor(w32.COLOR_HIGHLIGHT) // Text of item(s) selected in a control. The associated background color is // COLOR_HIGHLIGHT. ColorHighlightText = sysColor(w32.COLOR_HIGHLIGHTTEXT) // Face color for three-dimensional display elements and for dialog box // backgrounds. Color3DFace = sysColor(w32.COLOR_3DFACE) // Face color for three-dimensional display elements and for dialog box // backgrounds. The associated foreground color is COLOR_BTNTEXT. ColorButtonFace = sysColor(w32.COLOR_BTNFACE) // Shadow color for three-dimensional display elements (for edges facing // away from the light source). Color3DShadow = sysColor(w32.COLOR_3DSHADOW) // Shadow color for three-dimensional display elements (for edges facing // away from the light source). ColorButtonShadow = sysColor(w32.COLOR_BTNSHADOW) // Grayed (disabled) text. This color is set to 0 if the current display // driver does not support a solid gray color. ColorGrayText = sysColor(w32.COLOR_GRAYTEXT) // Text on push buttons. The associated background color is COLOR_BTNFACE. ColorButtonText = sysColor(w32.COLOR_BTNTEXT) // Color of text in an inactive caption. The associated background color is // COLOR_INACTIVECAPTION. ColorInactiveCaptionText = sysColor(w32.COLOR_INACTIVECAPTIONTEXT) // Highlight color for three-dimensional display elements (for edges facing // the light source.) Color3DHighlight = sysColor(w32.COLOR_3DHIGHLIGHT) // Highlight color for three-dimensional display elements (for edges facing // the light source.) ColorButtonHighlight = sysColor(w32.COLOR_BTNHIGHLIGHT) // Dark shadow for three-dimensional display elements. Color3DDarkShadow = sysColor(w32.COLOR_3DDKSHADOW) // Light color for three-dimensional display elements (for edges facing the // light source.) Color3DLight = sysColor(w32.COLOR_3DLIGHT) // Text color for tooltip controls. The associated background color is // COLOR_INFOBK. ColorInfoText = sysColor(w32.COLOR_INFOTEXT) // Background color for tooltip controls. The associated foreground color is // COLOR_INFOTEXT. ColorInfoBackground = sysColor(w32.COLOR_INFOBK) // Color for a hyperlink or hot-tracked item. The associated background // color is COLOR_WINDOW. ColorHotlight = sysColor(w32.COLOR_HOTLIGHT) // Right side color in the color gradient of an active window's title bar. // COLOR_ACTIVECAPTION specifies the left side color. Use // SPI_GETGRADIENTCAPTIONS with the SystemParametersInfo function to // determine whether the gradient effect is enabled. ColorGradientActiveCaption = sysColor(w32.COLOR_GRADIENTACTIVECAPTION) // Right side color in the color gradient of an inactive window's title bar. // COLOR_INACTIVECAPTION specifies the left side color. ColorGradientInactiveCaption = sysColor(w32.COLOR_GRADIENTINACTIVECAPTION) // The color used to highlight menu items when the menu appears as a flat // menu (see SystemParametersInfo). The highlighted menu item is outlined // with COLOR_HIGHLIGHT. Windows 2000: This value is not supported. ColorMenuHighlight = sysColor(w32.COLOR_MENUHILIGHT) // The background color for the menu bar when menus appear as flat menus // (see SystemParametersInfo). However, COLOR_MENU continues to specify the // background color of the menu popup. Windows 2000: This value is not // supported. ColorMenuBar = sysColor(w32.COLOR_MENUBAR) )
These are predefined colors defined by the current Windows theme.
var ( // CursorArrow is the standard, default arrow cursor. CursorArrow = loadCursor(w32.IDC_ARROW) // CursorIBeam is the text cursor, it looks like the letter I. CursorIBeam = loadCursor(w32.IDC_IBEAM) // CursorWait is the hour glass or rotating circle cursor that indicates // that an action will take some more time. CursorWait = loadCursor(w32.IDC_WAIT) // CursorCross looks like a black + (plus) symbol. CursorCross = loadCursor(w32.IDC_CROSS) // CursorUpArrow is a vertical arrow pointing upwards. CursorUpArrow = loadCursor(w32.IDC_UPARROW) // CursorSizeNWSE is a diagonal line from top-left to bottom-right with // arrows at both ends. CursorSizeNWSE = loadCursor(w32.IDC_SIZENWSE) // CursorSizeNESW is a diagonal line from top-right to bottom-left with // arrows at both ends. CursorSizeNESW = loadCursor(w32.IDC_SIZENESW) // CursorSizeWE is a horizontal line from left to right with arrows at both // ends. CursorSizeWE = loadCursor(w32.IDC_SIZEWE) // CursorSizeNS is a vertical line from top to bottom with arrows at both // ends. CursorSizeNS = loadCursor(w32.IDC_SIZENS) // CursorSizeAll is a white + (plus) symbol with arrows at all four ends. CursorSizeAll = loadCursor(w32.IDC_SIZEALL) // CursorNo indicates that an action is not possible. It is a crossed-out // red circle, like a stop sign. CursorNo = loadCursor(w32.IDC_NO) // CursorHand is a hand pointing its index finger upwards. CursorHand = loadCursor(w32.IDC_HAND) // CursorAppStarting is a combination of CursorArrow and CursorWait, it has // the arrow cursor but with an hour glass or rotating circle next to it. CursorAppStarting = loadCursor(w32.IDC_APPSTARTING) // CursorHelp is the default arrow cursor with a little question mark icon // next to it. CursorHelp = loadCursor(w32.IDC_HELP) )
var ( // IconApplication is the default application icon. IconApplication = loadIcon(w32.IDI_APPLICATION) // IconQuestion is a question mark icon. IconQuestion = loadIcon(w32.IDI_QUESTION) // IconWinLogo is usually the same as IconApplication but on older Windows // versions (like Windows 2000) this was a Windows icon. IconWinLogo = loadIcon(w32.IDI_WINLOGO) // IconShield is the icon that comes up when Windows asks admin permission. // It looks like a knight's shield. IconShield = loadIcon(w32.IDI_SHIELD) // IconWarning is an exclamation mark icon. IconWarning = loadIcon(w32.IDI_WARNING) // IconError is a red cross icon. IconError = loadIcon(w32.IDI_ERROR) // IconInformation is a blue 'i' for information. IconInformation = loadIcon(w32.IDI_INFORMATION) )
var DefaultDarkPalette = DarkPalette{ Background: RGB(32, 32, 32), Text: RGB(235, 235, 235), EditBack: RGB(45, 45, 45), }
DefaultDarkPalette is a neutral dark gray palette.
var DefaultTransparentColor = RGB(255, 0, 255)
DefaultTransparentColor is the key color used by SetTransparent when no color was chosen: magenta.
var NoExactFontMatch = errors.New("wui.NewFont: the desired font was not found in the system, a replacement is used")
Functions ¶
func ClipboardFiles ¶ added in v0.0.5
ClipboardFiles returns the paths of the files that were copied in the file explorer (Ctrl+C on files). ok is false if the clipboard holds no files.
func ClipboardImage ¶ added in v0.0.5
ClipboardImage returns the picture on the clipboard (24 and 32 bit bitmaps, as put there by screenshots and most programs). ok is false if there is none.
func ClipboardText ¶ added in v0.0.2
ClipboardText returns the text on the system clipboard. ok is false if the clipboard does not contain text.
func EnableDPIAwareness ¶ added in v0.0.5
func EnableDPIAwareness() bool
EnableDPIAwareness tells Windows that the program scales itself on high DPI monitors, so the window is no longer blurry-stretched. Call it once at the start of main, before the first window is created. It uses per monitor v2 awareness where available (Windows 10 1703+) and falls back to system DPI awareness. It returns false if nothing could be set, e.g. because the awareness was already fixed by a manifest.
With DPI awareness on, sizes you give are real pixels. Use Window.Scale to turn design sizes (made for 96 DPI) into pixels, and SetOnDPIChanged to react when the window moves to another monitor.
func Enabled ¶
func Enabled(c EnabledControl) bool
Enabled return true if the given control and all of its parents are enabled. This is different from the control's Enabled() function which only returns the enabled state of the control itself. If it is contained in a disabled parent, c.Enabled() will return true while Enabled(c) will return false.
func InputDialog ¶ added in v0.0.5
InputDialog asks the user for a line of text in a small modal window. parent is not used for placement (the dialog opens over the current top window); it is accepted so calls read naturally. ok is false if the user cancelled.
func MessageBox ¶
func MessageBox(caption, text string)
func MessageBoxCustom ¶
func MessageBoxError ¶
func MessageBoxError(caption, text string)
func MessageBoxFor ¶ added in v0.0.5
MessageBoxFor shows a message box that belongs to the given window, so it stays on top of it and blocks only it. flags are the MB_ values of MessageBoxCustom; the result is the ID of the pressed button.
func MessageBoxInfo ¶
func MessageBoxInfo(caption, text string)
func MessageBoxOKCancel ¶
func MessageBoxQuestion ¶
func MessageBoxQuestion(caption, text string)
func MessageBoxWarning ¶
func MessageBoxWarning(caption, text string)
func MessageBoxYesNo ¶
func OpenURL ¶ added in v0.0.5
func OpenURL(url string)
OpenURL opens a web address, file or folder with the program Windows has registered for it, e.g. the default browser.
func PasswordDialog ¶ added in v0.0.5
PasswordDialog is InputDialog with the typed text hidden.
func ScaleForDPI ¶ added in v0.0.5
ScaleForDPI converts a size designed for 96 DPI to pixels at the given DPI.
func SelectRadio ¶ added in v0.0.5
func SelectRadio(item *MenuString, group ...*MenuString)
SelectRadio checks item and unchecks all others of the group.
func SetClipboardImage ¶ added in v0.0.5
SetClipboardImage replaces the clipboard contents with the picture, as a 32 bit bitmap.
func SetClipboardText ¶ added in v0.0.2
SetClipboardText replaces the clipboard contents with the given text.
func SetControlTheme ¶ added in v0.0.5
SetControlTheme gives one control a visual style by name, e.g. DarkTheme or "Explorer". An empty name switches visual styles off for the control. It does nothing before the window is shown.
func SingleInstance ¶ added in v0.0.5
SingleInstance returns true for the first process that calls it with the given name and false for every later one. Use it at the start of main to stop a second copy of the program from starting. The name should be unique to your program, e.g. "com.example.myapp".
func Visible ¶
func Visible(c VisibleControl) bool
Visible return true if the given control and all of its parents are visible. This is different from the control's Visible() function which only returns the visibility of the control itself. If it is contained in an invisible parent, c.Visible() will return true while Visible(c) will return false.
Types ¶
type Anchor ¶
type Anchor int
Anchor defines how a child control is resized when its parent changes size. Children can be anchored to min (left or top), center and max (right or bottom) of their parents.
const ( // AnchorMin makes a control stick to the left/top side of its parent. The // control's size is not changed. AnchorMin Anchor = iota // AnchorMax makes a control stick to the right/bottom side of its parent. // The control's size is not changed. AnchorMax // AnchorCenter keeps a control fixed at the horizontal/vertical center of // its parent, e.g. if it is placed 10 pixels left of the center, it will // stay 10 pixels left of its parent's center. Its size is not changed. AnchorCenter // AnchorMinAndMax makes a control's borders stick to its parent's borders. // The size changes propertionally to its parent's size, keeping the // original distances to its parents borders. AnchorMinAndMax // AnchorMinAndCenter makes the left/top side of a control stick to its // parent's left/top side while the right/bottom side sticks to the parent's // center. AnchorMinAndCenter // AnchorMaxAndCenter makes the right/bottom side of a control stick to its // parent's right/bottom side while the left/top side sticks to the parent's // center. AnchorMaxAndCenter )
type BalloonKind ¶ added in v0.0.3
type BalloonKind int
BalloonKind selects the icon shown in a tray balloon notification.
const ( BalloonNone BalloonKind = iota BalloonInfo BalloonWarning BalloonError )
type BoxLayout ¶ added in v0.0.5
type BoxLayout struct {
Horizontal bool
// Spacing is the gap between two children, Padding the gap between the
// children and the edge of the container.
Spacing, Padding int
// contains filtered or unexported fields
}
BoxLayout puts the children in a row (NewHBox) or a column (NewVBox).
Along the row or column a child keeps its own size unless it has a weight: the space that is left over is shared between the weighted children in proportion to their weights. Across, every child is stretched to fill the available space unless SetKeepCrossSize is used for it.
func (*BoxLayout) SetKeepCrossSize ¶ added in v0.0.5
SetKeepCrossSize keeps the size of c across the layout direction (height in a row, width in a column) instead of stretching it.
type Button ¶
type Button struct {
// contains filtered or unexported fields
}
func (*Button) OnTabFocus ¶
func (b *Button) OnTabFocus() func()
func (*Button) SetDefault ¶ added in v0.0.5
SetDefault draws the button as the default button. To also make Enter click it, use Window.SetDefaultButton.
func (*Button) SetDropDownMenu ¶ added in v0.0.5
SetDropDownMenu sets the menu a ButtonSplit opens from its arrow.
func (*Button) SetImages ¶ added in v0.0.5
SetImages shows the first image of the list left of the text. (An image list with six images gives different pictures for the normal, hot, pressed, disabled, focused and stylus-hot states.)
func (*Button) SetKind ¶ added in v0.0.5
func (b *Button) SetKind(k ButtonKind)
SetKind changes the look of the button. Call it before the window is shown.
func (*Button) SetNote ¶ added in v0.0.5
SetNote sets the explanation under the title of a ButtonCommandLink.
func (*Button) SetOnClick ¶
func (b *Button) SetOnClick(f func())
func (*Button) SetOnDropDown ¶ added in v0.0.5
func (b *Button) SetOnDropDown(f func())
SetOnDropDown sets the function called when the arrow of a ButtonSplit is clicked. If a drop down menu is set it is shown afterwards.
func (*Button) SetOnTabFocus ¶
func (b *Button) SetOnTabFocus(f func())
type ButtonKind ¶ added in v0.0.5
type ButtonKind int
ButtonKind chooses the look and behavior of a Button.
const ( // ButtonNormal is the ordinary push button. ButtonNormal ButtonKind = iota // ButtonSplit has a small arrow next to the label that opens a menu, see // Button.SetDropDownMenu. ButtonSplit // ButtonCommandLink is the big flat button with a green arrow, a title // and an explanatory note (Button.SetNote) used in wizards. ButtonCommandLink )
type Canvas ¶
type Canvas struct {
// contains filtered or unexported fields
}
func (*Canvas) Bezier ¶ added in v0.0.2
Bezier draws connected cubic Bezier curves. The first point is the start point, every following group of three points is two control points and an end point, so len(p) must be 3n+1.
func (*Canvas) ClearDrawRegions ¶
func (c *Canvas) ClearDrawRegions()
func (*Canvas) Curve ¶ added in v0.0.2
Curve draws a smooth curve through all given points (Catmull-Rom spline).
func (*Canvas) DrawEllipse ¶
func (*Canvas) DrawFocusRect ¶ added in v0.0.2
DrawFocusRect draws a dotted focus rectangle.
func (*Canvas) DrawImageAlpha ¶ added in v0.0.2
DrawImageAlpha draws the src part of the image with an additional transparency, 0 is invisible and 255 is opaque.
func (*Canvas) DrawImageScaled ¶ added in v0.0.2
DrawImageScaled draws the src part of the image stretched into dest. A zero width or height in src means the full image, in dest it means the src size.
func (*Canvas) DrawPolygon ¶ added in v0.0.2
DrawPolygon draws only the outline of a polygon.
func (*Canvas) DrawRoundRect ¶ added in v0.0.2
DrawRoundRect draws the outline of a rectangle with rounded corners.
func (*Canvas) FillEllipse ¶
func (*Canvas) FillEllipseOutline ¶ added in v0.0.2
FillEllipseOutline fills an ellipse and draws its outline in a different color.
func (*Canvas) FillGradientH ¶ added in v0.0.2
FillGradientH fills a rectangle with a horizontal gradient from left to right.
func (*Canvas) FillGradientV ¶ added in v0.0.2
FillGradientV fills a rectangle with a vertical gradient from top to bottom.
func (*Canvas) FillPolygonOutline ¶ added in v0.0.2
FillPolygonOutline fills a polygon and draws its outline in a different color.
func (*Canvas) FillRectAlpha ¶ added in v0.0.2
FillRectAlpha fills a rectangle with a semi-transparent color. Alpha 0 is fully transparent, 255 is opaque.
func (*Canvas) FillRectOutline ¶ added in v0.0.2
FillRectOutline fills a rectangle and draws its outline in a different color.
func (*Canvas) FillRoundRect ¶ added in v0.0.2
FillRoundRect fills a rectangle with rounded corners.
func (*Canvas) FillRoundRectOutline ¶ added in v0.0.2
FillRoundRectOutline fills a rounded rectangle and draws its outline in a different color using the current stroke.
func (*Canvas) Pixel ¶ added in v0.0.2
Pixel returns the color of a single pixel (0xFFFFFFFF outside the canvas).
func (*Canvas) PopDrawRegion ¶
func (c *Canvas) PopDrawRegion()
func (*Canvas) PushDrawEllipse ¶ added in v0.0.2
PushDrawEllipse restricts drawing to an ellipse. Undo with PopDrawRegion.
func (*Canvas) PushDrawPolygon ¶ added in v0.0.2
PushDrawPolygon restricts drawing to a polygon. Undo with PopDrawRegion.
func (*Canvas) PushDrawRegion ¶
func (*Canvas) PushDrawRoundRect ¶ added in v0.0.2
PushDrawRoundRect restricts drawing to a rounded rectangle. Undo with PopDrawRegion.
func (*Canvas) Restore ¶ added in v0.0.2
func (c *Canvas) Restore()
Restore returns to the state of the last Save.
func (*Canvas) Save ¶ added in v0.0.2
func (c *Canvas) Save()
Save remembers the current stroke, font and clip region. Restore goes back to it. Calls can be nested.
func (*Canvas) SetLineStyle ¶ added in v0.0.2
SetLineStyle sets the dash pattern of outlines.
func (*Canvas) SetLineWidth ¶ added in v0.0.2
SetLineWidth sets the outline width in pixels.
func (*Canvas) SetStroke ¶ added in v0.0.2
SetStroke sets the pen used by all outline drawing functions (DrawRect, Line, DrawEllipse, Polyline, Arc, DrawPie, DrawPolygon, DrawRoundRect, Bezier, Curve and the *Outline functions).
func (*Canvas) TextExtent ¶
func (*Canvas) TextRectEllipsis ¶ added in v0.0.2
TextRectEllipsis draws a single line of text, vertically centered in the rectangle, ending with "..." if it does not fit.
func (*Canvas) TextRectExtent ¶
TextRectExtent returns the size of the text when drawn in a rectangle of the given width. The given width is necessary because text rects use word breaks and thus given a smaller width might produce a higher text height.
func (*Canvas) TextRectFormat ¶
type CheckBox ¶
type CheckBox struct {
// contains filtered or unexported fields
}
func NewCheckBox ¶
func NewCheckBox() *CheckBox
func (*CheckBox) Indeterminate ¶ added in v0.0.5
Indeterminate tells whether the check box is in the third state.
func (*CheckBox) OnTabFocus ¶
func (c *CheckBox) OnTabFocus() func()
func (*CheckBox) SetChecked ¶
func (*CheckBox) SetIndeterminate ¶ added in v0.0.5
SetIndeterminate puts a three state check box in or out of the third state.
func (*CheckBox) SetOnChange ¶
func (*CheckBox) SetOnTabFocus ¶
func (c *CheckBox) SetOnTabFocus(f func())
func (*CheckBox) SetPushLike ¶ added in v0.0.5
SetPushLike draws the check box as a button that stays pressed when checked, a toggle button.
func (*CheckBox) SetTextColor ¶ added in v0.0.3
SetTextColor changes the text color. Visual styles are switched off for this check box because themed check boxes ignore the text color.
func (*CheckBox) SetThreeState ¶ added in v0.0.5
SetThreeState lets the check box cycle through checked, unchecked and indeterminate (the "some of the children are checked" state).
func (*CheckBox) ThreeState ¶ added in v0.0.5
ThreeState tells whether the check box has the third state.
type Color ¶
type Color uint32
Color is a 24 bit color in BGR form. The alpha channel is always 0 and has no relevance.
func RGB ¶
RBG creates a new Color with the given intensities. r,g,b means red, green, blue. Value 0 is dark, 255 is full intensity.
type ColorDialog ¶ added in v0.0.2
type ColorDialog struct {
// contains filtered or unexported fields
}
ColorDialog is the system color chooser.
func NewColorDialog ¶ added in v0.0.2
func NewColorDialog() *ColorDialog
func (*ColorDialog) Color ¶ added in v0.0.2
func (d *ColorDialog) Color() Color
Color returns the color chosen in the last successful Execute.
func (*ColorDialog) Execute ¶ added in v0.0.2
func (d *ColorDialog) Execute(parent *Window) bool
Execute shows the dialog (parent may be nil) and returns true if the user confirmed a color, which is then available through Color.
func (*ColorDialog) SetColor ¶ added in v0.0.2
func (d *ColorDialog) SetColor(c Color)
SetColor sets the initially selected color.
type ColumnAlign ¶ added in v0.0.5
type ColumnAlign int
ColumnAlign is the text alignment of a ListView column.
const ( ColumnLeft ColumnAlign = iota ColumnRight ColumnCenter )
type ComboBox ¶
type ComboBox struct {
// contains filtered or unexported fields
}
func NewComboBox ¶
func NewComboBox() *ComboBox
func (*ComboBox) Editable ¶ added in v0.0.5
Editable tells whether the user can type in the combo box.
func (*ComboBox) OnTabFocus ¶
func (c *ComboBox) OnTabFocus() func()
func (*ComboBox) SelectedIndex ¶
func (*ComboBox) SetEditable ¶ added in v0.0.5
SetEditable lets the user type any text in the combo box instead of only choosing from the list. Read the text with Text(). Call it before the window is shown.
func (*ComboBox) SetOnChange ¶
func (*ComboBox) SetOnTabFocus ¶
func (c *ComboBox) SetOnTabFocus(f func())
func (*ComboBox) SetOnTextChange ¶ added in v0.0.5
func (e *ComboBox) SetOnTextChange(f func())
SetOnTextChange sets the function called when the user edits the text of an editable combo box.
func (*ComboBox) SetSelectedIndex ¶
SetSelectedIndex sets the current index. Set -1 to remove any selection and make the combo box empty. If you pass a value < -1 it will be set to -1 instead. The index is not clamped to the number of items, you may set the index 10 where only 5 items are set. This lets you set the index and items at design time without one invalidating the other. At runtime though, SelectedIndex() will return -1 if you set an invalid index.
type Control ¶
type Control interface {
Bounds() (x, y, width, height int)
SetBounds(x, y, width, height int)
Anchors() (horizontal, vertical Anchor)
SetHorizontalAnchor(a Anchor)
SetVerticalAnchor(a Anchor)
Parent() Container
Handle() uintptr
Visible() bool
Enabled() bool
// contains filtered or unexported methods
}
type Cursor ¶
type Cursor struct {
// contains filtered or unexported fields
}
Cursor describes the mouse cursor image. You can use a pre-defined Cursor... variable (see below) or create a custom cursor with NewCursorFromImage.
func NewCursorFromImage ¶
NewCursorFromImage creates a cursor with 4 possible colors: black, white, transparent and inverse screen color. Inverse screen color depends on what is under the cursor at any time. The cursor will be white minus the screen color to give maximum contrast for such pixels.
Fully opaque black and white pixels in the image are interpreted as black and white.
Fully transparent pixels in the image are interpreted as screen color.
All other pixels are interpreted as inverse screen color. This means even "almost" black/white/transparent, say with intensity 0xFFFE instead of 0xFFFF, will be interpreted as inverse screen color.
type DarkPalette ¶ added in v0.0.5
type DarkPalette struct {
Background Color // window and panels
Text Color
EditBack Color // edit boxes
}
DarkPalette are the colors ApplyDarkMode uses.
type DatePicker ¶ added in v0.0.2
type DatePicker struct {
// contains filtered or unexported fields
}
DatePicker is a date (or time) chooser with a drop-down calendar.
func NewDatePicker ¶ added in v0.0.2
func NewDatePicker() *DatePicker
func (*DatePicker) Anchors ¶ added in v0.0.2
func (c *DatePicker) Anchors() (horizontal, vertical Anchor)
func (*DatePicker) BackgroundColor ¶ added in v0.0.3
func (c *DatePicker) BackgroundColor() Color
BackgroundColor returns the color set with SetBackgroundColor. If no color was set it returns the system button face color.
func (*DatePicker) ContextMenu ¶ added in v0.0.2
func (c *DatePicker) ContextMenu() *PopupMenu
func (*DatePicker) Focus ¶ added in v0.0.5
func (c *DatePicker) Focus()
Focus gives the control the keyboard focus. It does nothing before the window is shown.
func (*DatePicker) HasBackgroundColor ¶ added in v0.0.3
func (c *DatePicker) HasBackgroundColor() bool
HasBackgroundColor returns true if SetBackgroundColor was called.
func (*DatePicker) HasFocus ¶ added in v0.0.5
func (c *DatePicker) HasFocus() bool
HasFocus tells whether the control has the keyboard focus.
func (*DatePicker) HasTextColor ¶ added in v0.0.3
func (c *DatePicker) HasTextColor() bool
HasTextColor returns true if SetTextColor was called.
func (*DatePicker) HorizontalAnchor ¶ added in v0.0.2
func (c *DatePicker) HorizontalAnchor() Anchor
func (*DatePicker) Mode ¶ added in v0.0.2
func (d *DatePicker) Mode() DatePickerMode
func (*DatePicker) OnChange ¶ added in v0.0.2
func (d *DatePicker) OnChange() func(time.Time)
func (*DatePicker) OnDropFiles ¶ added in v0.0.3
func (c *DatePicker) OnDropFiles() DropFilesFunc
OnDropFiles returns the handler set with SetOnDropFiles.
func (*DatePicker) ResetBackgroundColor ¶ added in v0.0.3
func (c *DatePicker) ResetBackgroundColor()
ResetBackgroundColor goes back to the default background.
func (*DatePicker) ResetTextColor ¶ added in v0.0.3
func (c *DatePicker) ResetTextColor()
ResetTextColor goes back to the system text color.
func (*DatePicker) SetAnchors ¶ added in v0.0.2
func (c *DatePicker) SetAnchors(horizontal, vertical Anchor)
func (*DatePicker) SetBackgroundColor ¶ added in v0.0.3
func (c *DatePicker) SetBackgroundColor(col Color)
SetBackgroundColor changes the color behind the control's text (or the fill color of a Panel).
func (*DatePicker) SetBounds ¶ added in v0.0.2
func (c *DatePicker) SetBounds(x, y, width, height int)
func (*DatePicker) SetContextMenu ¶ added in v0.0.2
func (c *DatePicker) SetContextMenu(m *PopupMenu)
SetContextMenu sets the menu that opens when the user right-clicks the control. Not all native controls (e.g. edit boxes) forward right clicks.
func (*DatePicker) SetCursor ¶ added in v0.0.5
func (c *DatePicker) SetCursor(cur *Cursor)
SetCursor sets the mouse cursor shown over the control, nil goes back to the default. Labels, panels and paint boxes pass mouse input through to their parent, setting a cursor or a mouse handler makes them keep it.
func (*DatePicker) SetEnabled ¶ added in v0.0.2
func (c *DatePicker) SetEnabled(e bool)
func (*DatePicker) SetHorizontalAnchor ¶ added in v0.0.2
func (c *DatePicker) SetHorizontalAnchor(a Anchor)
func (*DatePicker) SetMode ¶ added in v0.0.2
func (d *DatePicker) SetMode(m DatePickerMode)
SetMode must be called before the window is shown.
func (*DatePicker) SetOnBlur ¶ added in v0.0.5
func (c *DatePicker) SetOnBlur(f func())
SetOnBlur sets the function called when the control loses the keyboard focus.
func (*DatePicker) SetOnChange ¶ added in v0.0.2
func (d *DatePicker) SetOnChange(f func(time.Time))
func (*DatePicker) SetOnChar ¶ added in v0.0.5
func (c *DatePicker) SetOnChar(f func(r rune))
SetOnChar sets the function called for typed characters.
func (*DatePicker) SetOnDoubleClick ¶ added in v0.0.5
func (c *DatePicker) SetOnDoubleClick(f func(x, y int, button MouseButton))
SetOnDoubleClick sets the function called on a mouse double click.
func (*DatePicker) SetOnDropFiles ¶ added in v0.0.3
func (c *DatePicker) SetOnDropFiles(f DropFilesFunc)
SetOnDropFiles makes the control a drop target for files dragged from the file explorer.
func (*DatePicker) SetOnFocus ¶ added in v0.0.5
func (c *DatePicker) SetOnFocus(f func())
SetOnFocus sets the function called when the control gets the keyboard focus.
func (*DatePicker) SetOnKeyDown ¶ added in v0.0.5
func (c *DatePicker) SetOnKeyDown(f func(key int))
SetOnKeyDown sets the function called when a key goes down while the control has the focus. The key is a virtual key code, see the Key... values.
func (*DatePicker) SetOnKeyUp ¶ added in v0.0.5
func (c *DatePicker) SetOnKeyUp(f func(key int))
SetOnKeyUp sets the function called when a key is released.
func (*DatePicker) SetOnMouseDown ¶ added in v0.0.5
func (c *DatePicker) SetOnMouseDown(f func(x, y int, button MouseButton))
SetOnMouseDown sets the function called when a mouse button goes down over the control. x and y are relative to the control.
func (*DatePicker) SetOnMouseEnter ¶ added in v0.0.5
func (c *DatePicker) SetOnMouseEnter(f func())
SetOnMouseEnter sets the function called when the mouse enters the control.
func (*DatePicker) SetOnMouseLeave ¶ added in v0.0.5
func (c *DatePicker) SetOnMouseLeave(f func())
SetOnMouseLeave sets the function called when the mouse leaves the control.
func (*DatePicker) SetOnMouseMove ¶ added in v0.0.5
func (c *DatePicker) SetOnMouseMove(f func(x, y int))
SetOnMouseMove sets the function called when the mouse moves over the control.
func (*DatePicker) SetOnMouseUp ¶ added in v0.0.5
func (c *DatePicker) SetOnMouseUp(f func(x, y int, button MouseButton))
SetOnMouseUp sets the function called when a mouse button is released.
func (*DatePicker) SetOnMouseWheel ¶ added in v0.0.5
SetOnMouseWheel sets the function called when the wheel turns while the control has the focus. A delta of 1 is one notch away from the user.
func (*DatePicker) SetOnResize ¶ added in v0.0.2
func (c *DatePicker) SetOnResize(f func())
func (*DatePicker) SetPosition ¶ added in v0.0.2
func (c *DatePicker) SetPosition(x, y int)
func (*DatePicker) SetTabStop ¶ added in v0.0.5
func (c *DatePicker) SetTabStop(on bool)
SetTabStop chooses whether the Tab key stops at this control. The default depends on the control type.
func (*DatePicker) SetTextColor ¶ added in v0.0.3
func (c *DatePicker) SetTextColor(col Color)
SetTextColor changes the color of the control's text.
func (*DatePicker) SetToolTip ¶ added in v0.0.2
func (c *DatePicker) SetToolTip(text string)
SetToolTip sets the hint text shown when the mouse rests over the control. An empty text removes the tool tip. It works for every control.
func (*DatePicker) SetValue ¶ added in v0.0.2
func (d *DatePicker) SetValue(t time.Time)
func (*DatePicker) SetVerticalAnchor ¶ added in v0.0.2
func (c *DatePicker) SetVerticalAnchor(a Anchor)
func (*DatePicker) SetVisible ¶ added in v0.0.2
func (c *DatePicker) SetVisible(v bool)
func (*DatePicker) TabStop ¶ added in v0.0.5
func (c *DatePicker) TabStop() bool
TabStop tells whether the Tab key stops at this control.
func (*DatePicker) TextColor ¶ added in v0.0.3
func (c *DatePicker) TextColor() Color
TextColor returns the color set with SetTextColor. If no color was set it returns the system window text color.
func (*DatePicker) ToolTip ¶ added in v0.0.2
func (c *DatePicker) ToolTip() string
ToolTip returns the hint text of the control.
func (*DatePicker) Value ¶ added in v0.0.2
func (d *DatePicker) Value() time.Time
Value returns the selected date and time (in the local time zone).
func (*DatePicker) VerticalAnchor ¶ added in v0.0.2
func (c *DatePicker) VerticalAnchor() Anchor
type DatePickerMode ¶ added in v0.0.2
type DatePickerMode int
DatePickerMode selects what a DatePicker shows.
const ( DatePickerShortDate DatePickerMode = iota DatePickerLongDate DatePickerTime )
func (DatePickerMode) String ¶ added in v0.0.3
func (m DatePickerMode) String() string
type DialogResult ¶ added in v0.0.5
type DialogResult int
DialogResult is the button the user chose in a dialog.
const ( DialogCancel DialogResult = iota DialogYes DialogNo DialogOK DialogRetry DialogClose )
func MessageBoxRetryCancel ¶ added in v0.0.5
func MessageBoxRetryCancel(caption, text string) DialogResult
MessageBoxRetryCancel reports a failure the user may retry.
func MessageBoxYesNoCancel ¶ added in v0.0.5
func MessageBoxYesNoCancel(caption, text string) DialogResult
MessageBoxYesNoCancel asks a question with three answers.
func TaskDialog ¶ added in v0.0.5
func TaskDialog(parent *Window, title, instruction, content string, buttons TaskButtons, icon TaskIcon) DialogResult
TaskDialog shows the modern message box with a big blue main instruction and a smaller explanation below it. On systems or setups where it is not available it falls back to a classic message box.
type DockLayout ¶ added in v0.0.5
type DockLayout struct {
Spacing, Padding int
// contains filtered or unexported fields
}
DockLayout docks children to the sides of the container in the order they were added, like the Dock property of other GUI toolkits: a child docked to the top keeps its height and gets the full width of the space that is left, and so on. Add the DockFill child last.
func NewDockLayout ¶ added in v0.0.5
func NewDockLayout(spacing, padding int) *DockLayout
NewDockLayout returns an empty dock layout.
func (*DockLayout) Arrange ¶ added in v0.0.5
func (l *DockLayout) Arrange(children []Control, x, y, width, height int)
Arrange implements Layout.
func (*DockLayout) Set ¶ added in v0.0.5
func (l *DockLayout) Set(c Control, d DockStyle) *DockLayout
Set chooses how c is docked.
type DockStyle ¶ added in v0.0.5
type DockStyle int
DockStyle says to which side of the free space a child is docked.
type DropFilesFunc ¶ added in v0.0.3
DropFilesFunc is called when the user drops files from the file explorer onto a window or control. x and y are relative to the top left corner of the window's (or control's) client area.
type EditAlign ¶ added in v0.0.5
type EditAlign int
EditAlign is the horizontal text alignment of an edit control.
type EditLine ¶
type EditLine struct {
// contains filtered or unexported fields
}
func NewEditLine ¶
func NewEditLine() *EditLine
func (*EditLine) AppendText ¶ added in v0.0.5
func (c *EditLine) AppendText(text string)
AppendText adds text at the end and scrolls it into view. It is much faster than SetText(Text()+...) for logs.
func (*EditLine) CanUndo ¶ added in v0.0.5
func (c *EditLine) CanUndo() bool
CanUndo tells whether Undo has something to revert.
func (*EditLine) CharacterLimit ¶
func (*EditLine) Copy ¶ added in v0.0.5
func (c *EditLine) Copy()
Copy copies the selected text to the clipboard.
func (*EditLine) CursorLine ¶ added in v0.0.5
func (c *EditLine) CursorLine() int
CursorLine returns the zero based line the cursor is on.
func (*EditLine) CursorPosition ¶
func (c *EditLine) CursorPosition() (start, end int)
CursorPosition returns the current cursor position, respectively the current selection.
If no selection is active, the returned start and end values are the same. They then indicate the index of the UTF-8 character in this EditLine's Text() before which the caret is currently set.
If a selection is active, start is the index of the first selected UTF-8 character in Text() and end is the position one character after the end of the selection. The selected text is thus
c.Text()[start:end]
func (*EditLine) Cut ¶ added in v0.0.5
func (c *EditLine) Cut()
Cut moves the selected text to the clipboard.
func (*EditLine) DeleteSelection ¶ added in v0.0.5
func (c *EditLine) DeleteSelection()
DeleteSelection deletes the selected text without using the clipboard.
func (*EditLine) IsPassword ¶
func (*EditLine) LineCount ¶ added in v0.0.5
func (c *EditLine) LineCount() int
LineCount returns the number of lines of a multi line edit.
func (*EditLine) OnTabFocus ¶
func (e *EditLine) OnTabFocus() func()
func (*EditLine) OnTextChange ¶
func (e *EditLine) OnTextChange() func()
func (*EditLine) Paste ¶ added in v0.0.5
func (c *EditLine) Paste()
Paste inserts the clipboard text at the cursor.
func (*EditLine) ReplaceSelection ¶ added in v0.0.5
func (c *EditLine) ReplaceSelection(text string)
ReplaceSelection replaces the selected text, or inserts at the cursor if nothing is selected. The change can be undone.
func (*EditLine) ScrollToCaret ¶ added in v0.0.5
func (c *EditLine) ScrollToCaret()
ScrollToCaret scrolls so that the cursor is visible.
func (*EditLine) SelectedText ¶ added in v0.0.5
func (c *EditLine) SelectedText() string
SelectedText returns the selected text, empty if nothing is selected.
func (*EditLine) SetCharacterLimit ¶
func (*EditLine) SetCueBanner ¶ added in v0.0.5
SetCueBanner sets the grayed hint text shown while an edit is empty, the "placeholder". If showWhenFocused is true it stays visible until the user types. It works for single line edits (EditLine) only.
func (*EditLine) SetCursorPosition ¶
func (c *EditLine) SetCursorPosition(pos int)
func (*EditLine) SetIsPassword ¶
func (*EditLine) SetNumbersOnly ¶ added in v0.0.5
func (c *EditLine) SetNumbersOnly(on bool)
SetNumbersOnly allows only the digits 0 to 9 to be typed. Pasting is not restricted by Windows.
func (*EditLine) SetOnTabFocus ¶
func (e *EditLine) SetOnTabFocus(f func())
func (*EditLine) SetOnTextChange ¶
func (e *EditLine) SetOnTextChange(f func())
func (*EditLine) SetReadOnly ¶
func (*EditLine) SetSelection ¶
func (c *EditLine) SetSelection(start, end int)
func (*EditLine) SetTextAlign ¶ added in v0.0.5
func (c *EditLine) SetTextAlign(a EditAlign)
SetTextAlign aligns the text left, centered or right.
type EnabledControl ¶
type FileOpenDialog ¶
type FileOpenDialog struct {
// contains filtered or unexported fields
}
func NewFileOpenDialog ¶
func NewFileOpenDialog() *FileOpenDialog
func (*FileOpenDialog) AddFilter ¶
func (dlg *FileOpenDialog) AddFilter(text, ext1 string, exts ...string)
func (*FileOpenDialog) ExecuteMultiSelection ¶
func (dlg *FileOpenDialog) ExecuteMultiSelection(parent *Window) (bool, []string)
func (*FileOpenDialog) ExecuteSingleSelection ¶
func (dlg *FileOpenDialog) ExecuteSingleSelection(parent *Window) (bool, string)
func (*FileOpenDialog) SetFilterIndex ¶
func (dlg *FileOpenDialog) SetFilterIndex(i int)
SetFilterIndex sets the active filter, 0-indexed.
func (*FileOpenDialog) SetInitialPath ¶
func (dlg *FileOpenDialog) SetInitialPath(path string)
func (*FileOpenDialog) SetTitle ¶
func (dlg *FileOpenDialog) SetTitle(title string)
type FileSaveDialog ¶
type FileSaveDialog struct {
// contains filtered or unexported fields
}
func NewFileSaveDialog ¶
func NewFileSaveDialog() *FileSaveDialog
func (*FileSaveDialog) AddFilter ¶
func (dlg *FileSaveDialog) AddFilter(text, ext1 string, exts ...string)
func (*FileSaveDialog) SetAppendExt ¶
func (dlg *FileSaveDialog) SetAppendExt(ext bool)
func (*FileSaveDialog) SetFilterIndex ¶
func (dlg *FileSaveDialog) SetFilterIndex(i int)
SetFilterIndex sets the active filter, 0-indexed.
func (*FileSaveDialog) SetInitialPath ¶
func (dlg *FileSaveDialog) SetInitialPath(path string)
func (*FileSaveDialog) SetTitle ¶
func (dlg *FileSaveDialog) SetTitle(title string)
type FloatUpDown ¶
type FloatUpDown struct {
// contains filtered or unexported fields
}
func NewFloatUpDown ¶
func NewFloatUpDown() *FloatUpDown
func (*FloatUpDown) AppendText ¶ added in v0.0.5
func (c *FloatUpDown) AppendText(text string)
AppendText adds text at the end and scrolls it into view. It is much faster than SetText(Text()+...) for logs.
func (*FloatUpDown) CanUndo ¶ added in v0.0.5
func (c *FloatUpDown) CanUndo() bool
CanUndo tells whether Undo has something to revert.
func (*FloatUpDown) Copy ¶ added in v0.0.5
func (c *FloatUpDown) Copy()
Copy copies the selected text to the clipboard.
func (*FloatUpDown) CursorLine ¶ added in v0.0.5
func (c *FloatUpDown) CursorLine() int
CursorLine returns the zero based line the cursor is on.
func (*FloatUpDown) CursorPosition ¶
func (c *FloatUpDown) CursorPosition() (start, end int)
CursorPosition returns the current cursor position, respectively the current selection.
If no selection is active, the returned start and end values are the same. They then indicate the index of the UTF-8 character in this EditLine's Text() before which the caret is currently set.
If a selection is active, start is the index of the first selected UTF-8 character in Text() and end is the position one character after the end of the selection. The selected text is thus
c.Text()[start:end]
func (*FloatUpDown) Cut ¶ added in v0.0.5
func (c *FloatUpDown) Cut()
Cut moves the selected text to the clipboard.
func (*FloatUpDown) DeleteSelection ¶ added in v0.0.5
func (c *FloatUpDown) DeleteSelection()
DeleteSelection deletes the selected text without using the clipboard.
func (*FloatUpDown) LineCount ¶ added in v0.0.5
func (c *FloatUpDown) LineCount() int
LineCount returns the number of lines of a multi line edit.
func (*FloatUpDown) Max ¶
func (n *FloatUpDown) Max() float64
func (*FloatUpDown) Min ¶
func (n *FloatUpDown) Min() float64
func (*FloatUpDown) MinMax ¶
func (n *FloatUpDown) MinMax() (min, max float64)
func (*FloatUpDown) OnTabFocus ¶
func (n *FloatUpDown) OnTabFocus() func()
func (*FloatUpDown) OnValueChange ¶
func (n *FloatUpDown) OnValueChange() func(value float64)
func (*FloatUpDown) Paste ¶ added in v0.0.5
func (c *FloatUpDown) Paste()
Paste inserts the clipboard text at the cursor.
func (*FloatUpDown) Precision ¶
func (n *FloatUpDown) Precision() int
func (*FloatUpDown) ReplaceSelection ¶ added in v0.0.5
func (c *FloatUpDown) ReplaceSelection(text string)
ReplaceSelection replaces the selected text, or inserts at the cursor if nothing is selected. The change can be undone.
func (*FloatUpDown) ScrollToCaret ¶ added in v0.0.5
func (c *FloatUpDown) ScrollToCaret()
ScrollToCaret scrolls so that the cursor is visible.
func (*FloatUpDown) SelectedText ¶ added in v0.0.5
func (c *FloatUpDown) SelectedText() string
SelectedText returns the selected text, empty if nothing is selected.
func (*FloatUpDown) SetBounds ¶
func (n *FloatUpDown) SetBounds(x, y, width, height int)
func (*FloatUpDown) SetCueBanner ¶ added in v0.0.5
SetCueBanner sets the grayed hint text shown while an edit is empty, the "placeholder". If showWhenFocused is true it stays visible until the user types. It works for single line edits (EditLine) only.
func (*FloatUpDown) SetCursorPosition ¶
func (c *FloatUpDown) SetCursorPosition(pos int)
func (*FloatUpDown) SetHeight ¶
func (n *FloatUpDown) SetHeight(height int)
func (*FloatUpDown) SetMax ¶
func (n *FloatUpDown) SetMax(max float64)
func (*FloatUpDown) SetMin ¶
func (n *FloatUpDown) SetMin(min float64)
func (*FloatUpDown) SetMinMax ¶
func (n *FloatUpDown) SetMinMax(min, max float64)
func (*FloatUpDown) SetNumbersOnly ¶ added in v0.0.5
func (c *FloatUpDown) SetNumbersOnly(on bool)
SetNumbersOnly allows only the digits 0 to 9 to be typed. Pasting is not restricted by Windows.
func (*FloatUpDown) SetOnTabFocus ¶
func (n *FloatUpDown) SetOnTabFocus(f func())
func (*FloatUpDown) SetOnValueChange ¶
func (n *FloatUpDown) SetOnValueChange(f func(value float64))
func (*FloatUpDown) SetPos ¶
func (n *FloatUpDown) SetPos(x, y int)
func (*FloatUpDown) SetPrecision ¶
func (n *FloatUpDown) SetPrecision(p int)
func (*FloatUpDown) SetSelection ¶
func (c *FloatUpDown) SetSelection(start, end int)
func (*FloatUpDown) SetSize ¶
func (n *FloatUpDown) SetSize(width, height int)
func (*FloatUpDown) SetTextAlign ¶ added in v0.0.5
func (c *FloatUpDown) SetTextAlign(a EditAlign)
SetTextAlign aligns the text left, centered or right.
func (*FloatUpDown) SetValue ¶
func (n *FloatUpDown) SetValue(f float64)
SetValue does not accept NaN (not a number). It does accept infinity, the user can type "+inf" or "-inf".
func (*FloatUpDown) SetWidth ¶
func (n *FloatUpDown) SetWidth(width int)
func (*FloatUpDown) SetX ¶
func (n *FloatUpDown) SetX(x int)
func (*FloatUpDown) SetY ¶
func (n *FloatUpDown) SetY(y int)
func (*FloatUpDown) Undo ¶ added in v0.0.5
func (c *FloatUpDown) Undo() bool
Undo reverts the last change and returns false if there was nothing to undo.
func (*FloatUpDown) Value ¶
func (n *FloatUpDown) Value() float64
type FolderSelectDialog ¶
type FolderSelectDialog struct {
// contains filtered or unexported fields
}
func NewFolderSelectDialog ¶
func NewFolderSelectDialog() *FolderSelectDialog
func (*FolderSelectDialog) Execute ¶
func (dlg *FolderSelectDialog) Execute(parent *Window) (bool, string)
func (*FolderSelectDialog) SetTitle ¶
func (dlg *FolderSelectDialog) SetTitle(title string)
type Font ¶
type Font struct {
Desc FontDesc
// contains filtered or unexported fields
}
type FontDialog ¶ added in v0.0.5
type FontDialog struct {
// contains filtered or unexported fields
}
FontDialog is the standard dialog for choosing a font.
func NewFontDialog ¶ added in v0.0.5
func NewFontDialog() *FontDialog
NewFontDialog creates a font dialog that starts with Segoe UI 9 pt.
func (*FontDialog) Color ¶ added in v0.0.5
func (d *FontDialog) Color() Color
Color returns the chosen text color.
func (*FontDialog) Execute ¶ added in v0.0.5
func (d *FontDialog) Execute(parent *Window) bool
Execute shows the dialog (parent may be nil) and returns true if the user pressed OK.
func (*FontDialog) Font ¶ added in v0.0.5
func (d *FontDialog) Font() FontDesc
Font returns the chosen font, ready for NewFont.
func (*FontDialog) Points ¶ added in v0.0.5
func (d *FontDialog) Points() int
Points returns the chosen size in points.
func (*FontDialog) SetColor ¶ added in v0.0.5
func (d *FontDialog) SetColor(c Color)
SetColor sets the text color the dialog starts with.
func (*FontDialog) SetFont ¶ added in v0.0.5
func (d *FontDialog) SetFont(f FontDesc)
SetFont sets the font the dialog starts with. Height is in pixels, negative for the character height as in FontDesc.
type GridLayout ¶ added in v0.0.5
type GridLayout struct {
Columns int
Spacing, Padding int
// contains filtered or unexported fields
}
GridLayout puts the children into the cells of a grid, row by row. The number of columns is fixed, rows are added as needed. Columns and rows are equally sized unless weights are set.
func NewGridLayout ¶ added in v0.0.5
func NewGridLayout(columns, spacing, padding int) *GridLayout
NewGridLayout returns a grid with the given number of columns.
func (*GridLayout) Arrange ¶ added in v0.0.5
func (l *GridLayout) Arrange(children []Control, x, y, width, height int)
Arrange implements Layout.
func (*GridLayout) SetColumnWeights ¶ added in v0.0.5
func (l *GridLayout) SetColumnWeights(w ...float64) *GridLayout
SetColumnWeights sets the relative widths of the columns. Missing entries count as 1.
func (*GridLayout) SetRowWeights ¶ added in v0.0.5
func (l *GridLayout) SetRowWeights(w ...float64) *GridLayout
SetRowWeights sets the relative heights of the rows. Missing entries count as 1.
func (*GridLayout) SetSpan ¶ added in v0.0.5
func (l *GridLayout) SetSpan(c Control, columns, rows int) *GridLayout
SetSpan lets c cover several columns and rows.
type GroupBox ¶ added in v0.0.2
type GroupBox struct {
// contains filtered or unexported fields
}
func NewGroupBox ¶ added in v0.0.2
func NewGroupBox() *GroupBox
NewGroupBox creates a framed box with a caption. A GroupBox is a visual grouping only: place other controls on top of it (add the GroupBox to its parent first, then the controls that should appear inside it).
func (*GroupBox) SetTextColor ¶ added in v0.0.3
SetTextColor changes the caption color. Visual styles are switched off for this group box because themed group boxes ignore the text color.
type HotKeyEdit ¶ added in v0.0.5
type HotKeyEdit struct {
// contains filtered or unexported fields
}
HotKeyEdit is a box in which the user presses a key combination, like Ctrl+Shift+K, and sees it written out. Use it for configurable shortcuts. The result can be given to Window.RegisterHotKey.
func NewHotKeyEdit ¶ added in v0.0.5
func NewHotKeyEdit() *HotKeyEdit
NewHotKeyEdit creates an empty hot key box.
func (*HotKeyEdit) HotKey ¶ added in v0.0.5
func (h *HotKeyEdit) HotKey() (key int, mods HotKeyMod)
HotKey returns the key combination the user entered. key is 0 if nothing was entered.
func (*HotKeyEdit) OnTabFocus ¶ added in v0.0.5
func (h *HotKeyEdit) OnTabFocus() func()
func (*HotKeyEdit) SetHotKey ¶ added in v0.0.5
func (h *HotKeyEdit) SetHotKey(key int, mods HotKeyMod)
SetHotKey shows a key combination: key is a virtual key code, e.g. 'K' or 0x70 for F1, mods the modifiers.
func (*HotKeyEdit) SetOnChange ¶ added in v0.0.5
func (h *HotKeyEdit) SetOnChange(f func())
SetOnChange sets the function called when the combination changes.
func (*HotKeyEdit) SetOnTabFocus ¶ added in v0.0.5
func (h *HotKeyEdit) SetOnTabFocus(f func())
type HotKeyMod ¶ added in v0.0.5
type HotKeyMod uint
HotKeyMod are the modifier keys of a global hot key.
type IPAddressEdit ¶ added in v0.0.5
type IPAddressEdit struct {
// contains filtered or unexported fields
}
IPAddressEdit is the box for entering an IPv4 address with four fields.
func NewIPAddressEdit ¶ added in v0.0.5
func NewIPAddressEdit() *IPAddressEdit
NewIPAddressEdit creates an empty IP address box.
func (*IPAddressEdit) Address ¶ added in v0.0.5
func (e *IPAddressEdit) Address() (string, bool)
Address returns the entered address as text and false if some field is still empty.
func (*IPAddressEdit) OnTabFocus ¶ added in v0.0.5
func (e *IPAddressEdit) OnTabFocus() func()
func (*IPAddressEdit) SetAddress ¶ added in v0.0.5
func (e *IPAddressEdit) SetAddress(s string) error
SetAddress shows an address like "192.168.0.1". An empty string clears the box.
func (*IPAddressEdit) SetOnChange ¶ added in v0.0.5
func (e *IPAddressEdit) SetOnChange(f func())
SetOnChange sets the function called when any field changes.
func (*IPAddressEdit) SetOnTabFocus ¶ added in v0.0.5
func (e *IPAddressEdit) SetOnTabFocus(f func())
type Icon ¶
type Icon struct {
// contains filtered or unexported fields
}
Icon holds a window icon. You can use a pre-defined Icon... variable (see below) or create a custom icon with NewIconFromImage, NewIconFromExeResource, NewIconFromFile or NewIconFromReader.
func NewIconFromExeResource ¶
NewIconFromExeResource loads an icon that was compiled into the executable. In Go you can create .syso files that contain resources. Each resource will get a unique ID. See for example the rsrc tool which can create .syso files: https://github.com/gonutz/rsrc
func NewIconFromFile ¶
NewIconFromFile loads an icon from disk. The format must be .ico, not an image.
func NewIconFromImage ¶
IconInformation creates an icon from an image. The image should have a standard icon size, typically square and a power of 2, see https://docs.microsoft.com/en-us/windows/win32/uxguide/vis-icons
type Image ¶
type Image struct {
// contains filtered or unexported fields
}
func NewImageFromHBITMAP ¶
NewImageFromHBITMAP takes a handle to a bitmap (HBITMAP) and makes it an Image that you can use in Canvas.DrawImage.
type ImageList ¶ added in v0.0.5
type ImageList struct {
// contains filtered or unexported fields
}
ImageList is a collection of equally sized images that controls (ListView, TreeView, TabControl, NativeToolBar) use for their icons. Create one, add images, and give it to a control with its SetImages or SetSmallImages method. An image is referred to by the index AddImage and AddIcon returned.
func NewImageList ¶ added in v0.0.5
NewImageList creates an empty list for images of the given size in pixels. Use 16x16 for small icons and 32x32 for large ones.
func (*ImageList) AddIcon ¶ added in v0.0.5
AddIcon appends an icon and returns its index, or -1 on failure. The icon is copied into the list.
func (*ImageList) AddImage ¶ added in v0.0.5
AddImage appends a Go image, scaled to the size of the list if it has a different size, and returns its index. Transparency is kept.
func (*ImageList) Destroy ¶ added in v0.0.5
func (l *ImageList) Destroy()
Destroy frees the list. Do not use it, or controls showing it, afterwards.
type ImageMode ¶ added in v0.0.5
type ImageMode int
ImageMode says how an ImageView fits its image into the available space.
const ( // ImageNormal draws the image in its original size at the top left. ImageNormal ImageMode = iota // ImageCenter draws the image in its original size in the middle. ImageCenter // ImageStretch stretches the image to fill the view, ignoring the aspect // ratio. ImageStretch // ImageFit scales the image to the largest size that fits completely, // keeping the aspect ratio. ImageFit // ImageFill scales the image to cover the whole view, keeping the aspect // ratio and cutting what does not fit. ImageFill )
type ImageView ¶ added in v0.0.5
type ImageView struct {
*PaintBox
// contains filtered or unexported fields
}
ImageView shows a picture (PNG, JPEG, GIF or any Go image.Image).
func NewImageView ¶ added in v0.0.5
func NewImageView() *ImageView
NewImageView creates an empty image view.
func (ImageView) Anchors ¶ added in v0.0.5
func (c ImageView) Anchors() (horizontal, vertical Anchor)
func (ImageView) BackgroundColor ¶ added in v0.0.5
func (c ImageView) BackgroundColor() Color
BackgroundColor returns the color set with SetBackgroundColor. If no color was set it returns the system button face color.
func (ImageView) ContextMenu ¶ added in v0.0.5
func (c ImageView) ContextMenu() *PopupMenu
func (ImageView) Focus ¶ added in v0.0.5
func (c ImageView) Focus()
Focus gives the control the keyboard focus. It does nothing before the window is shown.
func (ImageView) HasBackgroundColor ¶ added in v0.0.5
func (c ImageView) HasBackgroundColor() bool
HasBackgroundColor returns true if SetBackgroundColor was called.
func (ImageView) HasFocus ¶ added in v0.0.5
func (c ImageView) HasFocus() bool
HasFocus tells whether the control has the keyboard focus.
func (ImageView) HasTextColor ¶ added in v0.0.5
func (c ImageView) HasTextColor() bool
HasTextColor returns true if SetTextColor was called.
func (ImageView) HorizontalAnchor ¶ added in v0.0.5
func (c ImageView) HorizontalAnchor() Anchor
func (ImageView) OnDropFiles ¶ added in v0.0.5
func (c ImageView) OnDropFiles() DropFilesFunc
OnDropFiles returns the handler set with SetOnDropFiles.
func (ImageView) ResetBackgroundColor ¶ added in v0.0.5
func (c ImageView) ResetBackgroundColor()
ResetBackgroundColor goes back to the default background.
func (ImageView) ResetTextColor ¶ added in v0.0.5
func (c ImageView) ResetTextColor()
ResetTextColor goes back to the system text color.
func (ImageView) SetAnchors ¶ added in v0.0.5
func (c ImageView) SetAnchors(horizontal, vertical Anchor)
func (*ImageView) SetBackColor ¶ added in v0.0.5
SetBackColor sets the color behind (and around) the image. Without it the view is filled with the standard control background.
func (ImageView) SetBackgroundColor ¶ added in v0.0.5
func (c ImageView) SetBackgroundColor(col Color)
SetBackgroundColor changes the color behind the control's text (or the fill color of a Panel).
func (ImageView) SetContextMenu ¶ added in v0.0.5
func (c ImageView) SetContextMenu(m *PopupMenu)
SetContextMenu sets the menu that opens when the user right-clicks the control. Not all native controls (e.g. edit boxes) forward right clicks.
func (ImageView) SetCursor ¶ added in v0.0.5
func (c ImageView) SetCursor(cur *Cursor)
SetCursor sets the mouse cursor shown over the control, nil goes back to the default. Labels, panels and paint boxes pass mouse input through to their parent, setting a cursor or a mouse handler makes them keep it.
func (ImageView) SetEnabled ¶ added in v0.0.5
func (c ImageView) SetEnabled(e bool)
func (ImageView) SetHorizontalAnchor ¶ added in v0.0.5
func (c ImageView) SetHorizontalAnchor(a Anchor)
func (*ImageView) SetImageFromFile ¶ added in v0.0.5
SetImageFromFile loads a PNG, JPEG or GIF file and shows it.
func (*ImageView) SetMode ¶ added in v0.0.5
SetMode chooses how the image is fitted, ImageFit by default.
func (ImageView) SetOnBlur ¶ added in v0.0.5
func (c ImageView) SetOnBlur(f func())
SetOnBlur sets the function called when the control loses the keyboard focus.
func (ImageView) SetOnChar ¶ added in v0.0.5
func (c ImageView) SetOnChar(f func(r rune))
SetOnChar sets the function called for typed characters.
func (ImageView) SetOnDropFiles ¶ added in v0.0.5
func (c ImageView) SetOnDropFiles(f DropFilesFunc)
SetOnDropFiles makes the control a drop target for files dragged from the file explorer.
func (ImageView) SetOnFocus ¶ added in v0.0.5
func (c ImageView) SetOnFocus(f func())
SetOnFocus sets the function called when the control gets the keyboard focus.
func (ImageView) SetOnKeyDown ¶ added in v0.0.5
func (c ImageView) SetOnKeyDown(f func(key int))
SetOnKeyDown sets the function called when a key goes down while the control has the focus. The key is a virtual key code, see the Key... values.
func (ImageView) SetOnKeyUp ¶ added in v0.0.5
func (c ImageView) SetOnKeyUp(f func(key int))
SetOnKeyUp sets the function called when a key is released.
func (ImageView) SetOnMouseEnter ¶ added in v0.0.5
func (c ImageView) SetOnMouseEnter(f func())
SetOnMouseEnter sets the function called when the mouse enters the control.
func (ImageView) SetOnMouseLeave ¶ added in v0.0.5
func (c ImageView) SetOnMouseLeave(f func())
SetOnMouseLeave sets the function called when the mouse leaves the control.
func (ImageView) SetOnMouseWheel ¶ added in v0.0.5
SetOnMouseWheel sets the function called when the wheel turns while the control has the focus. A delta of 1 is one notch away from the user.
func (ImageView) SetOnResize ¶ added in v0.0.5
func (c ImageView) SetOnResize(f func())
func (ImageView) SetPosition ¶ added in v0.0.5
func (c ImageView) SetPosition(x, y int)
func (ImageView) SetTabStop ¶ added in v0.0.5
func (c ImageView) SetTabStop(on bool)
SetTabStop chooses whether the Tab key stops at this control. The default depends on the control type.
func (ImageView) SetTextColor ¶ added in v0.0.5
func (c ImageView) SetTextColor(col Color)
SetTextColor changes the color of the control's text.
func (ImageView) SetToolTip ¶ added in v0.0.5
func (c ImageView) SetToolTip(text string)
SetToolTip sets the hint text shown when the mouse rests over the control. An empty text removes the tool tip. It works for every control.
func (ImageView) SetVerticalAnchor ¶ added in v0.0.5
func (c ImageView) SetVerticalAnchor(a Anchor)
func (ImageView) SetVisible ¶ added in v0.0.5
func (c ImageView) SetVisible(v bool)
func (ImageView) TabStop ¶ added in v0.0.5
func (c ImageView) TabStop() bool
TabStop tells whether the Tab key stops at this control.
func (ImageView) TextColor ¶ added in v0.0.5
func (c ImageView) TextColor() Color
TextColor returns the color set with SetTextColor. If no color was set it returns the system window text color.
func (ImageView) ToolTip ¶ added in v0.0.5
func (c ImageView) ToolTip() string
ToolTip returns the hint text of the control.
func (ImageView) VerticalAnchor ¶ added in v0.0.5
func (c ImageView) VerticalAnchor() Anchor
type IntUpDown ¶
type IntUpDown struct {
// contains filtered or unexported fields
}
func NewIntUpDown ¶
func NewIntUpDown() *IntUpDown
func (*IntUpDown) AppendText ¶ added in v0.0.5
func (c *IntUpDown) AppendText(text string)
AppendText adds text at the end and scrolls it into view. It is much faster than SetText(Text()+...) for logs.
func (*IntUpDown) CanUndo ¶ added in v0.0.5
func (c *IntUpDown) CanUndo() bool
CanUndo tells whether Undo has something to revert.
func (*IntUpDown) Copy ¶ added in v0.0.5
func (c *IntUpDown) Copy()
Copy copies the selected text to the clipboard.
func (*IntUpDown) CursorLine ¶ added in v0.0.5
func (c *IntUpDown) CursorLine() int
CursorLine returns the zero based line the cursor is on.
func (*IntUpDown) CursorPosition ¶
func (c *IntUpDown) CursorPosition() (start, end int)
CursorPosition returns the current cursor position, respectively the current selection.
If no selection is active, the returned start and end values are the same. They then indicate the index of the UTF-8 character in this EditLine's Text() before which the caret is currently set.
If a selection is active, start is the index of the first selected UTF-8 character in Text() and end is the position one character after the end of the selection. The selected text is thus
c.Text()[start:end]
func (*IntUpDown) Cut ¶ added in v0.0.5
func (c *IntUpDown) Cut()
Cut moves the selected text to the clipboard.
func (*IntUpDown) DeleteSelection ¶ added in v0.0.5
func (c *IntUpDown) DeleteSelection()
DeleteSelection deletes the selected text without using the clipboard.
func (*IntUpDown) LineCount ¶ added in v0.0.5
func (c *IntUpDown) LineCount() int
LineCount returns the number of lines of a multi line edit.
func (*IntUpDown) OnTabFocus ¶
func (n *IntUpDown) OnTabFocus() func()
func (*IntUpDown) OnValueChange ¶
func (*IntUpDown) Paste ¶ added in v0.0.5
func (c *IntUpDown) Paste()
Paste inserts the clipboard text at the cursor.
func (*IntUpDown) ReplaceSelection ¶ added in v0.0.5
func (c *IntUpDown) ReplaceSelection(text string)
ReplaceSelection replaces the selected text, or inserts at the cursor if nothing is selected. The change can be undone.
func (*IntUpDown) ScrollToCaret ¶ added in v0.0.5
func (c *IntUpDown) ScrollToCaret()
ScrollToCaret scrolls so that the cursor is visible.
func (*IntUpDown) SelectedText ¶ added in v0.0.5
func (c *IntUpDown) SelectedText() string
SelectedText returns the selected text, empty if nothing is selected.
func (*IntUpDown) SetCueBanner ¶ added in v0.0.5
SetCueBanner sets the grayed hint text shown while an edit is empty, the "placeholder". If showWhenFocused is true it stays visible until the user types. It works for single line edits (EditLine) only.
func (*IntUpDown) SetCursorPosition ¶
func (c *IntUpDown) SetCursorPosition(pos int)
func (*IntUpDown) SetNumbersOnly ¶ added in v0.0.5
func (c *IntUpDown) SetNumbersOnly(on bool)
SetNumbersOnly allows only the digits 0 to 9 to be typed. Pasting is not restricted by Windows.
func (*IntUpDown) SetOnTabFocus ¶
func (n *IntUpDown) SetOnTabFocus(f func())
func (*IntUpDown) SetOnValueChange ¶
func (*IntUpDown) SetSelection ¶
func (c *IntUpDown) SetSelection(start, end int)
func (*IntUpDown) SetTextAlign ¶ added in v0.0.5
func (c *IntUpDown) SetTextAlign(a EditAlign)
SetTextAlign aligns the text left, centered or right.
func (*IntUpDown) SetVisible ¶
type Label ¶
type Label struct {
// contains filtered or unexported fields
}
func (*Label) Alignment ¶
func (l *Label) Alignment() TextAlignment
func (*Label) SetAlignment ¶
func (l *Label) SetAlignment(a TextAlignment)
type Layout ¶ added in v0.0.5
Layout places the children of a Panel or Window. Set one with Panel.SetLayout or Window.SetLayout and the children are arranged again whenever the container is resized or children are added or removed. Anchors of the children are overridden by the layout.
Arrange gets the children and the area (x, y, width, height) in the container's client coordinates. Children that are not Visible are skipped.
type LineJoin ¶ added in v0.0.2
type LineJoin int
LineJoin is the shape of the corners of wide lines.
type LineStyle ¶ added in v0.0.2
type LineStyle int
LineStyle is the dash pattern of lines, see Canvas.SetStroke.
type LinkLabel ¶ added in v0.0.5
type LinkLabel struct {
// contains filtered or unexported fields
}
LinkLabel is a label whose text can contain clickable links written in HTML style: `Visit <a href="https://example.com">our site</a> or <a id="help">get help</a>`.
func NewLinkLabel ¶ added in v0.0.5
func NewLinkLabel() *LinkLabel
NewLinkLabel creates a label with links. Set its text with SetText.
func (*LinkLabel) OnTabFocus ¶ added in v0.0.5
func (l *LinkLabel) OnTabFocus() func()
func (*LinkLabel) SetOnClick ¶ added in v0.0.5
SetOnClick sets the function called with the href and id of a clicked link. Without it, the href is opened with OpenURL.
func (*LinkLabel) SetOnTabFocus ¶ added in v0.0.5
func (l *LinkLabel) SetOnTabFocus(f func())
type ListView ¶ added in v0.0.5
type ListView struct {
// contains filtered or unexported fields
}
ListView is the full featured list control: several columns with headers, small or large icons, check boxes, multiple selection, sorting by clicking the column headers, editable labels and a virtual mode for huge data sets. It replaces StringTable where you need more than plain text rows.
lv := wui.NewListView()
lv.AddColumn("Name", 200)
lv.AddColumn("Size", 80)
lv.AddItem("readme.txt", "1 KB")
func NewListView ¶ added in v0.0.5
func NewListView() *ListView
NewListView creates an empty list view in details mode.
func (*ListView) AddColumn ¶ added in v0.0.5
AddColumn appends a column with a header and a width in pixels and returns its index.
func (*ListView) AddItem ¶ added in v0.0.5
func (l *ListView) AddItem(cells ...string) *ListViewItem
AddItem appends a row. The cells are the texts of the columns from left to right.
func (*ListView) AutoSizeColumns ¶ added in v0.0.5
func (l *ListView) AutoSizeColumns()
AutoSizeColumns sizes every column to fit its widest cell, or its header when there are no items.
func (*ListView) ColumnCount ¶ added in v0.0.5
ColumnCount returns the number of columns.
func (*ListView) EnsureVisible ¶ added in v0.0.5
EnsureVisible scrolls the row into view.
func (*ListView) Item ¶ added in v0.0.5
func (l *ListView) Item(index int) *ListViewItem
Item returns the row at index or nil.
func (*ListView) Items ¶ added in v0.0.5
func (l *ListView) Items() []*ListViewItem
Items returns all rows in their current order.
func (*ListView) MultiSelect ¶ added in v0.0.5
MultiSelect tells whether several rows can be selected.
func (*ListView) OnTabFocus ¶ added in v0.0.5
func (l *ListView) OnTabFocus() func()
func (*ListView) Refresh ¶ added in v0.0.5
func (l *ListView) Refresh()
Refresh redraws all rows, use it in virtual mode after the data changed.
func (*ListView) RemoveItem ¶ added in v0.0.5
RemoveItem deletes the row at index.
func (*ListView) SelectAll ¶ added in v0.0.5
func (l *ListView) SelectAll()
SelectAll selects every row, if multiple selection is on.
func (*ListView) SelectedIndex ¶ added in v0.0.5
SelectedIndex returns the first selected row, or -1.
func (*ListView) SelectedIndices ¶ added in v0.0.5
SelectedIndices returns all selected rows in ascending order.
func (*ListView) SelectedItems ¶ added in v0.0.5
func (l *ListView) SelectedItems() []*ListViewItem
SelectedItems returns the selected rows.
func (*ListView) SetCheckBoxes ¶ added in v0.0.5
SetCheckBoxes shows a check box in front of each row.
func (*ListView) SetColumnAlignment ¶ added in v0.0.5
func (l *ListView) SetColumnAlignment(col int, a ColumnAlign)
SetColumnAlignment aligns the text of a column. The first column is always left aligned by Windows.
func (*ListView) SetColumnTitle ¶ added in v0.0.5
SetColumnTitle changes the header text of a column.
func (*ListView) SetColumnWidth ¶ added in v0.0.5
SetColumnWidth sets the width of a column in pixels.
func (*ListView) SetColumns ¶ added in v0.0.5
SetColumns adds columns with the given titles, each 100 pixels wide, for use from wml. Use AddColumn for control over the widths.
func (*ListView) SetCompare ¶ added in v0.0.5
SetCompare replaces the function that orders two cell texts when sorting. It returns a negative number, zero or a positive number. The default sorts numbers by value and other text without regard to case.
func (*ListView) SetEditable ¶ added in v0.0.5
SetEditable allows renaming the first cell of a row in place: click an already selected row or press F2.
func (*ListView) SetFullRowSelect ¶ added in v0.0.5
SetFullRowSelect makes a click anywhere in the row select it (default).
func (*ListView) SetGridLines ¶ added in v0.0.5
SetGridLines draws lines between the cells in details view.
func (*ListView) SetHeaderVisible ¶ added in v0.0.5
SetHeaderVisible shows or hides the column headers in details view.
func (*ListView) SetItems ¶ added in v0.0.5
SetItems adds one row per text, each with the text in the first column, for use from wml.
func (*ListView) SetLargeImages ¶ added in v0.0.5
SetLargeImages sets the icons used by the large icon and tile views.
func (*ListView) SetMultiSelect ¶ added in v0.0.5
SetMultiSelect allows selecting several rows with Ctrl and Shift.
func (*ListView) SetOnActivate ¶ added in v0.0.5
SetOnActivate sets the function called when a row is double clicked or Enter is pressed on it.
func (*ListView) SetOnColumnClick ¶ added in v0.0.5
SetOnColumnClick sets the function called when a column header is clicked, in addition to sorting if that is on.
func (*ListView) SetOnItemCheck ¶ added in v0.0.5
func (l *ListView) SetOnItemCheck(f func(item *ListViewItem, checked bool))
SetOnItemCheck sets the function called when the user ticks or clears the check box of a row.
func (*ListView) SetOnLabelEdit ¶ added in v0.0.5
func (l *ListView) SetOnLabelEdit(f func(item *ListViewItem, newText string) bool)
SetOnLabelEdit sets the function called when the user finished editing a label. Return false to reject the new text.
func (*ListView) SetOnSelect ¶ added in v0.0.5
SetOnSelect sets the function called with the row index when a row gets selected.
func (*ListView) SetOnTabFocus ¶ added in v0.0.5
func (l *ListView) SetOnTabFocus(f func())
func (*ListView) SetSelectedIndex ¶ added in v0.0.5
SetSelectedIndex selects only the given row, -1 clears the selection.
func (*ListView) SetSmallImages ¶ added in v0.0.5
SetSmallImages sets the icons used by details, list and small icon views.
func (*ListView) SetSortable ¶ added in v0.0.5
SetSortable sorts the rows when the user clicks a column header. Clicking the same header again reverses the order.
func (*ListView) SetView ¶ added in v0.0.5
func (l *ListView) SetView(v ListViewView)
SetView chooses how the items are shown.
func (*ListView) SetVirtual ¶ added in v0.0.5
SetVirtual switches to virtual mode for very large lists: no row objects exist, the list asks text(row, column) for what it needs to draw, so a million rows cost no memory. Rows cannot be added, sorted or checked in this mode. Call SetVirtualCount when the number of rows changes and Refresh when the data changed.
func (*ListView) SetVirtualCount ¶ added in v0.0.5
SetVirtualCount changes the number of rows in virtual mode.
func (*ListView) SetVirtualImage ¶ added in v0.0.5
SetVirtualImage sets the function that returns the image list index of a row in virtual mode.
func (*ListView) View ¶ added in v0.0.5
func (l *ListView) View() ListViewView
View returns the current view.
type ListViewItem ¶ added in v0.0.5
type ListViewItem struct {
Tag interface{}
// contains filtered or unexported fields
}
ListViewItem is one row of a ListView. Tag can hold anything you like.
func (*ListViewItem) Cell ¶ added in v0.0.5
func (it *ListViewItem) Cell(col int) string
Cell returns the text in a column of this row.
func (*ListViewItem) Checked ¶ added in v0.0.5
func (it *ListViewItem) Checked() bool
Checked tells whether the row's check box is ticked. It needs SetCheckBoxes(true).
func (*ListViewItem) EditLabel ¶ added in v0.0.5
func (it *ListViewItem) EditLabel()
EditLabel starts in-place editing of the row's first cell. It needs SetEditable(true).
func (*ListViewItem) Image ¶ added in v0.0.5
func (it *ListViewItem) Image() int
Image returns the image list index shown for this row.
func (*ListViewItem) Index ¶ added in v0.0.5
func (it *ListViewItem) Index() int
Index returns the current position of the row, or -1 if it was removed.
func (*ListViewItem) Select ¶ added in v0.0.5
func (it *ListViewItem) Select()
Select makes this row the only selected row and scrolls it into view.
func (*ListViewItem) SetCell ¶ added in v0.0.5
func (it *ListViewItem) SetCell(col int, text string)
SetCell changes the text in a column of this row.
func (*ListViewItem) SetChecked ¶ added in v0.0.5
func (it *ListViewItem) SetChecked(checked bool)
SetChecked ticks or clears the row's check box.
func (*ListViewItem) SetImage ¶ added in v0.0.5
func (it *ListViewItem) SetImage(index int)
SetImage chooses the image (an index into the ListView's image list).
type ListViewView ¶ added in v0.0.5
type ListViewView int
ListViewView is how a ListView shows its items.
const ( // ListViewDetails shows columns with headers (the default). ListViewDetails ListViewView = iota // ListViewList shows small icons with text in columns that flow. ListViewList // ListViewIcons shows large icons with text below. ListViewIcons // ListViewSmallIcons shows small icons with text on the right. ListViewSmallIcons // ListViewTiles shows large icons with several text lines on the right. ListViewTiles )
type Menu ¶
type Menu struct {
// contains filtered or unexported fields
}
Menu is a named container for MenuItems. It is not executable, clicking a Menu will expand it and show its children. See NewMainMenu and NewMenu.
func NewMainMenu ¶
func NewMainMenu() *Menu
NewMainMenu returns a new menu bar that can be added to a Window. You can add sub-menus to it with Menu.Add.
type MenuItem ¶
type MenuItem interface {
// contains filtered or unexported methods
}
MenuItem is something that can go into a menu. Possible such things can be created via: NewMenu, NewMenuString, NewMenuSeparator.
func NewMenuSeparator ¶
func NewMenuSeparator() MenuItem
NewMenuSeparator returns a horizontal line separating regions in a menu.
type MenuString ¶
type MenuString struct {
// contains filtered or unexported fields
}
MenuString is an executable menu item, see NewMenuString.
func NewMenuString ¶
func NewMenuString(text string) *MenuString
NewMenuString creates a new executable menu item with the given text.
Insert an ampersand to underline the following character, e.g. "New &File" to underline the "F". This will be the character used when the user uses the alt and arrow keys to navigate the menu.
If you want to display a shortcut text next to the menu, right aligned, insert a tab and then your text, e.g. "Open File\tCtrl+O" to have "Open File" on the left and "Ctrl+O" on the right.
func (*MenuString) Checked ¶
func (m *MenuString) Checked() bool
func (*MenuString) Enabled ¶ added in v0.0.5
func (m *MenuString) Enabled() bool
Enabled tells whether the item can be chosen.
func (*MenuString) OnClick ¶
func (m *MenuString) OnClick() func()
func (*MenuString) SetChecked ¶
func (m *MenuString) SetChecked(c bool)
func (*MenuString) SetEnabled ¶ added in v0.0.5
func (m *MenuString) SetEnabled(on bool)
SetEnabled enables or grays out the menu item.
func (*MenuString) SetImage ¶ added in v0.0.5
func (m *MenuString) SetImage(img *Image)
SetImage shows an icon in front of the item. The image is converted to a 32 bit bitmap, 16x16 pixels is the usual size. Call it before the window is shown.
func (*MenuString) SetOnClick ¶
func (m *MenuString) SetOnClick(f func()) *MenuString
func (*MenuString) SetRadio ¶ added in v0.0.5
func (m *MenuString) SetRadio(on bool)
SetRadio shows the check mark of this item as a round bullet, for groups of items of which only one is checked.
func (*MenuString) SetText ¶
func (m *MenuString) SetText(s string)
func (*MenuString) Text ¶
func (m *MenuString) Text() string
type MessageCallback ¶
MessageCallback is used as a hook into the main window procedure. It will run at its very start and may intercept all messages. If the callback returns true for handled, then the message is processed no further and the message loop returns the given result code. If the callback returns false for handled, then the message goes to this library's handler for it or to the default window procedure defined in the Windows API if it is not handled.
type MonthCalendar ¶ added in v0.0.5
type MonthCalendar struct {
// contains filtered or unexported fields
}
MonthCalendar shows a month and lets the user pick a day.
func NewMonthCalendar ¶ added in v0.0.5
func NewMonthCalendar() *MonthCalendar
NewMonthCalendar creates a calendar showing today's month.
func (*MonthCalendar) Date ¶ added in v0.0.5
func (m *MonthCalendar) Date() time.Time
Date returns the selected day, with the time of day set to midnight.
func (*MonthCalendar) OnTabFocus ¶ added in v0.0.5
func (m *MonthCalendar) OnTabFocus() func()
func (*MonthCalendar) PreferredSize ¶ added in v0.0.5
func (m *MonthCalendar) PreferredSize() (width, height int)
PreferredSize returns the size that shows the whole month, to use with SetSize after the window is shown.
func (*MonthCalendar) SetDate ¶ added in v0.0.5
func (m *MonthCalendar) SetDate(t time.Time)
SetDate selects a day.
func (*MonthCalendar) SetOnChange ¶ added in v0.0.5
func (m *MonthCalendar) SetOnChange(f func(date time.Time))
SetOnChange sets the function called when the selected day changes.
func (*MonthCalendar) SetOnTabFocus ¶ added in v0.0.5
func (m *MonthCalendar) SetOnTabFocus(f func())
func (*MonthCalendar) SetShowWeekNumbers ¶ added in v0.0.5
func (m *MonthCalendar) SetShowWeekNumbers(on bool)
SetShowWeekNumbers shows the week numbers at the left of the days. Call it before the window is shown.
type MouseButton ¶
type MouseButton int
const ( MouseButtonLeft MouseButton = iota MouseButtonMiddle MouseButtonRight )
func (MouseButton) String ¶
func (b MouseButton) String() string
type NativeToolBar ¶ added in v0.0.5
type NativeToolBar struct {
// contains filtered or unexported fields
}
NativeToolBar is the real Windows tool bar: flat buttons with icons from an ImageList, optional text, toggle buttons, buttons with a drop down menu and separators. (ToolBar, the older control, is only a row of ordinary buttons.)
il := wui.NewImageList(24, 24)
open := il.AddIcon(openIcon)
tb := wui.NewNativeToolBar()
tb.SetImages(il)
tb.AddButton("Open", open, func() { ... })
tb.AddSeparator()
tb.AddToggle("Bold", bold, func(on bool) { ... })
func NewNativeToolBar ¶ added in v0.0.5
func NewNativeToolBar() *NativeToolBar
NewNativeToolBar creates an empty tool bar that shows button texts next to the icons. Put it at the top of a window with anchors AnchorMinAndMax horizontally and set its height to PreferredHeight (or about 28).
func (*NativeToolBar) AddButton ¶ added in v0.0.5
func (t *NativeToolBar) AddButton(text string, image int, onClick func()) *NativeToolButton
AddButton appends a push button with a text, an icon (index into the image list, -1 for none) and a click function.
func (*NativeToolBar) AddDropDown ¶ added in v0.0.5
func (t *NativeToolBar) AddDropDown(text string, image int, onClick func(), menu *PopupMenu) *NativeToolButton
AddDropDown appends a button with a small arrow that opens the menu. A click on the button itself calls onClick, which may be nil.
func (*NativeToolBar) AddSeparator ¶ added in v0.0.5
func (t *NativeToolBar) AddSeparator()
AddSeparator appends a thin gap between groups of buttons.
func (*NativeToolBar) AddToggle ¶ added in v0.0.5
func (t *NativeToolBar) AddToggle(text string, image int, onToggle func(on bool)) *NativeToolButton
AddToggle appends a button that stays pressed until clicked again.
func (*NativeToolBar) Anchors ¶ added in v0.0.5
func (c *NativeToolBar) Anchors() (horizontal, vertical Anchor)
func (*NativeToolBar) BackgroundColor ¶ added in v0.0.5
func (c *NativeToolBar) BackgroundColor() Color
BackgroundColor returns the color set with SetBackgroundColor. If no color was set it returns the system button face color.
func (*NativeToolBar) Bounds ¶ added in v0.0.5
func (c *NativeToolBar) Bounds() (x, y, width, height int)
func (*NativeToolBar) Buttons ¶ added in v0.0.5
func (t *NativeToolBar) Buttons() []*NativeToolButton
Buttons returns the buttons in order, including separators.
func (*NativeToolBar) ContextMenu ¶ added in v0.0.5
func (c *NativeToolBar) ContextMenu() *PopupMenu
func (*NativeToolBar) Focus ¶ added in v0.0.5
func (c *NativeToolBar) Focus()
Focus gives the control the keyboard focus. It does nothing before the window is shown.
func (*NativeToolBar) HasBackgroundColor ¶ added in v0.0.5
func (c *NativeToolBar) HasBackgroundColor() bool
HasBackgroundColor returns true if SetBackgroundColor was called.
func (*NativeToolBar) HasFocus ¶ added in v0.0.5
func (c *NativeToolBar) HasFocus() bool
HasFocus tells whether the control has the keyboard focus.
func (*NativeToolBar) HasTextColor ¶ added in v0.0.5
func (c *NativeToolBar) HasTextColor() bool
HasTextColor returns true if SetTextColor was called.
func (*NativeToolBar) HorizontalAnchor ¶ added in v0.0.5
func (c *NativeToolBar) HorizontalAnchor() Anchor
func (*NativeToolBar) OnDropFiles ¶ added in v0.0.5
func (c *NativeToolBar) OnDropFiles() DropFilesFunc
OnDropFiles returns the handler set with SetOnDropFiles.
func (*NativeToolBar) PreferredHeight ¶ added in v0.0.5
func (t *NativeToolBar) PreferredHeight() int
PreferredHeight returns the height that fits the buttons.
func (*NativeToolBar) ResetBackgroundColor ¶ added in v0.0.5
func (c *NativeToolBar) ResetBackgroundColor()
ResetBackgroundColor goes back to the default background.
func (*NativeToolBar) ResetTextColor ¶ added in v0.0.5
func (c *NativeToolBar) ResetTextColor()
ResetTextColor goes back to the system text color.
func (*NativeToolBar) SetAnchors ¶ added in v0.0.5
func (c *NativeToolBar) SetAnchors(horizontal, vertical Anchor)
func (*NativeToolBar) SetBackgroundColor ¶ added in v0.0.5
func (c *NativeToolBar) SetBackgroundColor(col Color)
SetBackgroundColor changes the color behind the control's text (or the fill color of a Panel).
func (*NativeToolBar) SetBounds ¶ added in v0.0.5
func (c *NativeToolBar) SetBounds(x, y, width, height int)
func (*NativeToolBar) SetContextMenu ¶ added in v0.0.5
func (c *NativeToolBar) SetContextMenu(m *PopupMenu)
SetContextMenu sets the menu that opens when the user right-clicks the control. Not all native controls (e.g. edit boxes) forward right clicks.
func (*NativeToolBar) SetCursor ¶ added in v0.0.5
func (c *NativeToolBar) SetCursor(cur *Cursor)
SetCursor sets the mouse cursor shown over the control, nil goes back to the default. Labels, panels and paint boxes pass mouse input through to their parent, setting a cursor or a mouse handler makes them keep it.
func (*NativeToolBar) SetEnabled ¶ added in v0.0.5
func (c *NativeToolBar) SetEnabled(e bool)
func (*NativeToolBar) SetHorizontalAnchor ¶ added in v0.0.5
func (c *NativeToolBar) SetHorizontalAnchor(a Anchor)
func (*NativeToolBar) SetImages ¶ added in v0.0.5
func (t *NativeToolBar) SetImages(il *ImageList)
SetImages gives the tool bar the icons the buttons refer to by index.
func (*NativeToolBar) SetOnBlur ¶ added in v0.0.5
func (c *NativeToolBar) SetOnBlur(f func())
SetOnBlur sets the function called when the control loses the keyboard focus.
func (*NativeToolBar) SetOnChar ¶ added in v0.0.5
func (c *NativeToolBar) SetOnChar(f func(r rune))
SetOnChar sets the function called for typed characters.
func (*NativeToolBar) SetOnDoubleClick ¶ added in v0.0.5
func (c *NativeToolBar) SetOnDoubleClick(f func(x, y int, button MouseButton))
SetOnDoubleClick sets the function called on a mouse double click.
func (*NativeToolBar) SetOnDropFiles ¶ added in v0.0.5
func (c *NativeToolBar) SetOnDropFiles(f DropFilesFunc)
SetOnDropFiles makes the control a drop target for files dragged from the file explorer.
func (*NativeToolBar) SetOnFocus ¶ added in v0.0.5
func (c *NativeToolBar) SetOnFocus(f func())
SetOnFocus sets the function called when the control gets the keyboard focus.
func (*NativeToolBar) SetOnKeyDown ¶ added in v0.0.5
func (c *NativeToolBar) SetOnKeyDown(f func(key int))
SetOnKeyDown sets the function called when a key goes down while the control has the focus. The key is a virtual key code, see the Key... values.
func (*NativeToolBar) SetOnKeyUp ¶ added in v0.0.5
func (c *NativeToolBar) SetOnKeyUp(f func(key int))
SetOnKeyUp sets the function called when a key is released.
func (*NativeToolBar) SetOnMouseDown ¶ added in v0.0.5
func (c *NativeToolBar) SetOnMouseDown(f func(x, y int, button MouseButton))
SetOnMouseDown sets the function called when a mouse button goes down over the control. x and y are relative to the control.
func (*NativeToolBar) SetOnMouseEnter ¶ added in v0.0.5
func (c *NativeToolBar) SetOnMouseEnter(f func())
SetOnMouseEnter sets the function called when the mouse enters the control.
func (*NativeToolBar) SetOnMouseLeave ¶ added in v0.0.5
func (c *NativeToolBar) SetOnMouseLeave(f func())
SetOnMouseLeave sets the function called when the mouse leaves the control.
func (*NativeToolBar) SetOnMouseMove ¶ added in v0.0.5
func (c *NativeToolBar) SetOnMouseMove(f func(x, y int))
SetOnMouseMove sets the function called when the mouse moves over the control.
func (*NativeToolBar) SetOnMouseUp ¶ added in v0.0.5
func (c *NativeToolBar) SetOnMouseUp(f func(x, y int, button MouseButton))
SetOnMouseUp sets the function called when a mouse button is released.
func (*NativeToolBar) SetOnMouseWheel ¶ added in v0.0.5
SetOnMouseWheel sets the function called when the wheel turns while the control has the focus. A delta of 1 is one notch away from the user.
func (*NativeToolBar) SetOnResize ¶ added in v0.0.5
func (c *NativeToolBar) SetOnResize(f func())
func (*NativeToolBar) SetPosition ¶ added in v0.0.5
func (c *NativeToolBar) SetPosition(x, y int)
func (*NativeToolBar) SetShowText ¶ added in v0.0.5
func (t *NativeToolBar) SetShowText(on bool)
SetShowText chooses whether the buttons show their text. Without text only icons are shown. It must be called before the window is shown.
func (*NativeToolBar) SetTabStop ¶ added in v0.0.5
func (c *NativeToolBar) SetTabStop(on bool)
SetTabStop chooses whether the Tab key stops at this control. The default depends on the control type.
func (*NativeToolBar) SetTextColor ¶ added in v0.0.5
func (c *NativeToolBar) SetTextColor(col Color)
SetTextColor changes the color of the control's text.
func (*NativeToolBar) SetToolTip ¶ added in v0.0.5
func (c *NativeToolBar) SetToolTip(text string)
SetToolTip sets the hint text shown when the mouse rests over the control. An empty text removes the tool tip. It works for every control.
func (*NativeToolBar) SetVerticalAnchor ¶ added in v0.0.5
func (c *NativeToolBar) SetVerticalAnchor(a Anchor)
func (*NativeToolBar) SetVisible ¶ added in v0.0.5
func (c *NativeToolBar) SetVisible(v bool)
func (*NativeToolBar) TabStop ¶ added in v0.0.5
func (c *NativeToolBar) TabStop() bool
TabStop tells whether the Tab key stops at this control.
func (*NativeToolBar) TextColor ¶ added in v0.0.5
func (c *NativeToolBar) TextColor() Color
TextColor returns the color set with SetTextColor. If no color was set it returns the system window text color.
func (*NativeToolBar) ToolTip ¶ added in v0.0.5
func (c *NativeToolBar) ToolTip() string
ToolTip returns the hint text of the control.
func (*NativeToolBar) VerticalAnchor ¶ added in v0.0.5
func (c *NativeToolBar) VerticalAnchor() Anchor
type NativeToolButton ¶ added in v0.0.5
type NativeToolButton struct {
Tag interface{}
// contains filtered or unexported fields
}
NativeToolButton is one entry of a NativeToolBar.
func (*NativeToolButton) Checked ¶ added in v0.0.5
func (b *NativeToolButton) Checked() bool
Checked tells whether a toggle button is pressed.
func (*NativeToolButton) Enabled ¶ added in v0.0.5
func (b *NativeToolButton) Enabled() bool
Enabled tells whether the button can be clicked.
func (*NativeToolButton) SetChecked ¶ added in v0.0.5
func (b *NativeToolButton) SetChecked(on bool)
SetChecked presses or releases a toggle button.
func (*NativeToolButton) SetEnabled ¶ added in v0.0.5
func (b *NativeToolButton) SetEnabled(on bool)
SetEnabled enables or disables the button.
func (*NativeToolButton) SetOnClick ¶ added in v0.0.5
func (b *NativeToolButton) SetOnClick(f func())
SetOnClick replaces the click function.
func (*NativeToolButton) SetVisible ¶ added in v0.0.5
func (b *NativeToolButton) SetVisible(on bool)
SetVisible shows or hides the button.
type PaintBox ¶
type PaintBox struct {
// contains filtered or unexported fields
}
func NewPaintBox ¶
func NewPaintBox() *PaintBox
func (*PaintBox) BackgroundColor ¶ added in v0.0.3
func (c *PaintBox) BackgroundColor() Color
BackgroundColor returns the color set with SetBackgroundColor. If no color was set it returns the system button face color.
func (*PaintBox) ContextMenu ¶ added in v0.0.2
func (c *PaintBox) ContextMenu() *PopupMenu
func (*PaintBox) Focus ¶ added in v0.0.5
func (c *PaintBox) Focus()
Focus gives the control the keyboard focus. It does nothing before the window is shown.
func (*PaintBox) HasBackgroundColor ¶ added in v0.0.3
func (c *PaintBox) HasBackgroundColor() bool
HasBackgroundColor returns true if SetBackgroundColor was called.
func (*PaintBox) HasFocus ¶ added in v0.0.5
func (c *PaintBox) HasFocus() bool
HasFocus tells whether the control has the keyboard focus.
func (*PaintBox) HasTextColor ¶ added in v0.0.3
func (c *PaintBox) HasTextColor() bool
HasTextColor returns true if SetTextColor was called.
func (*PaintBox) HorizontalAnchor ¶
func (c *PaintBox) HorizontalAnchor() Anchor
func (*PaintBox) OnDoubleClick ¶ added in v0.0.2
func (p *PaintBox) OnDoubleClick() func(x, y int, button MouseButton)
func (*PaintBox) OnDropFiles ¶ added in v0.0.3
func (c *PaintBox) OnDropFiles() DropFilesFunc
OnDropFiles returns the handler set with SetOnDropFiles.
func (*PaintBox) OnMouseDown ¶ added in v0.0.2
func (p *PaintBox) OnMouseDown() func(x, y int, button MouseButton)
func (*PaintBox) OnMouseMove ¶
func (*PaintBox) OnMouseUp ¶ added in v0.0.2
func (p *PaintBox) OnMouseUp() func(x, y int, button MouseButton)
func (*PaintBox) ResetBackgroundColor ¶ added in v0.0.3
func (c *PaintBox) ResetBackgroundColor()
ResetBackgroundColor goes back to the default background.
func (*PaintBox) ResetTextColor ¶ added in v0.0.3
func (c *PaintBox) ResetTextColor()
ResetTextColor goes back to the system text color.
func (*PaintBox) SetAnchors ¶
func (c *PaintBox) SetAnchors(horizontal, vertical Anchor)
func (*PaintBox) SetBackgroundColor ¶ added in v0.0.3
func (c *PaintBox) SetBackgroundColor(col Color)
SetBackgroundColor changes the color behind the control's text (or the fill color of a Panel).
func (*PaintBox) SetContextMenu ¶ added in v0.0.2
func (c *PaintBox) SetContextMenu(m *PopupMenu)
SetContextMenu sets the menu that opens when the user right-clicks the control. Not all native controls (e.g. edit boxes) forward right clicks.
func (*PaintBox) SetCursor ¶ added in v0.0.5
func (c *PaintBox) SetCursor(cur *Cursor)
SetCursor sets the mouse cursor shown over the control, nil goes back to the default. Labels, panels and paint boxes pass mouse input through to their parent, setting a cursor or a mouse handler makes them keep it.
func (*PaintBox) SetEnabled ¶
func (c *PaintBox) SetEnabled(e bool)
func (*PaintBox) SetHorizontalAnchor ¶
func (c *PaintBox) SetHorizontalAnchor(a Anchor)
func (*PaintBox) SetOnBlur ¶ added in v0.0.5
func (c *PaintBox) SetOnBlur(f func())
SetOnBlur sets the function called when the control loses the keyboard focus.
func (*PaintBox) SetOnChar ¶ added in v0.0.5
func (c *PaintBox) SetOnChar(f func(r rune))
SetOnChar sets the function called for typed characters.
func (*PaintBox) SetOnDoubleClick ¶ added in v0.0.2
func (p *PaintBox) SetOnDoubleClick(f func(x, y int, button MouseButton))
SetOnDoubleClick sets the function called on a double click. Without it a double click is reported as a second mouse down.
func (*PaintBox) SetOnDropFiles ¶ added in v0.0.3
func (c *PaintBox) SetOnDropFiles(f DropFilesFunc)
SetOnDropFiles makes the control a drop target for files dragged from the file explorer.
func (*PaintBox) SetOnFocus ¶ added in v0.0.5
func (c *PaintBox) SetOnFocus(f func())
SetOnFocus sets the function called when the control gets the keyboard focus.
func (*PaintBox) SetOnKeyDown ¶ added in v0.0.5
func (c *PaintBox) SetOnKeyDown(f func(key int))
SetOnKeyDown sets the function called when a key goes down while the control has the focus. The key is a virtual key code, see the Key... values.
func (*PaintBox) SetOnKeyUp ¶ added in v0.0.5
func (c *PaintBox) SetOnKeyUp(f func(key int))
SetOnKeyUp sets the function called when a key is released.
func (*PaintBox) SetOnMouseDown ¶ added in v0.0.2
func (p *PaintBox) SetOnMouseDown(f func(x, y int, button MouseButton))
SetOnMouseDown sets the function called when a mouse button is pressed in the PaintBox. While the button is held, mouse move events keep coming even when the mouse leaves the PaintBox, so dragging works.
func (*PaintBox) SetOnMouseEnter ¶ added in v0.0.5
func (c *PaintBox) SetOnMouseEnter(f func())
SetOnMouseEnter sets the function called when the mouse enters the control.
func (*PaintBox) SetOnMouseLeave ¶ added in v0.0.5
func (c *PaintBox) SetOnMouseLeave(f func())
SetOnMouseLeave sets the function called when the mouse leaves the control.
func (*PaintBox) SetOnMouseMove ¶
func (*PaintBox) SetOnMouseUp ¶ added in v0.0.2
func (p *PaintBox) SetOnMouseUp(f func(x, y int, button MouseButton))
SetOnMouseUp sets the function called when a mouse button is released.
func (*PaintBox) SetOnMouseWheel ¶ added in v0.0.5
SetOnMouseWheel sets the function called when the wheel turns while the control has the focus. A delta of 1 is one notch away from the user.
func (*PaintBox) SetOnPaint ¶
func (*PaintBox) SetOnResize ¶
func (c *PaintBox) SetOnResize(f func())
func (*PaintBox) SetPosition ¶
func (c *PaintBox) SetPosition(x, y int)
func (*PaintBox) SetTabStop ¶ added in v0.0.5
func (c *PaintBox) SetTabStop(on bool)
SetTabStop chooses whether the Tab key stops at this control. The default depends on the control type.
func (*PaintBox) SetTextColor ¶ added in v0.0.3
func (c *PaintBox) SetTextColor(col Color)
SetTextColor changes the color of the control's text.
func (*PaintBox) SetToolTip ¶ added in v0.0.2
func (c *PaintBox) SetToolTip(text string)
SetToolTip sets the hint text shown when the mouse rests over the control. An empty text removes the tool tip. It works for every control.
func (*PaintBox) SetVerticalAnchor ¶
func (c *PaintBox) SetVerticalAnchor(a Anchor)
func (*PaintBox) SetVisible ¶
func (c *PaintBox) SetVisible(v bool)
func (*PaintBox) TabStop ¶ added in v0.0.5
func (c *PaintBox) TabStop() bool
TabStop tells whether the Tab key stops at this control.
func (*PaintBox) TextColor ¶ added in v0.0.3
func (c *PaintBox) TextColor() Color
TextColor returns the color set with SetTextColor. If no color was set it returns the system window text color.
func (*PaintBox) ToolTip ¶ added in v0.0.2
func (c *PaintBox) ToolTip() string
ToolTip returns the hint text of the control.
func (*PaintBox) VerticalAnchor ¶
func (c *PaintBox) VerticalAnchor() Anchor
type Panel ¶
type Panel struct {
// contains filtered or unexported fields
}
func (*Panel) BackgroundColor ¶ added in v0.0.3
func (c *Panel) BackgroundColor() Color
BackgroundColor returns the color set with SetBackgroundColor. If no color was set it returns the system button face color.
func (*Panel) BorderStyle ¶
func (p *Panel) BorderStyle() PanelBorderStyle
func (*Panel) ContextMenu ¶ added in v0.0.2
func (c *Panel) ContextMenu() *PopupMenu
func (*Panel) Focus ¶ added in v0.0.5
func (c *Panel) Focus()
Focus gives the control the keyboard focus. It does nothing before the window is shown.
func (*Panel) HasBackgroundColor ¶ added in v0.0.3
func (c *Panel) HasBackgroundColor() bool
HasBackgroundColor returns true if SetBackgroundColor was called.
func (*Panel) HasFocus ¶ added in v0.0.5
func (c *Panel) HasFocus() bool
HasFocus tells whether the control has the keyboard focus.
func (*Panel) HasTextColor ¶ added in v0.0.3
func (c *Panel) HasTextColor() bool
HasTextColor returns true if SetTextColor was called.
func (*Panel) HorizontalAnchor ¶
func (c *Panel) HorizontalAnchor() Anchor
func (*Panel) InnerBounds ¶
func (*Panel) InnerHeight ¶
func (*Panel) InnerPosition ¶
func (*Panel) InnerWidth ¶
func (*Panel) OnDropFiles ¶ added in v0.0.3
func (c *Panel) OnDropFiles() DropFilesFunc
OnDropFiles returns the handler set with SetOnDropFiles.
func (*Panel) Relayout ¶ added in v0.0.5
func (p *Panel) Relayout()
Relayout arranges the children again, call it after changing the settings of a layout while the window is open.
func (*Panel) ResetBackgroundColor ¶ added in v0.0.3
func (c *Panel) ResetBackgroundColor()
ResetBackgroundColor goes back to the default background.
func (*Panel) ResetTextColor ¶ added in v0.0.3
func (c *Panel) ResetTextColor()
ResetTextColor goes back to the system text color.
func (*Panel) SetAnchors ¶
func (c *Panel) SetAnchors(horizontal, vertical Anchor)
func (*Panel) SetBackgroundColor ¶ added in v0.0.3
func (c *Panel) SetBackgroundColor(col Color)
SetBackgroundColor changes the color behind the control's text (or the fill color of a Panel).
func (*Panel) SetBorderStyle ¶
func (p *Panel) SetBorderStyle(s PanelBorderStyle)
func (*Panel) SetContextMenu ¶ added in v0.0.2
func (c *Panel) SetContextMenu(m *PopupMenu)
SetContextMenu sets the menu that opens when the user right-clicks the control. Not all native controls (e.g. edit boxes) forward right clicks.
func (*Panel) SetCursor ¶ added in v0.0.5
func (c *Panel) SetCursor(cur *Cursor)
SetCursor sets the mouse cursor shown over the control, nil goes back to the default. Labels, panels and paint boxes pass mouse input through to their parent, setting a cursor or a mouse handler makes them keep it.
func (*Panel) SetEnabled ¶
func (c *Panel) SetEnabled(e bool)
func (*Panel) SetHorizontalAnchor ¶
func (c *Panel) SetHorizontalAnchor(a Anchor)
func (*Panel) SetInnerBounds ¶
func (*Panel) SetInnerHeight ¶
func (*Panel) SetInnerPosition ¶
func (*Panel) SetInnerSize ¶
func (*Panel) SetInnerWidth ¶
func (*Panel) SetOnBlur ¶ added in v0.0.5
func (c *Panel) SetOnBlur(f func())
SetOnBlur sets the function called when the control loses the keyboard focus.
func (*Panel) SetOnChar ¶ added in v0.0.5
func (c *Panel) SetOnChar(f func(r rune))
SetOnChar sets the function called for typed characters.
func (*Panel) SetOnDoubleClick ¶ added in v0.0.5
func (c *Panel) SetOnDoubleClick(f func(x, y int, button MouseButton))
SetOnDoubleClick sets the function called on a mouse double click.
func (*Panel) SetOnDropFiles ¶ added in v0.0.3
func (c *Panel) SetOnDropFiles(f DropFilesFunc)
SetOnDropFiles makes the control a drop target for files dragged from the file explorer.
func (*Panel) SetOnFocus ¶ added in v0.0.5
func (c *Panel) SetOnFocus(f func())
SetOnFocus sets the function called when the control gets the keyboard focus.
func (*Panel) SetOnKeyDown ¶ added in v0.0.5
func (c *Panel) SetOnKeyDown(f func(key int))
SetOnKeyDown sets the function called when a key goes down while the control has the focus. The key is a virtual key code, see the Key... values.
func (*Panel) SetOnKeyUp ¶ added in v0.0.5
func (c *Panel) SetOnKeyUp(f func(key int))
SetOnKeyUp sets the function called when a key is released.
func (*Panel) SetOnMouseDown ¶ added in v0.0.5
func (c *Panel) SetOnMouseDown(f func(x, y int, button MouseButton))
SetOnMouseDown sets the function called when a mouse button goes down over the control. x and y are relative to the control.
func (*Panel) SetOnMouseEnter ¶ added in v0.0.5
func (c *Panel) SetOnMouseEnter(f func())
SetOnMouseEnter sets the function called when the mouse enters the control.
func (*Panel) SetOnMouseLeave ¶ added in v0.0.5
func (c *Panel) SetOnMouseLeave(f func())
SetOnMouseLeave sets the function called when the mouse leaves the control.
func (*Panel) SetOnMouseMove ¶ added in v0.0.5
func (c *Panel) SetOnMouseMove(f func(x, y int))
SetOnMouseMove sets the function called when the mouse moves over the control.
func (*Panel) SetOnMouseUp ¶ added in v0.0.5
func (c *Panel) SetOnMouseUp(f func(x, y int, button MouseButton))
SetOnMouseUp sets the function called when a mouse button is released.
func (*Panel) SetOnMouseWheel ¶ added in v0.0.5
SetOnMouseWheel sets the function called when the wheel turns while the control has the focus. A delta of 1 is one notch away from the user.
func (*Panel) SetOnResize ¶
func (c *Panel) SetOnResize(f func())
func (*Panel) SetPosition ¶
func (*Panel) SetTabStop ¶ added in v0.0.5
func (c *Panel) SetTabStop(on bool)
SetTabStop chooses whether the Tab key stops at this control. The default depends on the control type.
func (*Panel) SetTextColor ¶ added in v0.0.3
func (c *Panel) SetTextColor(col Color)
SetTextColor changes the color of the control's text.
func (*Panel) SetToolTip ¶ added in v0.0.2
func (c *Panel) SetToolTip(text string)
SetToolTip sets the hint text shown when the mouse rests over the control. An empty text removes the tool tip. It works for every control.
func (*Panel) SetVerticalAnchor ¶
func (c *Panel) SetVerticalAnchor(a Anchor)
func (*Panel) SetVisible ¶
func (c *Panel) SetVisible(v bool)
func (*Panel) TabStop ¶ added in v0.0.5
func (c *Panel) TabStop() bool
TabStop tells whether the Tab key stops at this control.
func (*Panel) TextColor ¶ added in v0.0.3
func (c *Panel) TextColor() Color
TextColor returns the color set with SetTextColor. If no color was set it returns the system window text color.
func (*Panel) ToolTip ¶ added in v0.0.2
func (c *Panel) ToolTip() string
ToolTip returns the hint text of the control.
func (*Panel) VerticalAnchor ¶
func (c *Panel) VerticalAnchor() Anchor
type PanelBorderStyle ¶
type PanelBorderStyle int
const ( PanelBorderNone PanelBorderStyle = iota PanelBorderSingleLine PanelBorderSunken PanelBorderSunkenThick PanelBorderRaised )
func (PanelBorderStyle) String ¶
func (s PanelBorderStyle) String() string
type Point ¶
type Point struct {
X, Y int32
}
func RegularPolygonPoints ¶ added in v0.0.2
RegularPolygonPoints returns the corners of a regular polygon (3 sides is a triangle, 6 a hexagon, ...). With rotationDegrees 0 the first corner points up. Use the result with Polygon, DrawPolygon or FillPolygonOutline.
type PopupMenu ¶ added in v0.0.2
type PopupMenu struct {
// contains filtered or unexported fields
}
func NewPopupMenu ¶ added in v0.0.2
func NewPopupMenu() *PopupMenu
NewPopupMenu creates a context menu. Fill it with the same items as normal menus: NewMenuString, NewMenuSeparator and sub-menus created with NewMenu.
Show it with PopupMenu.Show or attach it to a window with Window.SetContextMenu or to any control with SetContextMenu, then it opens on right click.
func (*PopupMenu) Show ¶ added in v0.0.2
Show opens the menu at a position in the client coordinates of the window.
func (*PopupMenu) ShowAtCursor ¶ added in v0.0.2
ShowAtCursor opens the menu at the current mouse position.
func (*PopupMenu) ShowAtScreen ¶ added in v0.0.2
ShowAtScreen opens the menu at the given screen position and runs the OnClick function of the chosen item. It returns after the menu is closed.
type ProgressBar ¶
type ProgressBar struct {
// contains filtered or unexported fields
}
func NewProgressBar ¶
func NewProgressBar() *ProgressBar
func (*ProgressBar) BackgroundColor ¶ added in v0.0.3
func (c *ProgressBar) BackgroundColor() Color
BackgroundColor returns the color set with SetBackgroundColor. If no color was set it returns the system button face color.
func (*ProgressBar) ContextMenu ¶ added in v0.0.2
func (c *ProgressBar) ContextMenu() *PopupMenu
func (*ProgressBar) Focus ¶ added in v0.0.5
func (c *ProgressBar) Focus()
Focus gives the control the keyboard focus. It does nothing before the window is shown.
func (*ProgressBar) HasBackgroundColor ¶ added in v0.0.3
func (c *ProgressBar) HasBackgroundColor() bool
HasBackgroundColor returns true if SetBackgroundColor was called.
func (*ProgressBar) HasFocus ¶ added in v0.0.5
func (c *ProgressBar) HasFocus() bool
HasFocus tells whether the control has the keyboard focus.
func (*ProgressBar) HasTextColor ¶ added in v0.0.3
func (c *ProgressBar) HasTextColor() bool
HasTextColor returns true if SetTextColor was called.
func (*ProgressBar) HorizontalAnchor ¶
func (c *ProgressBar) HorizontalAnchor() Anchor
func (*ProgressBar) MovesForever ¶
func (p *ProgressBar) MovesForever() bool
func (*ProgressBar) OnDropFiles ¶ added in v0.0.3
func (c *ProgressBar) OnDropFiles() DropFilesFunc
OnDropFiles returns the handler set with SetOnDropFiles.
func (*ProgressBar) ResetBackgroundColor ¶ added in v0.0.3
func (c *ProgressBar) ResetBackgroundColor()
ResetBackgroundColor goes back to the default background.
func (*ProgressBar) ResetTextColor ¶ added in v0.0.3
func (c *ProgressBar) ResetTextColor()
ResetTextColor goes back to the system text color.
func (*ProgressBar) SetAnchors ¶
func (c *ProgressBar) SetAnchors(horizontal, vertical Anchor)
func (*ProgressBar) SetBackgroundColor ¶ added in v0.0.3
func (c *ProgressBar) SetBackgroundColor(col Color)
SetBackgroundColor changes the color behind the control's text (or the fill color of a Panel).
func (*ProgressBar) SetContextMenu ¶ added in v0.0.2
func (c *ProgressBar) SetContextMenu(m *PopupMenu)
SetContextMenu sets the menu that opens when the user right-clicks the control. Not all native controls (e.g. edit boxes) forward right clicks.
func (*ProgressBar) SetCursor ¶ added in v0.0.5
func (c *ProgressBar) SetCursor(cur *Cursor)
SetCursor sets the mouse cursor shown over the control, nil goes back to the default. Labels, panels and paint boxes pass mouse input through to their parent, setting a cursor or a mouse handler makes them keep it.
func (*ProgressBar) SetEnabled ¶
func (c *ProgressBar) SetEnabled(e bool)
func (*ProgressBar) SetHorizontalAnchor ¶
func (c *ProgressBar) SetHorizontalAnchor(a Anchor)
func (*ProgressBar) SetMovesForever ¶
func (p *ProgressBar) SetMovesForever(move bool)
func (*ProgressBar) SetOnBlur ¶ added in v0.0.5
func (c *ProgressBar) SetOnBlur(f func())
SetOnBlur sets the function called when the control loses the keyboard focus.
func (*ProgressBar) SetOnChar ¶ added in v0.0.5
func (c *ProgressBar) SetOnChar(f func(r rune))
SetOnChar sets the function called for typed characters.
func (*ProgressBar) SetOnDoubleClick ¶ added in v0.0.5
func (c *ProgressBar) SetOnDoubleClick(f func(x, y int, button MouseButton))
SetOnDoubleClick sets the function called on a mouse double click.
func (*ProgressBar) SetOnDropFiles ¶ added in v0.0.3
func (c *ProgressBar) SetOnDropFiles(f DropFilesFunc)
SetOnDropFiles makes the control a drop target for files dragged from the file explorer.
func (*ProgressBar) SetOnFocus ¶ added in v0.0.5
func (c *ProgressBar) SetOnFocus(f func())
SetOnFocus sets the function called when the control gets the keyboard focus.
func (*ProgressBar) SetOnKeyDown ¶ added in v0.0.5
func (c *ProgressBar) SetOnKeyDown(f func(key int))
SetOnKeyDown sets the function called when a key goes down while the control has the focus. The key is a virtual key code, see the Key... values.
func (*ProgressBar) SetOnKeyUp ¶ added in v0.0.5
func (c *ProgressBar) SetOnKeyUp(f func(key int))
SetOnKeyUp sets the function called when a key is released.
func (*ProgressBar) SetOnMouseDown ¶ added in v0.0.5
func (c *ProgressBar) SetOnMouseDown(f func(x, y int, button MouseButton))
SetOnMouseDown sets the function called when a mouse button goes down over the control. x and y are relative to the control.
func (*ProgressBar) SetOnMouseEnter ¶ added in v0.0.5
func (c *ProgressBar) SetOnMouseEnter(f func())
SetOnMouseEnter sets the function called when the mouse enters the control.
func (*ProgressBar) SetOnMouseLeave ¶ added in v0.0.5
func (c *ProgressBar) SetOnMouseLeave(f func())
SetOnMouseLeave sets the function called when the mouse leaves the control.
func (*ProgressBar) SetOnMouseMove ¶ added in v0.0.5
func (c *ProgressBar) SetOnMouseMove(f func(x, y int))
SetOnMouseMove sets the function called when the mouse moves over the control.
func (*ProgressBar) SetOnMouseUp ¶ added in v0.0.5
func (c *ProgressBar) SetOnMouseUp(f func(x, y int, button MouseButton))
SetOnMouseUp sets the function called when a mouse button is released.
func (*ProgressBar) SetOnMouseWheel ¶ added in v0.0.5
SetOnMouseWheel sets the function called when the wheel turns while the control has the focus. A delta of 1 is one notch away from the user.
func (*ProgressBar) SetOnResize ¶
func (c *ProgressBar) SetOnResize(f func())
func (*ProgressBar) SetPosition ¶
func (c *ProgressBar) SetPosition(x, y int)
func (*ProgressBar) SetState ¶ added in v0.0.5
func (p *ProgressBar) SetState(s ProgressState)
SetState turns the bar red (error) or yellow (paused), or back to green.
func (*ProgressBar) SetTabStop ¶ added in v0.0.5
func (c *ProgressBar) SetTabStop(on bool)
SetTabStop chooses whether the Tab key stops at this control. The default depends on the control type.
func (*ProgressBar) SetTextColor ¶ added in v0.0.3
func (c *ProgressBar) SetTextColor(col Color)
SetTextColor changes the color of the control's text.
func (*ProgressBar) SetToolTip ¶ added in v0.0.2
func (c *ProgressBar) SetToolTip(text string)
SetToolTip sets the hint text shown when the mouse rests over the control. An empty text removes the tool tip. It works for every control.
func (*ProgressBar) SetValue ¶
func (p *ProgressBar) SetValue(v float64)
func (*ProgressBar) SetVertical ¶
func (p *ProgressBar) SetVertical(v bool)
func (*ProgressBar) SetVerticalAnchor ¶
func (c *ProgressBar) SetVerticalAnchor(a Anchor)
func (*ProgressBar) SetVisible ¶
func (c *ProgressBar) SetVisible(v bool)
func (*ProgressBar) State ¶ added in v0.0.5
func (p *ProgressBar) State() ProgressState
State returns the color state.
func (*ProgressBar) TabStop ¶ added in v0.0.5
func (c *ProgressBar) TabStop() bool
TabStop tells whether the Tab key stops at this control.
func (*ProgressBar) TextColor ¶ added in v0.0.3
func (c *ProgressBar) TextColor() Color
TextColor returns the color set with SetTextColor. If no color was set it returns the system window text color.
func (*ProgressBar) ToolTip ¶ added in v0.0.2
func (c *ProgressBar) ToolTip() string
ToolTip returns the hint text of the control.
func (*ProgressBar) Value ¶
func (p *ProgressBar) Value() float64
func (*ProgressBar) Vertical ¶
func (p *ProgressBar) Vertical() bool
func (*ProgressBar) VerticalAnchor ¶
func (c *ProgressBar) VerticalAnchor() Anchor
type ProgressState ¶ added in v0.0.5
type ProgressState int
ProgressState is the color state of a ProgressBar.
const ( // ProgressNormal is the usual green bar. ProgressNormal ProgressState = iota // ProgressError turns the bar red. ProgressError // ProgressPaused turns the bar yellow. ProgressPaused )
type RadioButton ¶
type RadioButton struct {
// contains filtered or unexported fields
}
RadioButton is a control with a circle that is either filled to indicate checked state or unfilled to indicate unchecked state. It has a label next to the circle. Of multiple radio buttons in a container, only one can ever be checked at a time. Also all might be unchecked. Checking one radio button will automatically uncheck all others in the container.
func NewRadioButton ¶
func NewRadioButton() *RadioButton
NewRadioButton returns a new, unchecked RadioButton.
func (*RadioButton) Checked ¶
func (r *RadioButton) Checked() bool
Checked returns true if the radio button is checked and false if not.
func (*RadioButton) OnCheck ¶
func (r *RadioButton) OnCheck() func(checked bool)
OnCheck returns the callback set in SetOnCheck.
func (*RadioButton) OnTabFocus ¶
func (r *RadioButton) OnTabFocus() func()
func (*RadioButton) SetChecked ¶
func (r *RadioButton) SetChecked(checked bool)
SetChecked updates the state of the RadioButton. If checked is true and the button was not checked before, the OnCheck notification is called. Checking a radio button will uncheck all its siblings, i.e. all radio buttons that are in the same parent container.
func (*RadioButton) SetOnCheck ¶
func (r *RadioButton) SetOnCheck(f func(checked bool))
SetOnCheck sets a callback for when the RadioButton is checked. It is not called when the RadioButton is being unchecked.
func (*RadioButton) SetOnTabFocus ¶
func (r *RadioButton) SetOnTabFocus(f func())
func (*RadioButton) SetTextColor ¶ added in v0.0.3
func (r *RadioButton) SetTextColor(col Color)
SetTextColor changes the text color. Visual styles are switched off for this radio button because themed radio buttons ignore the text color.
type RichEdit ¶ added in v0.0.5
type RichEdit struct {
// contains filtered or unexported fields
}
RichEdit is a multi line text editor with formatting: fonts, sizes, bold, italic, underline, colors, paragraph alignment, bullets, clickable web links, undo and redo, and RTF import and export. It also has everything TextEdit has (selection, clipboard, cue...).
Formatting methods named SetSelection... change the selected text, or the text typed next when nothing is selected.
func NewRichEdit ¶ added in v0.0.5
func NewRichEdit() *RichEdit
NewRichEdit creates an empty rich text editor with word wrap and automatic recognition of web addresses.
func (*RichEdit) AppendText ¶ added in v0.0.5
func (c *RichEdit) AppendText(text string)
AppendText adds text at the end and scrolls it into view. It is much faster than SetText(Text()+...) for logs.
func (*RichEdit) CanUndo ¶ added in v0.0.5
func (c *RichEdit) CanUndo() bool
CanUndo tells whether Undo has something to revert.
func (*RichEdit) Copy ¶ added in v0.0.5
func (c *RichEdit) Copy()
Copy copies the selected text to the clipboard.
func (*RichEdit) CursorLine ¶ added in v0.0.5
func (c *RichEdit) CursorLine() int
CursorLine returns the zero based line the cursor is on.
func (*RichEdit) CursorPosition ¶ added in v0.0.5
func (c *RichEdit) CursorPosition() (start, end int)
CursorPosition returns the current cursor position, respectively the current selection.
If no selection is active, the returned start and end values are the same. They then indicate the index of the UTF-8 character in this EditLine's Text() before which the caret is currently set.
If a selection is active, start is the index of the first selected UTF-8 character in Text() and end is the position one character after the end of the selection. The selected text is thus
c.Text()[start:end]
func (*RichEdit) Cut ¶ added in v0.0.5
func (c *RichEdit) Cut()
Cut moves the selected text to the clipboard.
func (*RichEdit) DeleteSelection ¶ added in v0.0.5
func (c *RichEdit) DeleteSelection()
DeleteSelection deletes the selected text without using the clipboard.
func (*RichEdit) LineCount ¶ added in v0.0.5
func (c *RichEdit) LineCount() int
LineCount returns the number of lines of a multi line edit.
func (*RichEdit) OnTabFocus ¶ added in v0.0.5
func (r *RichEdit) OnTabFocus() func()
func (*RichEdit) Paste ¶ added in v0.0.5
func (c *RichEdit) Paste()
Paste inserts the clipboard text at the cursor.
func (*RichEdit) ReplaceSelection ¶ added in v0.0.5
func (c *RichEdit) ReplaceSelection(text string)
ReplaceSelection replaces the selected text, or inserts at the cursor if nothing is selected. The change can be undone.
func (*RichEdit) ScrollToCaret ¶ added in v0.0.5
func (c *RichEdit) ScrollToCaret()
ScrollToCaret scrolls so that the cursor is visible.
func (*RichEdit) SelectedText ¶ added in v0.0.5
SelectedText returns the selected text.
func (*RichEdit) SetAllFont ¶ added in v0.0.5
SetAllFont sets the font family and size in points of the whole text.
func (*RichEdit) SetAutoDetectLinks ¶ added in v0.0.5
SetAutoDetectLinks turns the automatic recognition of web addresses on or off. Recognized addresses are underlined and report clicks to the function set with SetOnLinkClick.
func (*RichEdit) SetBackgroundColor ¶ added in v0.0.5
SetBackgroundColor sets the color behind the text.
func (*RichEdit) SetCueBanner ¶ added in v0.0.5
SetCueBanner sets the grayed hint text shown while an edit is empty, the "placeholder". If showWhenFocused is true it stays visible until the user types. It works for single line edits (EditLine) only.
func (*RichEdit) SetCursorPosition ¶ added in v0.0.5
func (c *RichEdit) SetCursorPosition(pos int)
func (*RichEdit) SetNumbersOnly ¶ added in v0.0.5
func (c *RichEdit) SetNumbersOnly(on bool)
SetNumbersOnly allows only the digits 0 to 9 to be typed. Pasting is not restricted by Windows.
func (*RichEdit) SetOnLinkClick ¶ added in v0.0.5
SetOnLinkClick sets the function called with the address when a link is clicked. Without it clicks are ignored.
func (*RichEdit) SetOnSelectionChange ¶ added in v0.0.5
func (r *RichEdit) SetOnSelectionChange(f func())
SetOnSelectionChange sets the function called when the cursor or selection moved.
func (*RichEdit) SetOnTabFocus ¶ added in v0.0.5
func (r *RichEdit) SetOnTabFocus(f func())
func (*RichEdit) SetOnTextChange ¶ added in v0.0.5
func (r *RichEdit) SetOnTextChange(f func())
SetOnTextChange sets the function called after the text changed.
func (*RichEdit) SetRTF ¶ added in v0.0.5
SetRTF replaces the whole text with RTF formatted text. Characters outside ASCII must be written as \uN escapes as RTF requires.
func (*RichEdit) SetReadOnly ¶ added in v0.0.5
SetReadOnly makes the text unchangeable by the user.
func (*RichEdit) SetSelection ¶ added in v0.0.5
func (c *RichEdit) SetSelection(start, end int)
func (*RichEdit) SetSelectionAlignment ¶ added in v0.0.5
SetSelectionAlignment aligns the paragraphs of the selection.
func (*RichEdit) SetSelectionBackColor ¶ added in v0.0.5
SetSelectionBackColor sets the highlight color behind the selection.
func (*RichEdit) SetSelectionBold ¶ added in v0.0.5
SetSelectionBold makes the selection bold or normal.
func (*RichEdit) SetSelectionBullets ¶ added in v0.0.5
SetSelectionBullets turns bullet points on or off for the selected paragraphs.
func (*RichEdit) SetSelectionColor ¶ added in v0.0.5
SetSelectionColor sets the text color of the selection.
func (*RichEdit) SetSelectionFont ¶ added in v0.0.5
SetSelectionFont sets the font family and the size in points of the selection. An empty name or a size of 0 keeps that part.
func (*RichEdit) SetSelectionItalic ¶ added in v0.0.5
SetSelectionItalic makes the selection italic or upright.
func (*RichEdit) SetSelectionStrikeout ¶ added in v0.0.5
SetSelectionStrikeout strikes the selection through or removes it.
func (*RichEdit) SetSelectionUnderline ¶ added in v0.0.5
SetSelectionUnderline underlines the selection or removes it.
func (*RichEdit) SetTextAlign ¶ added in v0.0.5
func (c *RichEdit) SetTextAlign(a EditAlign)
SetTextAlign aligns the text left, centered or right.
func (*RichEdit) SetWordWrap ¶ added in v0.0.5
SetWordWrap chooses whether long lines wrap (the default) or scroll horizontally.
func (*RichEdit) SetWritesTabs ¶ added in v0.0.5
type ScrollBar ¶ added in v0.0.5
type ScrollBar struct {
// contains filtered or unexported fields
}
ScrollBar is a stand-alone horizontal or vertical scroll bar. The position goes from the minimum to maximum-page+1, where page is the size of the visible part (the thumb). Use it for custom scrolled views; for scrolling a group of controls ScrollPanel does everything itself.
func NewScrollBar ¶ added in v0.0.5
NewScrollBar creates a scroll bar with the range 0 to 100 and a page of 10.
func (*ScrollBar) Anchors ¶ added in v0.0.5
func (c *ScrollBar) Anchors() (horizontal, vertical Anchor)
func (*ScrollBar) BackgroundColor ¶ added in v0.0.5
func (c *ScrollBar) BackgroundColor() Color
BackgroundColor returns the color set with SetBackgroundColor. If no color was set it returns the system button face color.
func (*ScrollBar) ContextMenu ¶ added in v0.0.5
func (c *ScrollBar) ContextMenu() *PopupMenu
func (*ScrollBar) Focus ¶ added in v0.0.5
func (c *ScrollBar) Focus()
Focus gives the control the keyboard focus. It does nothing before the window is shown.
func (*ScrollBar) HasBackgroundColor ¶ added in v0.0.5
func (c *ScrollBar) HasBackgroundColor() bool
HasBackgroundColor returns true if SetBackgroundColor was called.
func (*ScrollBar) HasFocus ¶ added in v0.0.5
func (c *ScrollBar) HasFocus() bool
HasFocus tells whether the control has the keyboard focus.
func (*ScrollBar) HasTextColor ¶ added in v0.0.5
func (c *ScrollBar) HasTextColor() bool
HasTextColor returns true if SetTextColor was called.
func (*ScrollBar) HorizontalAnchor ¶ added in v0.0.5
func (c *ScrollBar) HorizontalAnchor() Anchor
func (*ScrollBar) OnDropFiles ¶ added in v0.0.5
func (c *ScrollBar) OnDropFiles() DropFilesFunc
OnDropFiles returns the handler set with SetOnDropFiles.
func (*ScrollBar) ResetBackgroundColor ¶ added in v0.0.5
func (c *ScrollBar) ResetBackgroundColor()
ResetBackgroundColor goes back to the default background.
func (*ScrollBar) ResetTextColor ¶ added in v0.0.5
func (c *ScrollBar) ResetTextColor()
ResetTextColor goes back to the system text color.
func (*ScrollBar) SetAnchors ¶ added in v0.0.5
func (c *ScrollBar) SetAnchors(horizontal, vertical Anchor)
func (*ScrollBar) SetBackgroundColor ¶ added in v0.0.5
func (c *ScrollBar) SetBackgroundColor(col Color)
SetBackgroundColor changes the color behind the control's text (or the fill color of a Panel).
func (*ScrollBar) SetBounds ¶ added in v0.0.5
func (c *ScrollBar) SetBounds(x, y, width, height int)
func (*ScrollBar) SetContextMenu ¶ added in v0.0.5
func (c *ScrollBar) SetContextMenu(m *PopupMenu)
SetContextMenu sets the menu that opens when the user right-clicks the control. Not all native controls (e.g. edit boxes) forward right clicks.
func (*ScrollBar) SetCursor ¶ added in v0.0.5
func (c *ScrollBar) SetCursor(cur *Cursor)
SetCursor sets the mouse cursor shown over the control, nil goes back to the default. Labels, panels and paint boxes pass mouse input through to their parent, setting a cursor or a mouse handler makes them keep it.
func (*ScrollBar) SetEnabled ¶ added in v0.0.5
func (c *ScrollBar) SetEnabled(e bool)
func (*ScrollBar) SetHorizontalAnchor ¶ added in v0.0.5
func (c *ScrollBar) SetHorizontalAnchor(a Anchor)
func (*ScrollBar) SetLineSize ¶ added in v0.0.5
SetLineSize sets how far the arrow buttons move, 1 by default.
func (*ScrollBar) SetOnBlur ¶ added in v0.0.5
func (c *ScrollBar) SetOnBlur(f func())
SetOnBlur sets the function called when the control loses the keyboard focus.
func (*ScrollBar) SetOnChange ¶ added in v0.0.5
SetOnChange sets the function called with the new position when the user scrolls.
func (*ScrollBar) SetOnChar ¶ added in v0.0.5
func (c *ScrollBar) SetOnChar(f func(r rune))
SetOnChar sets the function called for typed characters.
func (*ScrollBar) SetOnDoubleClick ¶ added in v0.0.5
func (c *ScrollBar) SetOnDoubleClick(f func(x, y int, button MouseButton))
SetOnDoubleClick sets the function called on a mouse double click.
func (*ScrollBar) SetOnDropFiles ¶ added in v0.0.5
func (c *ScrollBar) SetOnDropFiles(f DropFilesFunc)
SetOnDropFiles makes the control a drop target for files dragged from the file explorer.
func (*ScrollBar) SetOnFocus ¶ added in v0.0.5
func (c *ScrollBar) SetOnFocus(f func())
SetOnFocus sets the function called when the control gets the keyboard focus.
func (*ScrollBar) SetOnKeyDown ¶ added in v0.0.5
func (c *ScrollBar) SetOnKeyDown(f func(key int))
SetOnKeyDown sets the function called when a key goes down while the control has the focus. The key is a virtual key code, see the Key... values.
func (*ScrollBar) SetOnKeyUp ¶ added in v0.0.5
func (c *ScrollBar) SetOnKeyUp(f func(key int))
SetOnKeyUp sets the function called when a key is released.
func (*ScrollBar) SetOnMouseDown ¶ added in v0.0.5
func (c *ScrollBar) SetOnMouseDown(f func(x, y int, button MouseButton))
SetOnMouseDown sets the function called when a mouse button goes down over the control. x and y are relative to the control.
func (*ScrollBar) SetOnMouseEnter ¶ added in v0.0.5
func (c *ScrollBar) SetOnMouseEnter(f func())
SetOnMouseEnter sets the function called when the mouse enters the control.
func (*ScrollBar) SetOnMouseLeave ¶ added in v0.0.5
func (c *ScrollBar) SetOnMouseLeave(f func())
SetOnMouseLeave sets the function called when the mouse leaves the control.
func (*ScrollBar) SetOnMouseMove ¶ added in v0.0.5
func (c *ScrollBar) SetOnMouseMove(f func(x, y int))
SetOnMouseMove sets the function called when the mouse moves over the control.
func (*ScrollBar) SetOnMouseUp ¶ added in v0.0.5
func (c *ScrollBar) SetOnMouseUp(f func(x, y int, button MouseButton))
SetOnMouseUp sets the function called when a mouse button is released.
func (*ScrollBar) SetOnMouseWheel ¶ added in v0.0.5
SetOnMouseWheel sets the function called when the wheel turns while the control has the focus. A delta of 1 is one notch away from the user.
func (*ScrollBar) SetOnResize ¶ added in v0.0.5
func (c *ScrollBar) SetOnResize(f func())
func (*ScrollBar) SetPage ¶ added in v0.0.5
SetPage sets the size of the visible part, which is the size of the thumb.
func (*ScrollBar) SetPosition ¶ added in v0.0.5
SetPosition moves the thumb.
func (*ScrollBar) SetRange ¶ added in v0.0.5
SetRange sets the smallest and largest value, including the page.
func (*ScrollBar) SetTabStop ¶ added in v0.0.5
func (c *ScrollBar) SetTabStop(on bool)
SetTabStop chooses whether the Tab key stops at this control. The default depends on the control type.
func (*ScrollBar) SetTextColor ¶ added in v0.0.5
func (c *ScrollBar) SetTextColor(col Color)
SetTextColor changes the color of the control's text.
func (*ScrollBar) SetToolTip ¶ added in v0.0.5
func (c *ScrollBar) SetToolTip(text string)
SetToolTip sets the hint text shown when the mouse rests over the control. An empty text removes the tool tip. It works for every control.
func (*ScrollBar) SetVertical ¶ added in v0.0.5
SetVertical makes the scroll bar vertical instead of horizontal. Call it before the window is shown.
func (*ScrollBar) SetVerticalAnchor ¶ added in v0.0.5
func (c *ScrollBar) SetVerticalAnchor(a Anchor)
func (*ScrollBar) SetVisible ¶ added in v0.0.5
func (c *ScrollBar) SetVisible(v bool)
func (*ScrollBar) TabStop ¶ added in v0.0.5
func (c *ScrollBar) TabStop() bool
TabStop tells whether the Tab key stops at this control.
func (*ScrollBar) TextColor ¶ added in v0.0.5
func (c *ScrollBar) TextColor() Color
TextColor returns the color set with SetTextColor. If no color was set it returns the system window text color.
func (*ScrollBar) ToolTip ¶ added in v0.0.5
func (c *ScrollBar) ToolTip() string
ToolTip returns the hint text of the control.
func (*ScrollBar) VerticalAnchor ¶ added in v0.0.5
func (c *ScrollBar) VerticalAnchor() Anchor
type ScrollPanel ¶ added in v0.0.5
type ScrollPanel struct {
Panel
// contains filtered or unexported fields
}
ScrollPanel is a Panel that shows scroll bars when its children do not fit, like a scrolled window. Add controls at positions in a large virtual area; the panel scrolls them into view. The mouse wheel scrolls it vertically.
While scrolling, the Bounds of the children change because they are moved. ContentPosition tells how far the content is scrolled, adding it to a child's Bounds gives its position in the virtual area.
func NewScrollPanel ¶ added in v0.0.5
func NewScrollPanel() *ScrollPanel
NewScrollPanel creates a scrolling panel whose virtual size follows its children.
func (*ScrollPanel) Add ¶ added in v0.0.5
func (s *ScrollPanel) Add(c Control)
Add adds a control and updates the scroll bars.
func (*ScrollPanel) Anchors ¶ added in v0.0.5
func (c *ScrollPanel) Anchors() (horizontal, vertical Anchor)
func (*ScrollPanel) BackgroundColor ¶ added in v0.0.5
func (c *ScrollPanel) BackgroundColor() Color
BackgroundColor returns the color set with SetBackgroundColor. If no color was set it returns the system button face color.
func (*ScrollPanel) Bounds ¶ added in v0.0.5
func (c *ScrollPanel) Bounds() (x, y, width, height int)
func (*ScrollPanel) ContentPosition ¶ added in v0.0.5
func (s *ScrollPanel) ContentPosition() (x, y int)
ContentPosition returns how far the content is scrolled.
func (*ScrollPanel) ContentSize ¶ added in v0.0.5
func (s *ScrollPanel) ContentSize() (w, h int)
ContentSize returns the size of the virtual area.
func (*ScrollPanel) ContextMenu ¶ added in v0.0.5
func (c *ScrollPanel) ContextMenu() *PopupMenu
func (*ScrollPanel) Focus ¶ added in v0.0.5
func (c *ScrollPanel) Focus()
Focus gives the control the keyboard focus. It does nothing before the window is shown.
func (*ScrollPanel) HasBackgroundColor ¶ added in v0.0.5
func (c *ScrollPanel) HasBackgroundColor() bool
HasBackgroundColor returns true if SetBackgroundColor was called.
func (*ScrollPanel) HasFocus ¶ added in v0.0.5
func (c *ScrollPanel) HasFocus() bool
HasFocus tells whether the control has the keyboard focus.
func (*ScrollPanel) HasTextColor ¶ added in v0.0.5
func (c *ScrollPanel) HasTextColor() bool
HasTextColor returns true if SetTextColor was called.
func (*ScrollPanel) HorizontalAnchor ¶ added in v0.0.5
func (c *ScrollPanel) HorizontalAnchor() Anchor
func (*ScrollPanel) OnDropFiles ¶ added in v0.0.5
func (c *ScrollPanel) OnDropFiles() DropFilesFunc
OnDropFiles returns the handler set with SetOnDropFiles.
func (*ScrollPanel) Remove ¶ added in v0.0.5
func (s *ScrollPanel) Remove(c Control)
Remove removes a control and updates the scroll bars.
func (*ScrollPanel) ResetBackgroundColor ¶ added in v0.0.5
func (c *ScrollPanel) ResetBackgroundColor()
ResetBackgroundColor goes back to the default background.
func (*ScrollPanel) ResetTextColor ¶ added in v0.0.5
func (c *ScrollPanel) ResetTextColor()
ResetTextColor goes back to the system text color.
func (*ScrollPanel) ScrollIntoView ¶ added in v0.0.5
func (s *ScrollPanel) ScrollIntoView(c Control)
ScrollIntoView scrolls the minimum needed to make the child fully visible.
func (*ScrollPanel) ScrollTo ¶ added in v0.0.5
func (s *ScrollPanel) ScrollTo(x, y int)
ScrollTo scrolls so that the point (x, y) of the virtual area is at the top left corner of the panel.
func (*ScrollPanel) SetAnchors ¶ added in v0.0.5
func (c *ScrollPanel) SetAnchors(horizontal, vertical Anchor)
func (*ScrollPanel) SetAutoContentSize ¶ added in v0.0.5
func (s *ScrollPanel) SetAutoContentSize()
SetAutoContentSize makes the virtual area as large as the children need, the default.
func (*ScrollPanel) SetBackgroundColor ¶ added in v0.0.5
func (c *ScrollPanel) SetBackgroundColor(col Color)
SetBackgroundColor changes the color behind the control's text (or the fill color of a Panel).
func (*ScrollPanel) SetBounds ¶ added in v0.0.5
func (s *ScrollPanel) SetBounds(x, y, width, height int)
SetBounds moves or resizes the panel and updates the scroll bars.
func (*ScrollPanel) SetContentSize ¶ added in v0.0.5
func (s *ScrollPanel) SetContentSize(width, height int)
SetContentSize fixes the size of the virtual area instead of following the children.
func (*ScrollPanel) SetContextMenu ¶ added in v0.0.5
func (c *ScrollPanel) SetContextMenu(m *PopupMenu)
SetContextMenu sets the menu that opens when the user right-clicks the control. Not all native controls (e.g. edit boxes) forward right clicks.
func (*ScrollPanel) SetCursor ¶ added in v0.0.5
func (c *ScrollPanel) SetCursor(cur *Cursor)
SetCursor sets the mouse cursor shown over the control, nil goes back to the default. Labels, panels and paint boxes pass mouse input through to their parent, setting a cursor or a mouse handler makes them keep it.
func (*ScrollPanel) SetEnabled ¶ added in v0.0.5
func (c *ScrollPanel) SetEnabled(e bool)
func (*ScrollPanel) SetHorizontalAnchor ¶ added in v0.0.5
func (c *ScrollPanel) SetHorizontalAnchor(a Anchor)
func (*ScrollPanel) SetOnBlur ¶ added in v0.0.5
func (c *ScrollPanel) SetOnBlur(f func())
SetOnBlur sets the function called when the control loses the keyboard focus.
func (*ScrollPanel) SetOnChar ¶ added in v0.0.5
func (c *ScrollPanel) SetOnChar(f func(r rune))
SetOnChar sets the function called for typed characters.
func (*ScrollPanel) SetOnDoubleClick ¶ added in v0.0.5
func (c *ScrollPanel) SetOnDoubleClick(f func(x, y int, button MouseButton))
SetOnDoubleClick sets the function called on a mouse double click.
func (*ScrollPanel) SetOnDropFiles ¶ added in v0.0.5
func (c *ScrollPanel) SetOnDropFiles(f DropFilesFunc)
SetOnDropFiles makes the control a drop target for files dragged from the file explorer.
func (*ScrollPanel) SetOnFocus ¶ added in v0.0.5
func (c *ScrollPanel) SetOnFocus(f func())
SetOnFocus sets the function called when the control gets the keyboard focus.
func (*ScrollPanel) SetOnKeyDown ¶ added in v0.0.5
func (c *ScrollPanel) SetOnKeyDown(f func(key int))
SetOnKeyDown sets the function called when a key goes down while the control has the focus. The key is a virtual key code, see the Key... values.
func (*ScrollPanel) SetOnKeyUp ¶ added in v0.0.5
func (c *ScrollPanel) SetOnKeyUp(f func(key int))
SetOnKeyUp sets the function called when a key is released.
func (*ScrollPanel) SetOnMouseDown ¶ added in v0.0.5
func (c *ScrollPanel) SetOnMouseDown(f func(x, y int, button MouseButton))
SetOnMouseDown sets the function called when a mouse button goes down over the control. x and y are relative to the control.
func (*ScrollPanel) SetOnMouseEnter ¶ added in v0.0.5
func (c *ScrollPanel) SetOnMouseEnter(f func())
SetOnMouseEnter sets the function called when the mouse enters the control.
func (*ScrollPanel) SetOnMouseLeave ¶ added in v0.0.5
func (c *ScrollPanel) SetOnMouseLeave(f func())
SetOnMouseLeave sets the function called when the mouse leaves the control.
func (*ScrollPanel) SetOnMouseMove ¶ added in v0.0.5
func (c *ScrollPanel) SetOnMouseMove(f func(x, y int))
SetOnMouseMove sets the function called when the mouse moves over the control.
func (*ScrollPanel) SetOnMouseUp ¶ added in v0.0.5
func (c *ScrollPanel) SetOnMouseUp(f func(x, y int, button MouseButton))
SetOnMouseUp sets the function called when a mouse button is released.
func (*ScrollPanel) SetOnMouseWheel ¶ added in v0.0.5
SetOnMouseWheel sets the function called when the wheel turns while the control has the focus. A delta of 1 is one notch away from the user.
func (*ScrollPanel) SetOnResize ¶ added in v0.0.5
func (c *ScrollPanel) SetOnResize(f func())
func (*ScrollPanel) SetTabStop ¶ added in v0.0.5
func (c *ScrollPanel) SetTabStop(on bool)
SetTabStop chooses whether the Tab key stops at this control. The default depends on the control type.
func (*ScrollPanel) SetTextColor ¶ added in v0.0.5
func (c *ScrollPanel) SetTextColor(col Color)
SetTextColor changes the color of the control's text.
func (*ScrollPanel) SetToolTip ¶ added in v0.0.5
func (c *ScrollPanel) SetToolTip(text string)
SetToolTip sets the hint text shown when the mouse rests over the control. An empty text removes the tool tip. It works for every control.
func (*ScrollPanel) SetVerticalAnchor ¶ added in v0.0.5
func (c *ScrollPanel) SetVerticalAnchor(a Anchor)
func (*ScrollPanel) SetVisible ¶ added in v0.0.5
func (c *ScrollPanel) SetVisible(v bool)
func (*ScrollPanel) TabStop ¶ added in v0.0.5
func (c *ScrollPanel) TabStop() bool
TabStop tells whether the Tab key stops at this control.
func (*ScrollPanel) TextColor ¶ added in v0.0.5
func (c *ScrollPanel) TextColor() Color
TextColor returns the color set with SetTextColor. If no color was set it returns the system window text color.
func (*ScrollPanel) ToolTip ¶ added in v0.0.5
func (c *ScrollPanel) ToolTip() string
ToolTip returns the hint text of the control.
func (*ScrollPanel) Update ¶ added in v0.0.5
func (s *ScrollPanel) Update()
Update recalculates the scroll bars, call it after you moved or resized children yourself.
func (*ScrollPanel) VerticalAnchor ¶ added in v0.0.5
func (c *ScrollPanel) VerticalAnchor() Anchor
type Slider ¶
type Slider struct {
// contains filtered or unexported fields
}
func (*Slider) ArrowIncrement ¶
func (*Slider) BackgroundColor ¶ added in v0.0.3
func (c *Slider) BackgroundColor() Color
BackgroundColor returns the color set with SetBackgroundColor. If no color was set it returns the system button face color.
func (*Slider) ContextMenu ¶ added in v0.0.2
func (c *Slider) ContextMenu() *PopupMenu
func (*Slider) CursorPosition ¶
CursorPosition returns the current position of the Slider.
func (*Slider) Focus ¶ added in v0.0.5
func (c *Slider) Focus()
Focus gives the control the keyboard focus. It does nothing before the window is shown.
func (*Slider) HasBackgroundColor ¶ added in v0.0.3
func (c *Slider) HasBackgroundColor() bool
HasBackgroundColor returns true if SetBackgroundColor was called.
func (*Slider) HasFocus ¶ added in v0.0.5
func (c *Slider) HasFocus() bool
HasFocus tells whether the control has the keyboard focus.
func (*Slider) HasTextColor ¶ added in v0.0.3
func (c *Slider) HasTextColor() bool
HasTextColor returns true if SetTextColor was called.
func (*Slider) HorizontalAnchor ¶
func (c *Slider) HorizontalAnchor() Anchor
func (*Slider) MouseIncrement ¶
func (*Slider) OnDropFiles ¶ added in v0.0.3
func (c *Slider) OnDropFiles() DropFilesFunc
OnDropFiles returns the handler set with SetOnDropFiles.
func (*Slider) OnTabFocus ¶
func (s *Slider) OnTabFocus() func()
func (*Slider) Orientation ¶
func (s *Slider) Orientation() SliderOrientation
func (*Slider) ResetBackgroundColor ¶ added in v0.0.3
func (c *Slider) ResetBackgroundColor()
ResetBackgroundColor goes back to the default background.
func (*Slider) ResetTextColor ¶ added in v0.0.3
func (c *Slider) ResetTextColor()
ResetTextColor goes back to the system text color.
func (*Slider) SetAnchors ¶
func (c *Slider) SetAnchors(horizontal, vertical Anchor)
func (*Slider) SetArrowIncrement ¶
SetArrowIncrement is for the arrow keys, left/down/right/up.
func (*Slider) SetBackgroundColor ¶ added in v0.0.3
func (c *Slider) SetBackgroundColor(col Color)
SetBackgroundColor changes the color behind the control's text (or the fill color of a Panel).
func (*Slider) SetContextMenu ¶ added in v0.0.2
func (c *Slider) SetContextMenu(m *PopupMenu)
SetContextMenu sets the menu that opens when the user right-clicks the control. Not all native controls (e.g. edit boxes) forward right clicks.
func (*Slider) SetCursor ¶ added in v0.0.5
func (c *Slider) SetCursor(cur *Cursor)
SetCursor sets the mouse cursor shown over the control, nil goes back to the default. Labels, panels and paint boxes pass mouse input through to their parent, setting a cursor or a mouse handler makes them keep it.
func (*Slider) SetCursorPosition ¶
SetCursorPosition sets the position of the cursor. It clamps it to the Slider's min/max values.
func (*Slider) SetEnabled ¶
func (c *Slider) SetEnabled(e bool)
func (*Slider) SetHorizontalAnchor ¶
func (c *Slider) SetHorizontalAnchor(a Anchor)
func (*Slider) SetMinMax ¶
SetMinMax sets the minimum and maximum values of the Slider. min must be smaller or equal to max. If the current cursor is outside these ranges, it is clamped.
func (*Slider) SetMouseIncrement ¶
SetMouseIncrement is for mouse clicks and the page up/down keys.
func (*Slider) SetOnBlur ¶ added in v0.0.5
func (c *Slider) SetOnBlur(f func())
SetOnBlur sets the function called when the control loses the keyboard focus.
func (*Slider) SetOnChange ¶
func (*Slider) SetOnChar ¶ added in v0.0.5
func (c *Slider) SetOnChar(f func(r rune))
SetOnChar sets the function called for typed characters.
func (*Slider) SetOnDoubleClick ¶ added in v0.0.5
func (c *Slider) SetOnDoubleClick(f func(x, y int, button MouseButton))
SetOnDoubleClick sets the function called on a mouse double click.
func (*Slider) SetOnDropFiles ¶ added in v0.0.3
func (c *Slider) SetOnDropFiles(f DropFilesFunc)
SetOnDropFiles makes the control a drop target for files dragged from the file explorer.
func (*Slider) SetOnFocus ¶ added in v0.0.5
func (c *Slider) SetOnFocus(f func())
SetOnFocus sets the function called when the control gets the keyboard focus.
func (*Slider) SetOnKeyDown ¶ added in v0.0.5
func (c *Slider) SetOnKeyDown(f func(key int))
SetOnKeyDown sets the function called when a key goes down while the control has the focus. The key is a virtual key code, see the Key... values.
func (*Slider) SetOnKeyUp ¶ added in v0.0.5
func (c *Slider) SetOnKeyUp(f func(key int))
SetOnKeyUp sets the function called when a key is released.
func (*Slider) SetOnMouseDown ¶ added in v0.0.5
func (c *Slider) SetOnMouseDown(f func(x, y int, button MouseButton))
SetOnMouseDown sets the function called when a mouse button goes down over the control. x and y are relative to the control.
func (*Slider) SetOnMouseEnter ¶ added in v0.0.5
func (c *Slider) SetOnMouseEnter(f func())
SetOnMouseEnter sets the function called when the mouse enters the control.
func (*Slider) SetOnMouseLeave ¶ added in v0.0.5
func (c *Slider) SetOnMouseLeave(f func())
SetOnMouseLeave sets the function called when the mouse leaves the control.
func (*Slider) SetOnMouseMove ¶ added in v0.0.5
func (c *Slider) SetOnMouseMove(f func(x, y int))
SetOnMouseMove sets the function called when the mouse moves over the control.
func (*Slider) SetOnMouseUp ¶ added in v0.0.5
func (c *Slider) SetOnMouseUp(f func(x, y int, button MouseButton))
SetOnMouseUp sets the function called when a mouse button is released.
func (*Slider) SetOnMouseWheel ¶ added in v0.0.5
SetOnMouseWheel sets the function called when the wheel turns while the control has the focus. A delta of 1 is one notch away from the user.
func (*Slider) SetOnResize ¶
func (c *Slider) SetOnResize(f func())
func (*Slider) SetOnTabFocus ¶
func (s *Slider) SetOnTabFocus(f func())
func (*Slider) SetOrientation ¶
func (s *Slider) SetOrientation(o SliderOrientation)
SetOrientation only takes effect before the window is shown on screen. At run-time this cannot be changed.
func (*Slider) SetPosition ¶
func (c *Slider) SetPosition(x, y int)
func (*Slider) SetTabStop ¶ added in v0.0.5
func (c *Slider) SetTabStop(on bool)
SetTabStop chooses whether the Tab key stops at this control. The default depends on the control type.
func (*Slider) SetTextColor ¶ added in v0.0.3
func (c *Slider) SetTextColor(col Color)
SetTextColor changes the color of the control's text.
func (*Slider) SetTickFrequency ¶
SetTickFrequency sets the distance between two ticks to n (only every n'th tick is drawn). The first and last ticks are always drawn (except if you hide ticks altogether).
func (*Slider) SetTickPosition ¶
func (s *Slider) SetTickPosition(p TickPosition)
SetTickPosition only takes effect before the window is shown on screen. At run-time this cannot be changed.
func (*Slider) SetTicksVisible ¶
SetTicksVisible only takes effect before the window is shown on screen. At run-time this cannot be changed.
func (*Slider) SetToolTip ¶ added in v0.0.2
func (c *Slider) SetToolTip(text string)
SetToolTip sets the hint text shown when the mouse rests over the control. An empty text removes the tool tip. It works for every control.
func (*Slider) SetVerticalAnchor ¶
func (c *Slider) SetVerticalAnchor(a Anchor)
func (*Slider) SetVisible ¶
func (c *Slider) SetVisible(v bool)
func (*Slider) TabStop ¶ added in v0.0.5
func (c *Slider) TabStop() bool
TabStop tells whether the Tab key stops at this control.
func (*Slider) TextColor ¶ added in v0.0.3
func (c *Slider) TextColor() Color
TextColor returns the color set with SetTextColor. If no color was set it returns the system window text color.
func (*Slider) TickFrequency ¶
func (*Slider) TickPosition ¶
func (s *Slider) TickPosition() TickPosition
func (*Slider) TicksVisible ¶
func (*Slider) ToolTip ¶ added in v0.0.2
func (c *Slider) ToolTip() string
ToolTip returns the hint text of the control.
func (*Slider) VerticalAnchor ¶
func (c *Slider) VerticalAnchor() Anchor
type SliderOrientation ¶
type SliderOrientation int
const ( HorizontalSlider SliderOrientation = iota VerticalSlider )
func (SliderOrientation) String ¶
func (o SliderOrientation) String() string
type SplitDirection ¶ added in v0.0.5
type SplitDirection int
SplitDirection tells the direction of the splitter bar.
const ( // SplitVertical is a vertical bar, the controls are left and right of it. SplitVertical SplitDirection = iota // SplitHorizontal is a horizontal bar, the controls are above and below. SplitHorizontal )
type Splitter ¶ added in v0.0.5
type Splitter struct {
*PaintBox
// contains filtered or unexported fields
}
Splitter is a draggable divider between two controls. Place it between them; dragging it resizes both.
s := wui.NewSplitter(left, right, wui.SplitVertical) s.SetBounds(200, 0, 6, 300) // a thin bar between left and right
A SplitVertical splitter is a vertical bar that divides a left from a right control, a SplitHorizontal one is a horizontal bar between a top and a bottom control. The two controls must be next to the splitter (in the same container); the splitter itself must be added to that container too.
func NewSplitter ¶ added in v0.0.5
func NewSplitter(first, second Control, dir SplitDirection) *Splitter
NewSplitter creates a splitter for the two controls, first is the left or top one.
func (Splitter) BackgroundColor ¶ added in v0.0.5
func (c Splitter) BackgroundColor() Color
BackgroundColor returns the color set with SetBackgroundColor. If no color was set it returns the system button face color.
func (Splitter) ContextMenu ¶ added in v0.0.5
func (c Splitter) ContextMenu() *PopupMenu
func (Splitter) Focus ¶ added in v0.0.5
func (c Splitter) Focus()
Focus gives the control the keyboard focus. It does nothing before the window is shown.
func (Splitter) HasBackgroundColor ¶ added in v0.0.5
func (c Splitter) HasBackgroundColor() bool
HasBackgroundColor returns true if SetBackgroundColor was called.
func (Splitter) HasFocus ¶ added in v0.0.5
func (c Splitter) HasFocus() bool
HasFocus tells whether the control has the keyboard focus.
func (Splitter) HasTextColor ¶ added in v0.0.5
func (c Splitter) HasTextColor() bool
HasTextColor returns true if SetTextColor was called.
func (Splitter) HorizontalAnchor ¶ added in v0.0.5
func (c Splitter) HorizontalAnchor() Anchor
func (Splitter) OnDropFiles ¶ added in v0.0.5
func (c Splitter) OnDropFiles() DropFilesFunc
OnDropFiles returns the handler set with SetOnDropFiles.
func (Splitter) ResetBackgroundColor ¶ added in v0.0.5
func (c Splitter) ResetBackgroundColor()
ResetBackgroundColor goes back to the default background.
func (Splitter) ResetTextColor ¶ added in v0.0.5
func (c Splitter) ResetTextColor()
ResetTextColor goes back to the system text color.
func (Splitter) SetAnchors ¶ added in v0.0.5
func (c Splitter) SetAnchors(horizontal, vertical Anchor)
func (*Splitter) SetBackColor ¶ added in v0.0.5
SetBackColor sets the color of the bar.
func (Splitter) SetBackgroundColor ¶ added in v0.0.5
func (c Splitter) SetBackgroundColor(col Color)
SetBackgroundColor changes the color behind the control's text (or the fill color of a Panel).
func (Splitter) SetContextMenu ¶ added in v0.0.5
func (c Splitter) SetContextMenu(m *PopupMenu)
SetContextMenu sets the menu that opens when the user right-clicks the control. Not all native controls (e.g. edit boxes) forward right clicks.
func (Splitter) SetCursor ¶ added in v0.0.5
func (c Splitter) SetCursor(cur *Cursor)
SetCursor sets the mouse cursor shown over the control, nil goes back to the default. Labels, panels and paint boxes pass mouse input through to their parent, setting a cursor or a mouse handler makes them keep it.
func (Splitter) SetEnabled ¶ added in v0.0.5
func (c Splitter) SetEnabled(e bool)
func (Splitter) SetHorizontalAnchor ¶ added in v0.0.5
func (c Splitter) SetHorizontalAnchor(a Anchor)
func (*Splitter) SetMinSizes ¶ added in v0.0.5
SetMinSizes sets the smallest sizes (width for a vertical splitter, height for a horizontal one) of the first and second control while dragging. The default is 40 pixels each.
func (Splitter) SetOnBlur ¶ added in v0.0.5
func (c Splitter) SetOnBlur(f func())
SetOnBlur sets the function called when the control loses the keyboard focus.
func (Splitter) SetOnChar ¶ added in v0.0.5
func (c Splitter) SetOnChar(f func(r rune))
SetOnChar sets the function called for typed characters.
func (Splitter) SetOnDropFiles ¶ added in v0.0.5
func (c Splitter) SetOnDropFiles(f DropFilesFunc)
SetOnDropFiles makes the control a drop target for files dragged from the file explorer.
func (Splitter) SetOnFocus ¶ added in v0.0.5
func (c Splitter) SetOnFocus(f func())
SetOnFocus sets the function called when the control gets the keyboard focus.
func (Splitter) SetOnKeyDown ¶ added in v0.0.5
func (c Splitter) SetOnKeyDown(f func(key int))
SetOnKeyDown sets the function called when a key goes down while the control has the focus. The key is a virtual key code, see the Key... values.
func (Splitter) SetOnKeyUp ¶ added in v0.0.5
func (c Splitter) SetOnKeyUp(f func(key int))
SetOnKeyUp sets the function called when a key is released.
func (Splitter) SetOnMouseEnter ¶ added in v0.0.5
func (c Splitter) SetOnMouseEnter(f func())
SetOnMouseEnter sets the function called when the mouse enters the control.
func (Splitter) SetOnMouseLeave ¶ added in v0.0.5
func (c Splitter) SetOnMouseLeave(f func())
SetOnMouseLeave sets the function called when the mouse leaves the control.
func (Splitter) SetOnMouseWheel ¶ added in v0.0.5
SetOnMouseWheel sets the function called when the wheel turns while the control has the focus. A delta of 1 is one notch away from the user.
func (*Splitter) SetOnMove ¶ added in v0.0.5
func (s *Splitter) SetOnMove(f func())
SetOnMove sets the function called after the user moved the bar.
func (Splitter) SetOnResize ¶ added in v0.0.5
func (c Splitter) SetOnResize(f func())
func (Splitter) SetPosition ¶ added in v0.0.5
func (c Splitter) SetPosition(x, y int)
func (Splitter) SetTabStop ¶ added in v0.0.5
func (c Splitter) SetTabStop(on bool)
SetTabStop chooses whether the Tab key stops at this control. The default depends on the control type.
func (Splitter) SetTextColor ¶ added in v0.0.5
func (c Splitter) SetTextColor(col Color)
SetTextColor changes the color of the control's text.
func (Splitter) SetToolTip ¶ added in v0.0.5
func (c Splitter) SetToolTip(text string)
SetToolTip sets the hint text shown when the mouse rests over the control. An empty text removes the tool tip. It works for every control.
func (Splitter) SetVerticalAnchor ¶ added in v0.0.5
func (c Splitter) SetVerticalAnchor(a Anchor)
func (Splitter) SetVisible ¶ added in v0.0.5
func (c Splitter) SetVisible(v bool)
func (Splitter) TabStop ¶ added in v0.0.5
func (c Splitter) TabStop() bool
TabStop tells whether the Tab key stops at this control.
func (Splitter) TextColor ¶ added in v0.0.5
func (c Splitter) TextColor() Color
TextColor returns the color set with SetTextColor. If no color was set it returns the system window text color.
func (Splitter) ToolTip ¶ added in v0.0.5
func (c Splitter) ToolTip() string
ToolTip returns the hint text of the control.
func (Splitter) VerticalAnchor ¶ added in v0.0.5
func (c Splitter) VerticalAnchor() Anchor
type StatusBar ¶ added in v0.0.2
type StatusBar struct {
// contains filtered or unexported fields
}
func NewStatusBar ¶ added in v0.0.2
func NewStatusBar() *StatusBar
NewStatusBar creates a status bar. Place it at the bottom of a window and anchor it with SetAnchors(AnchorMinAndMax, AnchorMax). SetText sets the text of the first part.
func (*StatusBar) SetPartText ¶ added in v0.0.2
SetPartText sets the text of the part with the given index.
type StringList ¶
type StringList struct {
// contains filtered or unexported fields
}
func NewStringList ¶
func NewStringList() *StringList
func (*StringList) AddItem ¶
func (l *StringList) AddItem(s string)
func (*StringList) Clear ¶
func (l *StringList) Clear()
func (*StringList) Items ¶
func (l *StringList) Items() []string
func (*StringList) OnChange ¶
func (l *StringList) OnChange() func(newIndex int)
func (*StringList) SelectedIndex ¶
func (l *StringList) SelectedIndex() int
func (*StringList) SetItems ¶
func (l *StringList) SetItems(items []string)
func (*StringList) SetOnChange ¶
func (l *StringList) SetOnChange(f func(newIndex int))
func (*StringList) SetSelectedIndex ¶
func (l *StringList) SetSelectedIndex(i int)
SetSelectedIndex sets the current index. Set -1 to remove any selection and make the list box empty. If you pass a value < -1 it will be set to -1 instead. The index is not clamped to the number of items, you may set the index 10 where only 5 items are set. This lets you set the index and items at design time without one invalidating the other. At runtime though, SelectedIndex() will return -1 if you set an invalid index.
type StringTable ¶
type StringTable struct {
// contains filtered or unexported fields
}
func NewStringTable ¶
func NewStringTable(header1 string, headers ...string) *StringTable
func (*StringTable) Clear ¶
func (c *StringTable) Clear()
func (*StringTable) ColCount ¶
func (c *StringTable) ColCount() int
func (*StringTable) DeleteRow ¶
func (c *StringTable) DeleteRow(row int)
func (*StringTable) OnSelectionChange ¶
func (c *StringTable) OnSelectionChange() func()
func (*StringTable) OnTabFocus ¶
func (s *StringTable) OnTabFocus() func()
func (*StringTable) RowCount ¶
func (c *StringTable) RowCount() int
func (*StringTable) SelectedRow ¶
func (c *StringTable) SelectedRow() int
func (*StringTable) SetCell ¶
func (c *StringTable) SetCell(col, row int, s string)
func (*StringTable) SetOnSelectionChange ¶
func (c *StringTable) SetOnSelectionChange(f func())
func (*StringTable) SetOnTabFocus ¶
func (s *StringTable) SetOnTabFocus(f func())
type Stroke ¶ added in v0.0.2
Stroke describes how outlines are drawn. The zero value is a solid line of width 1. A Width of 0 or 1 draws the fast default pen.
type TabControl ¶ added in v0.0.2
type TabControl struct {
// contains filtered or unexported fields
}
func NewTabControl ¶ added in v0.0.2
func NewTabControl() *TabControl
NewTabControl creates a row of tabs. It only shows the tab headers; to switch content, use SetOnChange and show/hide Panels. Add the TabControl to its parent before the panels that are displayed in its content area.
func (*TabControl) AddPage ¶ added in v0.0.5
func (t *TabControl) AddPage(title string, page Control, image int)
AddPage appends a tab whose content is the given control, usually a Panel. The TabControl shows only the page of the selected tab, hidden pages are invisible, and it sizes the shown page to the content area whenever the TabControl is resized. The page must be added to the same container as the TabControl, after it. image is an index into the image list or -1.
tabs := wui.NewTabControl()
win.Add(tabs)
general, advanced := wui.NewPanel(), wui.NewPanel()
win.Add(general)
win.Add(advanced)
tabs.AddPage("General", general, -1)
tabs.AddPage("Advanced", advanced, -1)
func (*TabControl) AddTab ¶ added in v0.0.2
func (t *TabControl) AddTab(title string)
AddTab appends a tab with the given title.
func (*TabControl) AddTabWithImage ¶ added in v0.0.5
func (t *TabControl) AddTabWithImage(title string, image int)
AddTabWithImage appends a tab with an icon (an index into the image list from SetImages).
func (*TabControl) ContentBounds ¶ added in v0.0.2
func (t *TabControl) ContentBounds() (x, y, width, height int)
ContentBounds returns the area below the tab headers in the coordinates of the TabControl's parent. Use it to place a Panel for the tab's content.
func (*TabControl) OnChange ¶ added in v0.0.2
func (t *TabControl) OnChange() func(index int)
func (*TabControl) Page ¶ added in v0.0.5
func (t *TabControl) Page(index int) Control
Page returns the content control of a tab or nil.
func (*TabControl) SelectedIndex ¶ added in v0.0.2
func (t *TabControl) SelectedIndex() int
SelectedIndex returns the index of the selected tab or -1 if there are none.
func (*TabControl) SetBounds ¶ added in v0.0.5
func (t *TabControl) SetBounds(x, y, width, height int)
SetBounds moves or resizes the tab control and its selected page.
func (*TabControl) SetImages ¶ added in v0.0.5
func (t *TabControl) SetImages(il *ImageList)
SetImages gives the tab headers icons, see AddTabWithImage.
func (*TabControl) SetOnChange ¶ added in v0.0.2
func (t *TabControl) SetOnChange(f func(index int))
SetOnChange sets the function called when the selected tab changes.
func (*TabControl) SetSelectedIndex ¶ added in v0.0.2
func (t *TabControl) SetSelectedIndex(i int)
SetSelectedIndex selects the tab at the given index and calls the change handler if the selection changed.
func (*TabControl) SetTabs ¶ added in v0.0.2
func (t *TabControl) SetTabs(titles []string)
SetTabs replaces all tabs.
func (*TabControl) Tabs ¶ added in v0.0.2
func (t *TabControl) Tabs() []string
Tabs returns the titles of all tabs.
type TaskButtons ¶ added in v0.0.5
type TaskButtons int
TaskButtons is the set of standard buttons of a task dialog, combine them with |.
const ( TaskOK TaskButtons = 0x01 TaskYes TaskButtons = 0x02 TaskNo TaskButtons = 0x04 TaskCancel TaskButtons = 0x08 TaskRetry TaskButtons = 0x10 TaskClose TaskButtons = 0x20 )
type TaskbarProgressState ¶ added in v0.0.5
type TaskbarProgressState int
TaskbarProgressState is the look of the progress bar on the taskbar button.
const ( TaskbarNoProgress TaskbarProgressState = 0 TaskbarIndeterminate TaskbarProgressState = 1 TaskbarNormal TaskbarProgressState = 2 TaskbarError TaskbarProgressState = 4 TaskbarPaused TaskbarProgressState = 8 )
type TextAlignment ¶
type TextAlignment int
const ( AlignLeft TextAlignment = iota AlignCenter AlignRight )
func (TextAlignment) String ¶
func (a TextAlignment) String() string
type TextEdit ¶
type TextEdit struct {
// contains filtered or unexported fields
}
func NewTextEdit ¶
func NewTextEdit() *TextEdit
func (*TextEdit) AppendText ¶ added in v0.0.5
func (c *TextEdit) AppendText(text string)
AppendText adds text at the end and scrolls it into view. It is much faster than SetText(Text()+...) for logs.
func (*TextEdit) CanUndo ¶ added in v0.0.5
func (c *TextEdit) CanUndo() bool
CanUndo tells whether Undo has something to revert.
func (*TextEdit) CharacterLimit ¶
func (*TextEdit) Copy ¶ added in v0.0.5
func (c *TextEdit) Copy()
Copy copies the selected text to the clipboard.
func (*TextEdit) CursorLine ¶ added in v0.0.5
func (c *TextEdit) CursorLine() int
CursorLine returns the zero based line the cursor is on.
func (*TextEdit) CursorPosition ¶
func (c *TextEdit) CursorPosition() (start, end int)
CursorPosition returns the current cursor position, respectively the current selection.
If no selection is active, the returned start and end values are the same. They then indicate the index of the UTF-8 character in this EditLine's Text() before which the caret is currently set.
If a selection is active, start is the index of the first selected UTF-8 character in Text() and end is the position one character after the end of the selection. The selected text is thus
c.Text()[start:end]
func (*TextEdit) Cut ¶ added in v0.0.5
func (c *TextEdit) Cut()
Cut moves the selected text to the clipboard.
func (*TextEdit) DeleteSelection ¶ added in v0.0.5
func (c *TextEdit) DeleteSelection()
DeleteSelection deletes the selected text without using the clipboard.
func (*TextEdit) LineCount ¶ added in v0.0.5
func (c *TextEdit) LineCount() int
LineCount returns the number of lines of a multi line edit.
func (*TextEdit) OnTabFocus ¶
func (e *TextEdit) OnTabFocus() func()
func (*TextEdit) OnTextChange ¶
func (e *TextEdit) OnTextChange() func()
func (*TextEdit) Paste ¶ added in v0.0.5
func (c *TextEdit) Paste()
Paste inserts the clipboard text at the cursor.
func (*TextEdit) ReplaceSelection ¶ added in v0.0.5
func (c *TextEdit) ReplaceSelection(text string)
ReplaceSelection replaces the selected text, or inserts at the cursor if nothing is selected. The change can be undone.
func (*TextEdit) ScrollToCaret ¶ added in v0.0.5
func (c *TextEdit) ScrollToCaret()
ScrollToCaret scrolls so that the cursor is visible.
func (*TextEdit) SelectedText ¶ added in v0.0.5
func (c *TextEdit) SelectedText() string
SelectedText returns the selected text, empty if nothing is selected.
func (*TextEdit) SetCharacterLimit ¶
func (*TextEdit) SetCueBanner ¶ added in v0.0.5
SetCueBanner sets the grayed hint text shown while an edit is empty, the "placeholder". If showWhenFocused is true it stays visible until the user types. It works for single line edits (EditLine) only.
func (*TextEdit) SetCursorPosition ¶
func (c *TextEdit) SetCursorPosition(pos int)
func (*TextEdit) SetNumbersOnly ¶ added in v0.0.5
func (c *TextEdit) SetNumbersOnly(on bool)
SetNumbersOnly allows only the digits 0 to 9 to be typed. Pasting is not restricted by Windows.
func (*TextEdit) SetOnTabFocus ¶
func (e *TextEdit) SetOnTabFocus(f func())
func (*TextEdit) SetOnTextChange ¶
func (e *TextEdit) SetOnTextChange(f func())
func (*TextEdit) SetReadOnly ¶
func (*TextEdit) SetSelection ¶
func (c *TextEdit) SetSelection(start, end int)
func (*TextEdit) SetTextAlign ¶ added in v0.0.5
func (c *TextEdit) SetTextAlign(a EditAlign)
SetTextAlign aligns the text left, centered or right.
func (*TextEdit) SetWordWrap ¶
func (*TextEdit) SetWritesTabs ¶
func (*TextEdit) Undo ¶ added in v0.0.5
func (c *TextEdit) Undo() bool
Undo reverts the last change and returns false if there was nothing to undo.
func (*TextEdit) WritesTabs ¶
type TickPosition ¶
type TickPosition int
const ( TicksBottomOrRight TickPosition = iota TicksTopOrLeft TicksOnBothSides )
func (TickPosition) String ¶
func (p TickPosition) String() string
type Timer ¶ added in v0.0.2
type Timer struct {
// contains filtered or unexported fields
}
Timer calls a function periodically on the GUI thread. Create one with Window.AddTimer. Timers can be created before the window is shown.
func (*Timer) SetInterval ¶ added in v0.0.2
SetInterval changes the interval in milliseconds.
type ToolBar ¶ added in v0.0.2
type ToolBar struct {
// contains filtered or unexported fields
}
func NewToolBar ¶ added in v0.0.2
NewToolBar creates a horizontal row of buttons inside a window or panel. It is a layout helper: every button is a normal Button placed next to the previous one.
tb := wui.NewToolBar(window, 0, 0, 28)
tb.AddButton("New", 60, func() { ... })
tb.AddSeparator()
tb.AddButton("Open", 60, func() { ... })
func (*ToolBar) AddButton ¶ added in v0.0.2
AddButton appends a button with the given text and width.
func (*ToolBar) AddSeparator ¶ added in v0.0.2
func (t *ToolBar) AddSeparator()
AddSeparator leaves a gap between button groups.
type TrayIcon ¶ added in v0.0.3
type TrayIcon struct {
// contains filtered or unexported fields
}
TrayIcon is an icon in the system tray (notification area). Create it with NewTrayIcon and attach it to a window with Window.SetTrayIcon. It is shown as soon as the window is shown.
tray := wui.NewTrayIcon()
tray.SetToolTip("My App")
menu := wui.NewPopupMenu()
menu.Add(quit)
tray.SetMenu(menu)
window.SetTrayIcon(tray)
func NewTrayIcon ¶ added in v0.0.3
func NewTrayIcon() *TrayIcon
NewTrayIcon creates a tray icon that uses the window's icon. By default a left click restores the window if it was hidden in the tray.
func (*TrayIcon) SetIcon ¶ added in v0.0.3
SetIcon sets the tray icon image. By default the icon of the window is used.
func (*TrayIcon) SetOnBalloonClick ¶ added in v0.0.3
func (t *TrayIcon) SetOnBalloonClick(f func())
SetOnBalloonClick sets the function that is called when the user clicks a balloon notification.
func (*TrayIcon) SetOnClick ¶ added in v0.0.3
func (t *TrayIcon) SetOnClick(f func())
SetOnClick sets the function that is called on a left click.
func (*TrayIcon) SetOnDoubleClick ¶ added in v0.0.3
func (t *TrayIcon) SetOnDoubleClick(f func())
SetOnDoubleClick sets the function that is called on a double click.
func (*TrayIcon) SetOnRightClick ¶ added in v0.0.3
func (t *TrayIcon) SetOnRightClick(f func())
SetOnRightClick sets the function that is called on a right click, before the menu opens.
func (*TrayIcon) SetRestoreOnClick ¶ added in v0.0.3
SetRestoreOnClick controls whether a left click on the icon brings back a window that was hidden with HideToTray, MinimizeToTray or CloseToTray. The default is true.
func (*TrayIcon) SetToolTip ¶ added in v0.0.3
SetToolTip sets the text that appears when hovering over the tray icon (at most 127 characters).
func (*TrayIcon) SetVisible ¶ added in v0.0.3
SetVisible shows or hides the icon in the tray.
func (*TrayIcon) ShowBalloon ¶ added in v0.0.3
func (t *TrayIcon) ShowBalloon(title, text string, kind BalloonKind)
ShowBalloon shows a balloon notification at the tray icon.
type TreeNode ¶ added in v0.0.2
type TreeNode struct {
// Tag can hold any value you want to associate with the node.
Tag interface{}
// contains filtered or unexported fields
}
TreeNode is one entry of a TreeView.
func (*TreeNode) Remove ¶ added in v0.0.2
func (n *TreeNode) Remove()
Remove deletes the node and all its children from the tree.
func (*TreeNode) Select ¶ added in v0.0.2
func (n *TreeNode) Select()
Select makes this node the selected one.
func (*TreeNode) SetChecked ¶ added in v0.0.5
SetChecked ticks or clears the node's check box.
type TreeView ¶ added in v0.0.2
type TreeView struct {
// contains filtered or unexported fields
}
func NewTreeView ¶ added in v0.0.2
func NewTreeView() *TreeView
NewTreeView creates a hierarchical list. Add top level entries with TreeView.Add and children with TreeNode.Add.
func (*TreeView) CollapseAll ¶ added in v0.0.2
func (t *TreeView) CollapseAll()
CollapseAll closes every node.
func (*TreeView) ExpandAll ¶ added in v0.0.2
func (t *TreeView) ExpandAll()
ExpandAll opens every node.
func (*TreeView) OnDoubleClick ¶ added in v0.0.2
func (*TreeView) SetCheckBoxes ¶ added in v0.0.5
SetCheckBoxes shows a check box in front of every node. Call it before the window is shown.
func (*TreeView) SetEditable ¶ added in v0.0.5
SetEditable lets the user rename nodes in place (click a selected node or press F2). Call it before the window is shown.
func (*TreeView) SetImages ¶ added in v0.0.5
SetImages gives the tree icons. Nodes show the image with the index set by TreeNode.SetImage.
func (*TreeView) SetOnCheck ¶ added in v0.0.5
SetOnCheck sets the function called when the user ticks or clears the check box of a node.
func (*TreeView) SetOnCollapse ¶ added in v0.0.5
SetOnCollapse sets the function called after a node was closed.
func (*TreeView) SetOnDoubleClick ¶ added in v0.0.2
SetOnDoubleClick sets the function called when a node is double clicked.
func (*TreeView) SetOnExpand ¶ added in v0.0.5
SetOnExpand sets the function called after a node was opened.
func (*TreeView) SetOnLabelEdit ¶ added in v0.0.5
SetOnLabelEdit sets the function called when the user finished renaming a node. Return false to reject the new text.
func (*TreeView) SetOnSelect ¶ added in v0.0.2
SetOnSelect sets the function called when the selected node changes.
type VisibleControl ¶
type Window ¶
type Window struct {
// contains filtered or unexported fields
}
func (*Window) AcceptFiles ¶ added in v0.0.3
AcceptFiles returns true if the window accepts dropped files.
func (*Window) AddTimer ¶ added in v0.0.2
AddTimer creates and starts a timer that calls f every intervalMs milliseconds while the window is open.
func (*Window) ApplyDarkMode ¶ added in v0.0.5
func (w *Window) ApplyDarkMode(p DarkPalette)
ApplyDarkMode gives the window and all controls in it a dark look: dark title bar, dark control themes, and dark background and light text colors where a control supports them. Call it after the window was created, e.g. in SetOnShow. Not every system control can be darkened completely, the built in check boxes and radio buttons lose their visual style when they get a text color.
func (*Window) BackgroundColor ¶ added in v0.0.3
BackgroundColor returns the window background color.
func (*Window) Center ¶ added in v0.0.2
func (w *Window) Center()
Center moves the window to the center of the screen or, for a modal window, to the center of its parent. It can be called before the window is shown (the window size must be set already) and while it is shown.
func (*Window) CenterOnParent ¶ added in v0.0.2
func (w *Window) CenterOnParent()
CenterOnParent moves a modal window to the center of its parent. If there is no parent, the window is centered on the screen.
func (*Window) CenterOnScreen ¶ added in v0.0.2
func (w *Window) CenterOnScreen()
CenterOnScreen moves the window to the center of the monitor it is on.
func (*Window) CenterOnShow ¶ added in v0.0.2
CenterOnShow returns whether the window centers itself when shown.
func (*Window) CloseToTray ¶ added in v0.0.3
CloseToTray returns true if the close button hides the window in the tray.
func (*Window) ContextMenu ¶ added in v0.0.2
func (*Window) CornerRadius ¶ added in v0.0.3
CornerRadius returns the radius set with SetCornerRadius.
func (*Window) DPI ¶ added in v0.0.5
DPI returns the dots per inch of the monitor the window is on, 96 means 100% scaling. Without DPI awareness it is the system value.
func (*Window) DisableAltF4 ¶
func (w *Window) DisableAltF4()
func (*Window) DragByBackground ¶ added in v0.0.3
DragByBackground returns true if the window can be moved by its background.
func (*Window) EnableAltF4 ¶
func (w *Window) EnableAltF4()
func (*Window) Flash ¶ added in v0.0.5
Flash makes the taskbar button and the caption of the window blink count times, to get the user's attention. It stops when the window is activated.
func (*Window) Fullscreen ¶ added in v0.0.5
Fullscreen tells whether the window is in full screen mode.
func (*Window) GetBackground ¶
func (*Window) HasCloseButton ¶
func (*Window) HasMaxButton ¶
func (*Window) HasMinButton ¶
func (*Window) Headless ¶ added in v0.0.3
Headless returns true if the window has no title bar and border.
func (*Window) HideConsoleOnStart ¶
func (w *Window) HideConsoleOnStart()
func (*Window) HideToTray ¶ added in v0.0.3
func (w *Window) HideToTray()
HideToTray hides the window completely, including its taskbar button. Bring it back with RestoreFromTray, a left click on the tray icon does that by default.
func (*Window) InnerBounds ¶
func (*Window) InnerHeight ¶
func (*Window) InnerPosition ¶
func (*Window) InnerWidth ¶
func (*Window) Invoke ¶ added in v0.0.5
func (w *Window) Invoke(f func())
Invoke queues f to run on the window's GUI thread and returns immediately. It is safe to call from any goroutine and is the way to update controls from background work. If the window is not shown yet, f runs as soon as it is. The functions run in the order they were queued.
func (*Window) InvokeSync ¶ added in v0.0.5
func (w *Window) InvokeSync(f func())
InvokeSync runs f on the GUI thread and waits until it is done. When it is called from the GUI thread itself, or when the window does not exist (not shown yet, or already closed), f runs directly so this can never deadlock in those cases.
func (*Window) MinimizeToTray ¶ added in v0.0.3
MinimizeToTray returns true if minimizing hides the window in the tray.
func (*Window) Monitor ¶
Monitor returns the handle to the monitor (HMONITOR) that the window is over. Before the window is shown, Monitor returns 0.
func (*Window) OnCanClose ¶
func (*Window) OnDropFiles ¶ added in v0.0.3
func (w *Window) OnDropFiles() DropFilesFunc
OnDropFiles returns the handler set with SetOnDropFiles.
func (*Window) OnGUIThread ¶ added in v0.0.5
OnGUIThread tells whether the caller runs on the window's GUI thread.
func (*Window) OnMessage ¶
func (w *Window) OnMessage() MessageCallback
func (*Window) OnMouseDown ¶
func (w *Window) OnMouseDown() func(button MouseButton, x, y int)
func (*Window) OnMouseMove ¶
func (*Window) OnMouseUp ¶
func (w *Window) OnMouseUp() func(button MouseButton, x, y int)
func (*Window) OnMouseWheel ¶
func (*Window) Quit ¶ added in v0.0.3
func (w *Window) Quit()
Quit closes the window for real, even if CloseToTray is set.
func (*Window) RegisterHotKey ¶ added in v0.0.5
RegisterHotKey registers a system wide hot key: f runs on the GUI thread whenever the key combination is pressed, even when the window is not in the foreground. The returned id can be given to UnregisterHotKey. When the window is not shown yet, the registration happens at show time and a failure then is silently ignored.
func (*Window) Relayout ¶ added in v0.0.5
func (w *Window) Relayout()
Relayout arranges the children again, call it after adding or removing controls or changing a layout's settings while the window is open.
func (*Window) RestoreFromTray ¶ added in v0.0.3
func (w *Window) RestoreFromTray()
RestoreFromTray shows a window that was hidden with HideToTray and brings it to the front.
func (*Window) Scale ¶ added in v0.0.5
Scale converts a size designed for 96 DPI to pixels on this window's monitor.
func (*Window) ScaleFactor ¶ added in v0.0.5
ScaleFactor returns DPI()/96, e.g. 1.5 for 150% scaling.
func (*Window) SetAcceptFiles ¶ added in v0.0.3
SetAcceptFiles enables or disables drag and drop of files onto the window. It is implied by SetOnDropFiles.
func (*Window) SetBackground ¶
func (*Window) SetBackgroundColor ¶ added in v0.0.3
SetBackgroundColor changes the window background color, it is the same as SetBackground.
func (*Window) SetCancelButton ¶ added in v0.0.5
SetCancelButton makes b the button that is clicked when the user presses Escape. Pass nil to remove it.
func (*Window) SetCenterOnShow ¶ added in v0.0.2
SetCenterOnShow makes the window center itself when it is shown. A window shown with ShowModal is centered over its parent window, any other window is centered on the screen (work area of its monitor).
func (*Window) SetClassName ¶
SetClassName sets the identifier used for registering this window's class using RegisterClass or RegisterClassEx when first creating this window. This can only be done before the window is shown. For a running window this name will not be updated.
func (*Window) SetCloseToTray ¶ added in v0.0.3
SetCloseToTray makes the close button hide the window in the tray instead of closing it. Window.Close (and Quit) still close it for real. It needs a tray icon.
func (*Window) SetContextMenu ¶ added in v0.0.2
SetContextMenu sets the menu that opens when the user right-clicks the window's background. Controls can have their own menu with SetContextMenu.
func (*Window) SetCornerRadius ¶ added in v0.0.3
SetCornerRadius gives the window rounded corners with the given radius in pixels. 0 means square corners. It is most useful for headless windows.
func (*Window) SetDarkTitleBar ¶ added in v0.0.5
SetDarkTitleBar switches the window's title bar between the light and the dark look (Windows 10 1809 and newer, older versions ignore it).
func (*Window) SetDefaultButton ¶ added in v0.0.5
SetDefaultButton makes b the default button: it is drawn with a heavier frame and is clicked when the user presses Enter while no multi line text field, list or other button has the focus. Pass nil to remove it.
func (*Window) SetDragByBackground ¶ added in v0.0.3
SetDragByBackground lets the user move the window by dragging any free area of its background. This is useful for headless windows.
func (*Window) SetFullscreen ¶ added in v0.0.5
SetFullscreen turns full screen mode on or off. In full screen mode the window has no caption and border and covers the whole monitor it is on.
func (*Window) SetHasBorder ¶
func (*Window) SetHasCloseButton ¶
func (*Window) SetHasMaxButton ¶
func (*Window) SetHasMinButton ¶
func (*Window) SetHeadless ¶ added in v0.0.3
SetHeadless removes the title bar and the border of the window (it becomes a borderless popup window). Use SetDragByBackground to still be able to move it and SetResizable to keep or remove the resize edges.
func (*Window) SetInnerBounds ¶
func (*Window) SetInnerHeight ¶
func (*Window) SetInnerPosition ¶
func (*Window) SetInnerSize ¶
func (*Window) SetInnerWidth ¶
func (*Window) SetLayout ¶ added in v0.0.5
SetLayout makes the window arrange its direct children with the layout every time it is resized. Anchors of the children are overridden by it.
func (*Window) SetMaxSize ¶ added in v0.0.3
SetMaxSize sets the biggest outer size the user can resize the window to. 0 means no limit.
func (*Window) SetMinSize ¶ added in v0.0.3
SetMinSize sets the smallest outer size the user can resize the window to. 0 means no limit.
func (*Window) SetMinimizeToTray ¶ added in v0.0.3
SetMinimizeToTray makes the window disappear into the tray (instead of the taskbar) when it is minimized. It needs a tray icon.
func (*Window) SetOnActivate ¶ added in v0.0.5
SetOnActivate sets the function called when the window becomes the active window (true) or stops being it (false).
func (*Window) SetOnCanClose ¶
SetOnCanClose is passed a function that is called when the window is about to be closed, e.g. when the user hits Alt+F4. If f returns true the window is closed, if f returns false, the window stays open.
func (*Window) SetOnClose ¶
func (w *Window) SetOnClose(f func())
func (*Window) SetOnDPIChanged ¶ added in v0.0.5
SetOnDPIChanged sets the function called when the window is moved to a monitor with a different DPI (or the user changes the scaling). The window is already resized to the size Windows suggests. Needs EnableDPIAwareness.
func (*Window) SetOnDropFiles ¶ added in v0.0.3
func (w *Window) SetOnDropFiles(f DropFilesFunc)
SetOnDropFiles makes the window accept files dragged from the file explorer. The handler receives the dropped file paths. Dropping onto a control that has its own handler calls the control's handler instead.
func (*Window) SetOnKeyDown ¶
func (*Window) SetOnKeyUp ¶
func (*Window) SetOnMessage ¶
func (w *Window) SetOnMessage(f MessageCallback)
func (*Window) SetOnMouseDown ¶
func (w *Window) SetOnMouseDown(f func(button MouseButton, x, y int))
func (*Window) SetOnMouseMove ¶
func (*Window) SetOnMouseUp ¶
func (w *Window) SetOnMouseUp(f func(button MouseButton, x, y int))
func (*Window) SetOnMouseWheel ¶
func (*Window) SetOnMove ¶ added in v0.0.5
SetOnMove sets the function called when the window is moved. x and y are the screen position of the window's top left corner.
func (*Window) SetOnResize ¶
func (w *Window) SetOnResize(f func())
func (*Window) SetOnStateChange ¶ added in v0.0.5
func (w *Window) SetOnStateChange(f func(WindowState))
SetOnStateChange sets the function called when the window is maximized, minimized or restored.
func (*Window) SetOwner ¶ added in v0.0.5
SetOwner makes parent the owner of the window: it stays above its owner and is minimized and closed with it. Call it after the window was shown.
func (*Window) SetPosition ¶
func (*Window) SetResizable ¶
func (*Window) SetShortcut ¶
func (*Window) SetShowInTaskbar ¶ added in v0.0.3
SetShowInTaskbar chooses whether the window has a button in the taskbar. A window without taskbar button is a tool window. The default is true.
func (*Window) SetState ¶
func (w *Window) SetState(s WindowState)
func (*Window) SetTabOrder ¶ added in v0.0.5
SetTabOrder sets the order in which the Tab key moves the focus. Controls that are not listed are skipped by Tab. Call it without arguments to go back to the order the controls were added in.
func (*Window) SetTaskbarProgress ¶ added in v0.0.5
func (w *Window) SetTaskbarProgress(state TaskbarProgressState, fraction float64)
SetTaskbarProgress shows progress on the window's taskbar button. fraction goes from 0 to 1 and is ignored for TaskbarNoProgress and TaskbarIndeterminate.
func (*Window) SetTopMost ¶ added in v0.0.3
SetTopMost keeps the window above all non-topmost windows.
func (*Window) SetTransparent ¶ added in v0.0.3
SetTransparent turns on (or off) color key transparency: every pixel of the window that has exactly the TransparentColor is invisible and lets mouse clicks pass through. Set the window background and the backgrounds of panels to that color to get a window with a free-form shape. Combine it with SetHeadless(true) for a window without caption and border. See also SetAlpha for a semi-transparent window.
func (*Window) SetTransparentColor ¶ added in v0.0.3
SetTransparentColor chooses the key color and turns color key transparency on, see SetTransparent.
func (*Window) SetTrayEnabled ¶ added in v0.0.3
SetTrayEnabled adds a default tray icon (using the window icon) or removes the tray icon. Use SetTrayIcon for more control.
func (*Window) SetTrayIcon ¶ added in v0.0.3
SetTrayIcon puts an icon for the window into the system tray. Pass nil to remove it.
func (*Window) SetTrayToolTip ¶ added in v0.0.3
SetTrayToolTip sets the tray icon's hover text and creates the tray icon if the window does not have one yet.
func (*Window) ShowConsoleOnStart ¶
func (w *Window) ShowConsoleOnStart()
func (*Window) ShowInTaskbar ¶ added in v0.0.3
ShowInTaskbar returns true if the window has a taskbar button.
func (*Window) State ¶
func (w *Window) State() WindowState
func (*Window) StopFlashing ¶ added in v0.0.5
func (w *Window) StopFlashing()
StopFlashing stops what Flash started.
func (*Window) TopMost ¶ added in v0.0.3
TopMost returns true if the window stays on top of other windows.
func (*Window) Transparent ¶ added in v0.0.3
Transparent returns true if color key transparency is on.
func (*Window) TransparentColor ¶ added in v0.0.3
TransparentColor returns the key color, magenta by default.
func (*Window) TrayEnabled ¶ added in v0.0.3
TrayEnabled returns true if the window has a tray icon.
func (*Window) TrayToolTip ¶ added in v0.0.3
TrayToolTip returns the tray icon's hover text.
func (*Window) UnregisterHotKey ¶ added in v0.0.5
UnregisterHotKey removes a hot key made with RegisterHotKey.
type WindowState ¶
type WindowState int
const ( WindowNormal WindowState = iota WindowMaximized WindowMinimized )
func (WindowState) String ¶
func (s WindowState) String() string
Source Files
¶
- button.go
- canvas_ext.go
- center.go
- checkbox.go
- clipboard.go
- clipboard_ext.go
- color.go
- color_dialog.go
- colors.go
- combobox.go
- common_controls.go
- control.go
- control_events.go
- controls_ext.go
- cursor.go
- date_picker.go
- dialogs_ext.go
- dpi_theme.go
- dragdrop.go
- edit_line.go
- file_open_dialog.go
- file_save_dialog.go
- float_up_down.go
- folder_select_dialog.go
- font.go
- gdi_ext.go
- group_box.go
- icon.go
- imagelist.go
- imageview.go
- int_up_down.go
- invoke.go
- key.go
- label.go
- layout.go
- listview.go
- menu.go
- message_box.go
- native_toolbar.go
- paintbox.go
- panel.go
- popup_menu.go
- progress_bar.go
- radio_button.go
- richedit.go
- scroll.go
- slider.go
- splitter.go
- status_bar.go
- string_list.go
- string_table.go
- tab_control.go
- tab_ext.go
- text_edit.go
- text_ext.go
- timer.go
- toolbar.go
- tooltip.go
- tray.go
- tree_view.go
- treeview_ext.go
- util.go
- winapi_ext.go
- window.go
- window_defaults.go
- window_ext.go
- window_features.go
Directories
¶
| Path | Synopsis |
|---|---|
|
Package check implements easy to use functions to write your tests in a concise way.
|
Package check implements easy to use functions to write your tests in a concise way. |
|
cmd
|
|
|
designer
command
|
|
|
wmlcheck
command
Command wmlcheck validates WML layout files without opening a window.
|
Command wmlcheck validates WML layout files without opening a window. |
|
examples
|
|
|
buttons_dialogs
command
Special buttons, check boxes, new input controls and dialogs.
|
Special buttons, check boxes, new input controls and dialogs. |
|
canvas_drawing
command
Canvas drawing example: strokes, rounded rectangles, curves, gradients, transparency, polygons, stars and clipping.
|
Canvas drawing example: strokes, rounded rectangles, curves, gradients, transparency, polygons, stars and clipping. |
|
canvas_mouse
command
Canvas mouse example: draw freehand lines with the left mouse button, clear with the right button.
|
Canvas mouse example: draw freehand lines with the left mouse button, clear with the right button. |
|
center_window
command
Center example: the main window centers on the screen, the modal dialog centers over its parent.
|
Center example: the main window centers on the screen, the modal dialog centers over its parent. |
|
clipboard
command
Clipboard example: copy the edit text to the clipboard and paste it back.
|
Clipboard example: copy the edit text to the clipboard and paste it back. |
|
color_dialog
command
ColorDialog example: pick a color and show it in a paint box.
|
ColorDialog example: pick a color and show it in a paint box. |
|
colored_text
command
|
|
|
context_menu
command
Context menu example: right-click the window or the button.
|
Context menu example: right-click the window or the button. |
|
date_picker
command
DatePicker example: a date picker and a time picker.
|
DatePicker example: a date picker and a time picker. |
|
drag_drop
command
|
|
|
group_box
command
GroupBox example: a captioned frame around related controls.
|
GroupBox example: a captioned frame around related controls. |
|
layouts
command
Dock, Grid, HBox and VBox layouts.
|
Dock, Grid, HBox and VBox layouts. |
|
overlay_window
command
|
|
|
scrolling
command
ScrollPanel (scrolls controls), Splitter, ScrollBar and ImageView.
|
ScrollPanel (scrolls controls), Splitter, ScrollBar and ImageView. |
|
showcase
command
Showcase of the controls and features added to wui: native tool bar with icons, ListView, RichEdit, layouts, ScrollPanel, Invoke from a goroutine, default/cancel buttons, task dialog and dark mode.
|
Showcase of the controls and features added to wui: native tool bar with icons, ListView, RichEdit, layouts, ScrollPanel, Invoke from a goroutine, default/cancel buttons, task dialog and dark mode. |
|
status_bar
command
StatusBar example: a multi-part status bar at the bottom of the window.
|
StatusBar example: a multi-part status bar at the bottom of the window. |
|
system_features
command
System features: single instance, global hot key, fullscreen, taskbar progress, flashing, clipboard images and files, and a virtual ListView with 1,000,000 rows.
|
System features: single instance, global hot key, fullscreen, taskbar progress, flashing, clipboard images and files, and a virtual ListView with 1,000,000 rows. |
|
tab_control
command
TabControl example: one Panel per tab, switched in OnChange.
|
TabControl example: one Panel per tab, switched in OnChange. |
|
timer
command
Timer example: a clock updated every second plus a start/stop button.
|
Timer example: a clock updated every second plus a start/stop button. |
|
toolbar
command
ToolBar example: a row of buttons above a text box.
|
ToolBar example: a row of buttons above a text box. |
|
tooltip
command
ToolTip example: hover over the controls.
|
ToolTip example: hover over the controls. |
|
tray
command
|
|
|
tree_tabs
command
TreeView with icons, check boxes and renaming, and a TabControl whose pages show and hide automatically.
|
TreeView with icons, check boxes and renaming, and a TabControl whose pages show and hide automatically. |
|
tree_view
command
TreeView example: a small hierarchy that shows the selected node.
|
TreeView example: a small hierarchy that shows the selected node. |
|
wml_login
command
WML example: the layout is described in XML (login.xml) and loaded at run time.
|
WML example: the layout is described in XML (login.xml) and loaded at run time. |
|
wml_new_controls
command
Loads ui.xml, which uses the controls and properties added to wml.
|
Loads ui.xml, which uses the controls and properties added to wml. |
|
Package wml loads window layouts from XML files at run time, similar to QML or XAML.
|
Package wml loads window layouts from XML files at run time, similar to QML or XAML. |