Documentation ¶
Index ¶
- Constants
- Variables
- func AllWindowsToFront()
- func AttachConsole()
- func AttemptQuit()
- func Beep()
- func CannotRedoTitle() string
- func CannotUndoTitle() string
- func DistillImageSpecFor(filePathOrURL string) string
- func DockableHasFocus(dockable Dockable) bool
- func DoubleClickParameters() (maxDelay time.Duration, maxMouseDrift float32)
- func DragGestureParameters() (minDelay time.Duration, minMouseDrift float32)
- func DrawEllipseBase(canvas *Canvas, rect geom32.Rect, thickness float32, fillInk, strokeInk Ink)
- func DrawLabel(canvas *Canvas, rect geom32.Rect, hAlign, vAlign Alignment, text string, ...)
- func DrawRectBase(canvas *Canvas, rect geom32.Rect, fillInk, strokeInk Ink)
- func DrawRoundedRectBase(canvas *Canvas, rect geom32.Rect, cornerRadius, thickness float32, ...)
- func ErrorDialogWithError(primary string, detail error)
- func ErrorDialogWithMessage(primary, detail string)
- func ErrorDialogWithPanel(msgPanel Paneler)
- func FontFamilies() []string
- func InsertAboutItem(m Menu, atIndex int, aboutHandler func(MenuItem))
- func InsertBringAllToFrontItem(m Menu, atIndex int)
- func InsertCloseFocusedWindowItem(m Menu, atIndex int)
- func InsertMinimizeItem(m Menu, atIndex int)
- func InsertPreferencesItem(m Menu, atIndex int, prefsHandler func(MenuItem))
- func InsertQuitItem(m Menu, atIndex int)
- func InsertStdMenus(m Menu, aboutHandler, prefsHandler func(MenuItem), updater func(Menu))
- func InsertZoomItem(m Menu, atIndex int)
- func InvokeTask(f func())
- func InvokeTaskAfter(f func(), after time.Duration)
- func IsControlAction(keyCode KeyCode, mod Modifiers) bool
- func IsDarkModeEnabled() bool
- func IsDarkModeTrackingPossible() bool
- func LabelSize(text string, font Font, drawable Drawable, drawableSide Side, imgGap float32) geom32.Size
- func MarkDynamicColorsForRebuild()
- func MaxSize(size geom32.Size) geom32.Size
- func QuestionDialog(primary, detail string) int
- func QuestionDialogWithPanel(msgPanel Paneler) int
- func RebuildDynamicColors()
- func ReleaseOnUIThread(f func())
- func RouteActionToFocusEnabledFunc(action *Action, src interface{}) bool
- func RouteActionToFocusExecuteFunc(action *Action, src interface{})
- func SanitizeExtensionList(in []string) []string
- func SetDarkModeTracking(mode DarkModeTracking)
- func Start(options ...StartupOption)
- func ThemeChanged()
- func WarningDialogWithMessage(primary, detail string)
- func WarningDialogWithPanel(msgPanel Paneler)
- func WindowCount() int
- type Action
- type Alignment
- type ArcSize
- type Behavior
- type BlendMode
- type Blur
- type Border
- type Button
- func (b *Button) Click()
- func (b *Button) DefaultDraw(canvas *Canvas, dirty geom32.Rect)
- func (b *Button) DefaultKeyDown(keyCode KeyCode, mod Modifiers, repeat bool) bool
- func (b *Button) DefaultMouseDown(where geom32.Point, button, clickCount int, mod Modifiers) bool
- func (b *Button) DefaultMouseDrag(where geom32.Point, button int, mod Modifiers) bool
- func (b *Button) DefaultMouseEnter(_ geom32.Point, _ Modifiers) bool
- func (b *Button) DefaultMouseExit() bool
- func (b *Button) DefaultMouseUp(where geom32.Point, button int, mod Modifiers) bool
- func (b *Button) DefaultSizes(hint geom32.Size) (min, pref, max geom32.Size)
- func (b *Button) HorizontalMargin() float32
- func (b *Button) VerticalMargin() float32
- type ButtonTheme
- type Canvas
- func (c *Canvas) Clear(color Color)
- func (c *Canvas) ClipBounds() geom32.Rect
- func (c *Canvas) ClipPath(path *Path, op ClipOp, antialias bool)
- func (c *Canvas) ClipRect(rect geom32.Rect, op ClipOp, antialias bool)
- func (c *Canvas) Concat(matrix *geom32.Matrix2D)
- func (c *Canvas) DrawArc(oval geom32.Rect, startAngle, sweepAngle float32, paint *Paint, useCenter bool)
- func (c *Canvas) DrawCircle(cx, cy, radius float32, paint *Paint)
- func (c *Canvas) DrawColor(color Color, mode BlendMode)
- func (c *Canvas) DrawImage(img *Image, x, y float32, sampling *SamplingOptions, paint *Paint)
- func (c *Canvas) DrawImageInRect(img *Image, rect geom32.Rect, sampling *SamplingOptions, paint *Paint)
- func (c *Canvas) DrawImageNine(img *Image, centerRect, dstRect geom32.Rect, filter FilterMode, paint *Paint)
- func (c *Canvas) DrawImageRectInRect(img *Image, srcRect, dstRect geom32.Rect, sampling *SamplingOptions, ...)
- func (c *Canvas) DrawLine(sx, sy, ex, ey float32, paint *Paint)
- func (c *Canvas) DrawOval(rect geom32.Rect, paint *Paint)
- func (c *Canvas) DrawPaint(paint *Paint)
- func (c *Canvas) DrawPath(path *Path, paint *Paint)
- func (c *Canvas) DrawPoint(x, y float32, paint *Paint)
- func (c *Canvas) DrawPoints(pts []geom32.Point, paint *Paint, mode PointMode)
- func (c *Canvas) DrawPolygon(poly poly32.Polygon, mode FillType, paint *Paint)
- func (c *Canvas) DrawRect(rect geom32.Rect, paint *Paint)
- func (c *Canvas) DrawRoundedRect(rect geom32.Rect, radiusX, radiusY float32, paint *Paint)
- func (c *Canvas) DrawSimpleString(str string, x, y float32, font Font, paint *Paint)
- func (c *Canvas) DrawString(str string, x, y float32, font Font, paint *Paint)
- func (c *Canvas) Flush()
- func (c *Canvas) IsClipEmpty() bool
- func (c *Canvas) IsClipRect() bool
- func (c *Canvas) Matrix() *geom32.Matrix2D
- func (c *Canvas) QuickRejectPath(path *Path) bool
- func (c *Canvas) QuickRejectRect(rect geom32.Rect) bool
- func (c *Canvas) ResetMatrix()
- func (c *Canvas) Restore()
- func (c *Canvas) RestoreToCount(count int)
- func (c *Canvas) Rotate(degrees float32)
- func (c *Canvas) Save() int
- func (c *Canvas) SaveCount() int
- func (c *Canvas) SaveLayer(paint *Paint) int
- func (c *Canvas) SaveWithOpacity(opacity float32) int
- func (c *Canvas) Scale(x, y float32)
- func (c *Canvas) SetMatrix(matrix *geom32.Matrix2D)
- func (c *Canvas) Skew(sx, sy float32)
- func (c *Canvas) Translate(dx, dy float32)
- type CellFactory
- type CheckBox
- func (c *CheckBox) Click()
- func (c *CheckBox) DefaultDraw(canvas *Canvas, dirty geom32.Rect)
- func (c *CheckBox) DefaultKeyDown(keyCode KeyCode, mod Modifiers, repeat bool) bool
- func (c *CheckBox) DefaultMouseDown(where geom32.Point, button, clickCount int, mod Modifiers) bool
- func (c *CheckBox) DefaultMouseDrag(where geom32.Point, button int, mod Modifiers) bool
- func (c *CheckBox) DefaultMouseUp(where geom32.Point, button int, mod Modifiers) bool
- func (c *CheckBox) DefaultSizes(hint geom32.Size) (min, pref, max geom32.Size)
- type CheckBoxTheme
- type CheckState
- type ClipOp
- type Clipboard
- type ClipboardData
- type Color
- func ARGB(alpha float32, red, green, blue int) Color
- func ARGBfloat(alpha, red, green, blue float32) Color
- func ColorDecode(buffer string) (Color, error)
- func HSB(hue, saturation, brightness float32) Color
- func HSBA(hue, saturation, brightness, alpha float32) Color
- func MustColorDecode(buffer string) Color
- func RGB(red, green, blue int) Color
- func (c Color) AdjustBrightness(amount float32) Color
- func (c Color) AdjustHue(amount float32) Color
- func (c Color) AdjustSaturation(amount float32) Color
- func (c Color) Alpha() int
- func (c Color) AlphaIntensity() float32
- func (c Color) Blend(other Color, pct float32) Color
- func (c Color) Blue() int
- func (c Color) BlueIntensity() float32
- func (c Color) Brightness() float32
- func (c Color) GetColor() Color
- func (c Color) GoString() string
- func (c Color) Green() int
- func (c Color) GreenIntensity() float32
- func (c Color) HSB() (hue, saturation, brightness float32)
- func (c Color) HasAlpha() bool
- func (c Color) Hue() float32
- func (c Color) Invisible() bool
- func (c Color) Luminance() float32
- func (c Color) MarshalText() ([]byte, error)
- func (c Color) Monochrome() bool
- func (c Color) Opaque() bool
- func (c Color) Paint(_ *Canvas, _ geom32.Rect, style PaintStyle) *Paint
- func (c Color) Premultiply() Color
- func (c Color) RGBA() (r, g, b, a uint32)
- func (c Color) Red() int
- func (c Color) RedIntensity() float32
- func (c Color) Saturation() float32
- func (c Color) SetAlpha(alpha int) Color
- func (c Color) SetAlphaIntensity(alpha float32) Color
- func (c Color) SetBlue(blue int) Color
- func (c Color) SetBlueIntensity(blue float32) Color
- func (c Color) SetBrightness(brightness float32) Color
- func (c Color) SetGreen(green int) Color
- func (c Color) SetGreenIntensity(green float32) Color
- func (c Color) SetHue(hue float32) Color
- func (c Color) SetRed(red int) Color
- func (c Color) SetRedIntensity(red float32) Color
- func (c Color) SetSaturation(saturation float32) Color
- func (c Color) String() string
- func (c *Color) UnmarshalText(text []byte) error
- func (c Color) Unpremultiply() Color
- type ColorChannel
- type ColorFilter
- func Grayscale30PercentFilter() *ColorFilter
- func NewARGBTableColorFilter(a, r, g, b []byte) *ColorFilter
- func NewAlphaFilter(alpha float32) *ColorFilter
- func NewBlendColorFilter(color Color, blendMode BlendMode) *ColorFilter
- func NewComposeColorFilter(outer, inner *ColorFilter) *ColorFilter
- func NewHighContrastColorFilter(contrast float32, style InvertStyle, grayscale bool) *ColorFilter
- func NewLightingColorFilter(mul, add Color) *ColorFilter
- func NewLumaColorFilter() *ColorFilter
- func NewMatrixColorFilter(array []float32) *ColorFilter
- type ColorProvider
- type ColumnSize
- type CompoundBorder
- type CubicResampler
- type Cursor
- type DarkModeTracking
- type DefaultCellFactory
- type DefaultTableColumnHeader
- func (h *DefaultTableColumnHeader) DefaultDraw(canvas *Canvas, dirty geom32.Rect)
- func (h *DefaultTableColumnHeader) DefaultMouseUp(where geom32.Point, button int, mod Modifiers) bool
- func (h *DefaultTableColumnHeader) DefaultSizes(hint geom32.Size) (min, pref, max geom32.Size)
- func (h *DefaultTableColumnHeader) SetSortState(state SortState)
- func (h *DefaultTableColumnHeader) SortState() SortState
- type Dialog
- type DialogButtonInfo
- type DialogTheme
- type Direction
- type Display
- type Dock
- func (d *Dock) DefaultDataDragExit()
- func (d *Dock) DefaultDataDragOver(where geom32.Point, data map[string]interface{}) bool
- func (d *Dock) DefaultDataDrop(where geom32.Point, data map[string]interface{})
- func (d *Dock) DefaultDraw(gc *Canvas, dirty geom32.Rect)
- func (d *Dock) DefaultDrawOver(gc *Canvas, dirty geom32.Rect)
- func (d *Dock) DefaultFocusChangeInHierarchy(from, to *Panel)
- func (d *Dock) DefaultMouseDown(where geom32.Point, button, clickCount int, mod Modifiers) bool
- func (d *Dock) DefaultMouseDrag(where geom32.Point, button int, mod Modifiers) bool
- func (d *Dock) DefaultMouseUp(where geom32.Point, button int, mod Modifiers) bool
- func (d *Dock) DefaultUpdateCursor(where geom32.Point) *Cursor
- func (d *Dock) DockDividerSize() float32
- func (d *Dock) DockGripLength() float32
- func (d *Dock) DockTo(dockable Dockable, target DockLayoutNode, side Side)
- func (d *Dock) Maximize(dc *DockContainer)
- func (d *Dock) NextDockableFor(dockable Dockable) Dockable
- func (d *Dock) PreviousDockableFor(dockable Dockable) Dockable
- func (d *Dock) Restore()
- func (d *Dock) RootDockLayout() *DockLayout
- type DockContainer
- func (d *DockContainer) AcquireFocus()
- func (d *DockContainer) AttemptClose(dockable Dockable)
- func (d *DockContainer) Close(dockable Dockable)
- func (d *DockContainer) CurrentDockable() Dockable
- func (d *DockContainer) CurrentDockableIndex() int
- func (d *DockContainer) Dockables() []Dockable
- func (d *DockContainer) LayoutSizes(target *Panel, hint geom32.Size) (min, pref, max geom32.Size)
- func (d *DockContainer) PerformLayout(target *Panel)
- func (d *DockContainer) PreferredSize() geom32.Size
- func (d *DockContainer) SetCurrentDockable(dockable Dockable)
- func (d *DockContainer) Stack(dockable Dockable, index int)
- func (d *DockContainer) UpdateTitle(dockable Dockable)
- type DockHeaderTheme
- type DockLayout
- func (d *DockLayout) Contains(node DockLayoutNode) bool
- func (d *DockLayout) DividerMaximum() float32
- func (d *DockLayout) DividerPosition() float32
- func (d *DockLayout) DockTo(dc *DockContainer, target DockLayoutNode, side Side)
- func (d *DockLayout) Empty() bool
- func (d *DockLayout) FindLayout(dc *DockContainer) *DockLayout
- func (d *DockLayout) ForEachDockContainer(f func(*DockContainer) bool)
- func (d *DockLayout) FrameRect() geom32.Rect
- func (d *DockLayout) Full() bool
- func (d *DockLayout) LayoutSizes(_ *Panel, _ geom32.Size) (min, pref, max geom32.Size)
- func (d *DockLayout) PerformLayout(_ *Panel)
- func (d *DockLayout) PreferredSize() geom32.Size
- func (d *DockLayout) RawDividerPosition() float32
- func (d *DockLayout) Remove(node DockLayoutNode) bool
- func (d *DockLayout) RootLayout() *DockLayout
- func (d *DockLayout) SetDividerPosition(pos float32)
- func (d *DockLayout) SetFrameRect(r geom32.Rect)
- type DockLayoutNode
- type DockTabTheme
- type DockTheme
- type Dockable
- type DragData
- type Drawable
- type DrawableSVG
- type DynamicColor
- type DynamicFont
- func (f *DynamicFont) Baseline() float32
- func (f *DynamicFont) Descriptor() FontDescriptor
- func (f *DynamicFont) Face() *FontFace
- func (f *DynamicFont) GlyphWidth(glyph uint16) float32
- func (f *DynamicFont) GlyphWidths(glyphs []uint16) []float32
- func (f *DynamicFont) LineHeight() float32
- func (f *DynamicFont) Metrics() FontMetrics
- func (f *DynamicFont) RuneToGlyph(r rune) uint16
- func (f *DynamicFont) RunesToGlyphs(r []rune) []uint16
- func (f *DynamicFont) SimpleWidth(str string) float32
- func (f *DynamicFont) Size() float32
- type EmptyBorder
- type EncodedImageFormat
- type Field
- func (f *Field) CanCopy() bool
- func (f *Field) CanCut() bool
- func (f *Field) CanDelete() bool
- func (f *Field) CanPaste() bool
- func (f *Field) CanSelectAll() bool
- func (f *Field) Copy()
- func (f *Field) Cut()
- func (f *Field) DefaultCanPerformCmd(source interface{}, id int) bool
- func (f *Field) DefaultDraw(canvas *Canvas, dirty geom32.Rect)
- func (f *Field) DefaultFocusGained()
- func (f *Field) DefaultFocusLost()
- func (f *Field) DefaultKeyDown(keyCode KeyCode, mod Modifiers, repeat bool) bool
- func (f *Field) DefaultMouseDown(where geom32.Point, button, clickCount int, mod Modifiers) bool
- func (f *Field) DefaultMouseDrag(where geom32.Point, button int, mod Modifiers) bool
- func (f *Field) DefaultPerformCmd(source interface{}, id int)
- func (f *Field) DefaultRuneTyped(ch rune) bool
- func (f *Field) DefaultSizes(hint geom32.Size) (min, pref, max geom32.Size)
- func (f *Field) DefaultUpdateCursor(where geom32.Point) *Cursor
- func (f *Field) Delete()
- func (f *Field) FromSelectionIndex(index int) geom32.Point
- func (f *Field) HasSelectionRange() bool
- func (f *Field) Invalid() bool
- func (f *Field) Paste()
- func (f *Field) RunesIfPasted(input []rune) []rune
- func (f *Field) ScrollOffset() float32
- func (f *Field) SelectAll()
- func (f *Field) SelectedText() string
- func (f *Field) Selection() (start, end int)
- func (f *Field) SelectionCount() int
- func (f *Field) SetScrollOffset(offset float32)
- func (f *Field) SetSelection(start, end int)
- func (f *Field) SetSelectionTo(pos int)
- func (f *Field) SetSelectionToEnd()
- func (f *Field) SetSelectionToStart()
- func (f *Field) SetText(text string)
- func (f *Field) Text() string
- func (f *Field) ToSelectionIndex(x float32) int
- func (f *Field) Validate()
- type FieldTheme
- type FillType
- type FilterMode
- type FilterQuality
- type FlexLayout
- type FlexLayoutData
- type FlowLayout
- type Font
- type FontDescriptor
- type FontFace
- func (f *FontFace) FallbackForCharacter(ch rune) *FontFace
- func (f *FontFace) Family() string
- func (f *FontFace) Font(capHeightSizeInLogicalPixels float32) Font
- func (f *FontFace) Less(other *FontFace) bool
- func (f *FontFace) Monospaced() bool
- func (f *FontFace) Style() (weight FontWeight, spacing FontSpacing, slant FontSlant)
- func (f *FontFace) UnitsPerEm() int
- type FontFamily
- func (f *FontFamily) Count() int
- func (f *FontFamily) Face(index int) *FontFace
- func (f *FontFamily) MatchStyle(weight FontWeight, spacing FontSpacing, slant FontSlant) *FontFace
- func (f *FontFamily) String() string
- func (f *FontFamily) Style(index int) (description string, weight FontWeight, spacing FontSpacing, slant FontSlant)
- type FontHinting
- type FontMetrics
- type FontSlant
- type FontSpacing
- type FontWeight
- type Gradient
- type Group
- type GroupPanel
- type Image
- func MoveCursorImage() *Image
- func NewImageFromBytes(buffer []byte, scale float32) (*Image, error)
- func NewImageFromFilePathOrURL(filePathOrURL string, scale float32) (*Image, error)
- func NewImageFromPixels(width, height int, pixels []byte, scale float32) (*Image, error)
- func ResizeHorizontalCursorImage() *Image
- func ResizeLeftDiagonalCursorImage() *Image
- func ResizeRightDiagonalCursorImage() *Image
- func ResizeVerticalCursorImage() *Image
- func (img *Image) DrawInRect(canvas *Canvas, rect geom32.Rect, sampling *SamplingOptions, paint *Paint)
- func (img *Image) LogicalSize() geom32.Size
- func (img *Image) Scale() float32
- func (img *Image) Size() geom32.Size
- func (img *Image) ToJPEG(quality int) ([]byte, error)
- func (img *Image) ToNRGBA() (*image.NRGBA, error)
- func (img *Image) ToPNG() ([]byte, error)
- func (img *Image) ToWebp(quality int) ([]byte, error)
- type ImageFilter
- func NewArithmeticImageFilter(k1, k2, k3, k4 float32, background, foreground *ImageFilter, ...) *ImageFilter
- func NewBlurImageFilter(sigmaX, sigmaY float32, tileMode TileMode, input *ImageFilter, ...) *ImageFilter
- func NewColorImageFilter(colorFilter *ColorFilter, input *ImageFilter, cropRect *geom32.Rect) *ImageFilter
- func NewComposeImageFilter(outer, inner *ImageFilter) *ImageFilter
- func NewDilateImageFilter(radiusX, radiusY int, input *ImageFilter, cropRect *geom32.Rect) *ImageFilter
- func NewDisplacementImageFilter(xChannelSelector, yChannelSelector ColorChannel, scale float32, ...) *ImageFilter
- func NewDistantLitDiffuseImageFilter(x, y, z, scale, reflectivity float32, color Color, input *ImageFilter, ...) *ImageFilter
- func NewDistantLitSpecularImageFilter(x, y, z, scale, reflectivity, shine float32, color Color, input *ImageFilter, ...) *ImageFilter
- func NewDropShadowImageFilter(dx, dy, sigmaX, sigmaY float32, color Color, input *ImageFilter, ...) *ImageFilter
- func NewDropShadowOnlyImageFilter(dx, dy, sigmaX, sigmaY float32, color Color, input *ImageFilter, ...) *ImageFilter
- func NewErodeImageFilter(radiusX, radiusY int, input *ImageFilter, cropRect *geom32.Rect) *ImageFilter
- func NewImageSourceDefaultImageFilter(canvas *Canvas, img *Image) *ImageFilter
- func NewImageSourceImageFilter(canvas *Canvas, img *Image, srcRect, dstRect geom32.Rect, ...) *ImageFilter
- func NewMagnifierImageFilter(src geom32.Rect, inset float32, input *ImageFilter, cropRect *geom32.Rect) *ImageFilter
- func NewMatrixConvolutionImageFilter(width, height int, kernel []float32, gain, bias float32, offsetX, offsetY int, ...) *ImageFilter
- func NewMatrixTransformImageFilter(matrix *geom32.Matrix2D, sampling *SamplingOptions, input *ImageFilter) *ImageFilter
- func NewMergeImageFilter(filters []*ImageFilter, cropRect *geom32.Rect) *ImageFilter
- func NewOffsetImageFilter(dx, dy float32, input *ImageFilter, cropRect *geom32.Rect) *ImageFilter
- func NewPointLitDiffuseImageFilter(x, y, z, scale, reflectivity float32, color Color, input *ImageFilter, ...) *ImageFilter
- func NewPointLitSpecularImageFilter(x, y, z, scale, reflectivity, shine float32, color Color, input *ImageFilter, ...) *ImageFilter
- func NewSpotLitDiffuseImageFilter(...) *ImageFilter
- func NewSpotLitSpecularImageFilter(...) *ImageFilter
- func NewTileImageFilter(src, dst geom32.Rect, input *ImageFilter) *ImageFilter
- type IndirectFont
- func (f *IndirectFont) Baseline() float32
- func (f *IndirectFont) Descriptor() FontDescriptor
- func (f *IndirectFont) Face() *FontFace
- func (f *IndirectFont) GlyphWidth(glyph uint16) float32
- func (f *IndirectFont) GlyphWidths(glyphs []uint16) []float32
- func (f *IndirectFont) LineHeight() float32
- func (f *IndirectFont) Metrics() FontMetrics
- func (f *IndirectFont) RuneToGlyph(r rune) uint16
- func (f *IndirectFont) RunesToGlyphs(r []rune) []uint16
- func (f *IndirectFont) SimpleWidth(str string) float32
- func (f *IndirectFont) Size() float32
- type Ink
- type InputCallbacks
- type InvertStyle
- type KeyBinding
- type KeyCode
- type Label
- type LabelTheme
- type Layout
- type LineBorder
- type List
- func (l *List) AllowMultipleSelection() bool
- func (l *List) Anchor() int
- func (l *List) Append(values ...interface{})
- func (l *List) Count() int
- func (l *List) DataAtIndex(index int) interface{}
- func (l *List) DefaultCanPerformCmd(source interface{}, id int) bool
- func (l *List) DefaultDraw(canvas *Canvas, dirty geom32.Rect)
- func (l *List) DefaultKeyDown(keyCode KeyCode, mod Modifiers, repeat bool) bool
- func (l *List) DefaultMouseDown(where geom32.Point, button, clickCount int, mod Modifiers) bool
- func (l *List) DefaultMouseDrag(where geom32.Point, button int, mod Modifiers) bool
- func (l *List) DefaultMouseUp(where geom32.Point, button int, mod Modifiers) bool
- func (l *List) DefaultPerformCmd(source interface{}, id int)
- func (l *List) DefaultSizes(hint geom32.Size) (min, pref, max geom32.Size)
- func (l *List) FlashSelection()
- func (l *List) Insert(index int, values ...interface{})
- func (l *List) Remove(index int)
- func (l *List) RemoveRange(from, to int)
- func (l *List) Replace(index int, value interface{})
- func (l *List) Select(add bool, index ...int)
- func (l *List) SelectRange(start, end int, add bool)
- func (l *List) SetAllowMultipleSelection(allow bool) *List
- type ListTheme
- type MaskFilter
- type Menu
- func NewAppMenu(f MenuFactory, aboutHandler, prefsHandler func(MenuItem), updater func(Menu)) Menu
- func NewEditMenu(f MenuFactory, prefsHandler func(MenuItem), updater func(Menu)) Menu
- func NewFileMenu(f MenuFactory, updater func(Menu)) Menu
- func NewHelpMenu(f MenuFactory, aboutHandler func(MenuItem), updater func(Menu)) Menu
- func NewWindowMenu(f MenuFactory, updater func(Menu)) Menu
- type MenuFactory
- type MenuItem
- type MenuItemTheme
- type MenuTheme
- type MipMapMode
- type Modifiers
- func (m Modifiers) CapsLockDown() bool
- func (m Modifiers) CommandDown() bool
- func (m Modifiers) ControlDown() bool
- func (m Modifiers) Key() string
- func (m Modifiers) MarshalText() (text []byte, err error)
- func (m Modifiers) NumLockDown() bool
- func (m Modifiers) OSMenuCmdModifierDown() bool
- func (m Modifiers) OptionDown() bool
- func (m Modifiers) ShiftDown() bool
- func (m Modifiers) String() string
- func (m *Modifiers) UnmarshalText(text []byte) error
- type OpenDialog
- type Paint
- func (p *Paint) Antialias() bool
- func (p *Paint) BlendMode() BlendMode
- func (p *Paint) Clone() *Paint
- func (p *Paint) Color() Color
- func (p *Paint) ColorFilter() *ColorFilter
- func (p *Paint) Dither() bool
- func (p *Paint) Equivalent(other *Paint) bool
- func (p *Paint) FillPath(path *Path, resScale float32) (result *Path, hairline bool)
- func (p *Paint) FillPathWithCull(path *Path, cullRect geom32.Rect, resScale float32) (result *Path, hairline bool)
- func (p *Paint) ImageFilter() *ImageFilter
- func (p *Paint) MaskFilter() *MaskFilter
- func (p *Paint) PathEffect() *PathEffect
- func (p *Paint) Reset()
- func (p *Paint) SetAntialias(enabled bool)
- func (p *Paint) SetBlendMode(blendMode BlendMode)
- func (p *Paint) SetColor(color Color)
- func (p *Paint) SetColorFilter(filter *ColorFilter)
- func (p *Paint) SetDither(enabled bool)
- func (p *Paint) SetImageFilter(filter *ImageFilter)
- func (p *Paint) SetMaskFilter(filter *MaskFilter)
- func (p *Paint) SetPathEffect(effect *PathEffect)
- func (p *Paint) SetShader(shader *Shader)
- func (p *Paint) SetStrokeCap(strokeCap StrokeCap)
- func (p *Paint) SetStrokeJoin(strokeJoin StrokeJoin)
- func (p *Paint) SetStrokeMiter(miter float32)
- func (p *Paint) SetStrokeWidth(width float32)
- func (p *Paint) SetStyle(style PaintStyle)
- func (p *Paint) Shader() *Shader
- func (p *Paint) StrokeCap() StrokeCap
- func (p *Paint) StrokeJoin() StrokeJoin
- func (p *Paint) StrokeMiter() float32
- func (p *Paint) StrokeWidth() float32
- func (p *Paint) Style() PaintStyle
- type PaintStyle
- type Panel
- func (p *Panel) AddChild(child Paneler)
- func (p *Panel) AddChildAtIndex(child Paneler, index int)
- func (p *Panel) AsPanel() *Panel
- func (p *Panel) Border() Border
- func (p *Panel) Children() []*Panel
- func (p *Panel) ClientData() map[string]interface{}
- func (p *Panel) ContentRect(includeBorder bool) geom32.Rect
- func (p *Panel) Draw(gc *Canvas, rect geom32.Rect)
- func (p *Panel) Enabled() bool
- func (p *Panel) FlushDrawing()
- func (p *Panel) Focusable() bool
- func (p *Panel) Focused() bool
- func (p *Panel) FrameRect() geom32.Rect
- func (p *Panel) IndexOfChild(child Paneler) int
- func (p *Panel) Is(other Paneler) bool
- func (p *Panel) IsDragGesture(where geom32.Point) bool
- func (p *Panel) Layout() Layout
- func (p *Panel) LayoutData() interface{}
- func (p *Panel) MarkForLayoutAndRedraw()
- func (p *Panel) MarkForRedraw()
- func (p *Panel) PanelAt(pt geom32.Point) *Panel
- func (p *Panel) Parent() *Panel
- func (p *Panel) PointFromRoot(pt geom32.Point) geom32.Point
- func (p *Panel) PointToRoot(pt geom32.Point) geom32.Point
- func (p *Panel) RectFromRoot(rect geom32.Rect) geom32.Rect
- func (p *Panel) RectToRoot(rect geom32.Rect) geom32.Rect
- func (p *Panel) RemoveAllChildren()
- func (p *Panel) RemoveChild(child Paneler)
- func (p *Panel) RemoveChildAtIndex(index int)
- func (p *Panel) RemoveFromParent()
- func (p *Panel) RequestFocus()
- func (p *Panel) Scale() float32
- func (p *Panel) ScrollIntoView()
- func (p *Panel) ScrollRectIntoView(rect geom32.Rect)
- func (p *Panel) SetBorder(b Border)
- func (p *Panel) SetEnabled(enabled bool)
- func (p *Panel) SetFocusable(focusable bool)
- func (p *Panel) SetFrameRect(rect geom32.Rect)
- func (p *Panel) SetLayout(lay Layout)
- func (p *Panel) SetLayoutData(data interface{})
- func (p *Panel) SetScale(scale float32)
- func (p *Panel) SetSizer(sizer Sizer)
- func (p *Panel) Sizer() Sizer
- func (p *Panel) Sizes(hint geom32.Size) (min, pref, max geom32.Size)
- func (p *Panel) StartDataDrag(data *DragData)
- func (p *Panel) String() string
- func (p *Panel) UpdateCursorNow()
- func (p *Panel) ValidateLayout()
- func (p *Panel) Window() *Window
- type Paneler
- type Path
- func (p *Path) ArcTo(x, y, rx, ry, rotation float32, arcSize ArcSize, direction Direction)
- func (p *Path) ArcToFromTangent(x1, y1, x2, y2, radius float32)
- func (p *Path) ArcToOval(bounds geom32.Rect, startAngle, sweepAngle float32, forceMoveTo bool)
- func (p *Path) ArcToRelative(dx, dy, rx, ry, rotation float32, arcSize ArcSize, direction Direction)
- func (p *Path) Bounds() geom32.Rect
- func (p *Path) Circle(x, y, radius float32)
- func (p *Path) CircleWithDirection(x, y, radius float32, direction Direction)
- func (p *Path) Clone() *Path
- func (p *Path) Close()
- func (p *Path) ComputeTightBounds() geom32.Rect
- func (p *Path) ConicTo(cpx, cpy, x, y, weight float32)
- func (p *Path) ConicToRelative(cpdx, cpdy, dx, dy, weight float32)
- func (p *Path) Contains(x, y float32) bool
- func (p *Path) CubicTo(cp1x, cp1y, cp2x, cp2y, x, y float32)
- func (p *Path) CubicToRelative(cp1dx, cp1dy, cp2dx, cp2dy, dx, dy float32)
- func (p *Path) CurrentPt() geom32.Point
- func (p *Path) FillType() FillType
- func (p *Path) LineTo(x, y float32)
- func (p *Path) LineToRelative(x, y float32)
- func (p *Path) MoveTo(x, y float32)
- func (p *Path) MoveToRelative(x, y float32)
- func (p *Path) NewRotated(degrees float32) *Path
- func (p *Path) NewScaled(sx, sy float32) *Path
- func (p *Path) NewTransformed(matrix *geom32.Matrix2D) *Path
- func (p *Path) NewTranslated(x, y float32) *Path
- func (p *Path) Oval(bounds geom32.Rect)
- func (p *Path) OvalWithDirection(bounds geom32.Rect, direction Direction)
- func (p *Path) Path(path *Path, extend bool)
- func (p *Path) PathReverse(path *Path)
- func (p *Path) PathRotated(path *Path, degrees float32, extend bool)
- func (p *Path) PathScaled(path *Path, sx, sy float32, extend bool)
- func (p *Path) PathTransformed(path *Path, matrix *geom32.Matrix2D, extend bool)
- func (p *Path) PathTranslated(path *Path, offsetX, offsetY float32, extend bool)
- func (p *Path) Poly(pts []geom32.Point, closePath bool)
- func (p *Path) Polygon(poly poly32.Polygon)
- func (p *Path) QuadTo(cpx, cpy, x, y float32)
- func (p *Path) Rect(bounds geom32.Rect)
- func (p *Path) RectWithDirection(bounds geom32.Rect, direction Direction)
- func (p *Path) Reset()
- func (p *Path) Rewind()
- func (p *Path) Rotate(degrees float32)
- func (p *Path) RoundedRect(bounds geom32.Rect, radiusX, radiusY float32)
- func (p *Path) RoundedRectWithDirection(bounds geom32.Rect, radiusX, radiusY float32, direction Direction)
- func (p *Path) Scale(sx, sy float32)
- func (p *Path) SetFillType(fillType FillType)
- func (p *Path) ToSVGString() string
- func (p *Path) Transform(matrix *geom32.Matrix2D)
- func (p *Path) Translate(x, y float32)
- type PathEffect
- func New1dPathPathEffect(path *Path, advance, phase float32, style PathEffect1DStyle) *PathEffect
- func New2dLinePathEffect(width float32, matrix *geom32.Matrix2D) *PathEffect
- func New2dPathEffect(matrix *geom32.Matrix2D, path *Path) *PathEffect
- func NewComposePathEffect(outer, inner *PathEffect) *PathEffect
- func NewCornerPathEffect(radius float32) *PathEffect
- func NewDashPathEffect(intervals []float32, phase float32) *PathEffect
- func NewDiscretePathEffect(segLength, deviation float32, seedAssist uint32) *PathEffect
- func NewSumPathEffect(first, second *PathEffect) *PathEffect
- func NewTrimPathEffect(start, stop float32, mode TrimMode) *PathEffect
- type PathEffect1DStyle
- type PathOp
- type PathOpPair
- type Pattern
- type PointMode
- type PopupMenu
- func (p *PopupMenu) AddDisabledItem(item interface{}) *PopupMenu
- func (p *PopupMenu) AddItem(item interface{}) *PopupMenu
- func (p *PopupMenu) AddSeparator() *PopupMenu
- func (p *PopupMenu) Click()
- func (p *PopupMenu) DefaultDraw(canvas *Canvas, dirty geom32.Rect)
- func (p *PopupMenu) DefaultKeyDown(keyCode KeyCode, mod Modifiers, repeat bool) bool
- func (p *PopupMenu) DefaultMouseDown(where geom32.Point, button, clickCount int, mod Modifiers) bool
- func (p *PopupMenu) DefaultSizes(hint geom32.Size) (min, pref, max geom32.Size)
- func (p *PopupMenu) IndexOfItem(item interface{}) int
- func (p *PopupMenu) ItemAt(index int) interface{}
- func (p *PopupMenu) ItemCount() int
- func (p *PopupMenu) RemoveAllItems() *PopupMenu
- func (p *PopupMenu) RemoveItem(item interface{}) *PopupMenu
- func (p *PopupMenu) RemoveItemAt(index int) *PopupMenu
- func (p *PopupMenu) Select(item interface{}) *PopupMenu
- func (p *PopupMenu) SelectIndex(index int) *PopupMenu
- func (p *PopupMenu) Selected() interface{}
- func (p *PopupMenu) SelectedIndex() int
- func (p *PopupMenu) SetItemAt(index int, item interface{}, enabled bool) *PopupMenu
- func (p *PopupMenu) Text() string
- type PopupMenuTheme
- type ProgressBar
- func (p *ProgressBar) Current() float32
- func (p *ProgressBar) DefaultDraw(canvas *Canvas, dirty geom32.Rect)
- func (p *ProgressBar) DefaultSizes(hint geom32.Size) (min, pref, max geom32.Size)
- func (p *ProgressBar) Maximum() float32
- func (p *ProgressBar) SetCurrent(value float32)
- func (p *ProgressBar) SetMaximum(value float32)
- type ProgressBarTheme
- type RadioButton
- func (r *RadioButton) Click()
- func (r *RadioButton) DefaultDraw(canvas *Canvas, dirty geom32.Rect)
- func (r *RadioButton) DefaultKeyDown(keyCode KeyCode, mod Modifiers, repeat bool) bool
- func (r *RadioButton) DefaultMouseDown(where geom32.Point, button, clickCount int, mod Modifiers) bool
- func (r *RadioButton) DefaultMouseDrag(where geom32.Point, button int, mod Modifiers) bool
- func (r *RadioButton) DefaultMouseUp(where geom32.Point, button int, mod Modifiers) bool
- func (r *RadioButton) DefaultSizes(hint geom32.Size) (min, pref, max geom32.Size)
- type RadioButtonTheme
- type SVG
- func ChevronRightSVG() *SVG
- func CircledChevronRightSVG() *SVG
- func CircledExclamationSVG() *SVG
- func CircledQuestionSVG() *SVG
- func CircledXSVG() *SVG
- func DocumentSVG() *SVG
- func NewSVG(size geom32.Size, svg string) (*SVG, error)
- func SortAscendingSVG() *SVG
- func SortDescendingSVG() *SVG
- func TriangleExclamationSVG() *SVG
- func WindowMaximizeSVG() *SVG
- func WindowRestoreSVG() *SVG
- type SamplingOptions
- type SaveDialog
- type ScrollBar
- func (s *ScrollBar) DefaultDraw(gc *Canvas, rect geom32.Rect)
- func (s *ScrollBar) DefaultMouseDown(where geom32.Point, button, clickCount int, mod Modifiers) bool
- func (s *ScrollBar) DefaultMouseDrag(where geom32.Point, button int, mod Modifiers) bool
- func (s *ScrollBar) DefaultMouseEnter(where geom32.Point, mod Modifiers) bool
- func (s *ScrollBar) DefaultMouseExit() bool
- func (s *ScrollBar) DefaultMouseMove(where geom32.Point, mod Modifiers) bool
- func (s *ScrollBar) DefaultMouseUp(where geom32.Point, button int, mod Modifiers) bool
- func (s *ScrollBar) DefaultSizes(hint geom32.Size) (min, pref, max geom32.Size)
- func (s *ScrollBar) Extent() float32
- func (s *ScrollBar) Horizontal() bool
- func (s *ScrollBar) Max() float32
- func (s *ScrollBar) MaxValue() float32
- func (s *ScrollBar) SetRange(value, extent, max float32)
- func (s *ScrollBar) Thumb() geom32.Rect
- func (s *ScrollBar) Value() float32
- func (s *ScrollBar) Vertical() bool
- type ScrollBarTheme
- type ScrollPanel
- func (s *ScrollPanel) Bar(horizontal bool) *ScrollBar
- func (s *ScrollPanel) ColumnHeader() Paneler
- func (s *ScrollPanel) ColumnHeaderView() *Panel
- func (s *ScrollPanel) Content() Paneler
- func (s *ScrollPanel) ContentView() *Panel
- func (s *ScrollPanel) DefaultDraw(canvas *Canvas, dirty geom32.Rect)
- func (s *ScrollPanel) DefaultFrameChangeInChildHierarchy(panel *Panel)
- func (s *ScrollPanel) DefaultMouseWheel(where, delta geom32.Point, mod Modifiers) bool
- func (s *ScrollPanel) DefaultScrollRectIntoView(rect geom32.Rect) bool
- func (s *ScrollPanel) LayoutSizes(_ *Panel, hint geom32.Size) (min, pref, max geom32.Size)
- func (s *ScrollPanel) PerformLayout(_ *Panel)
- func (s *ScrollPanel) Position() (h, v float32)
- func (s *ScrollPanel) RowHeader() Paneler
- func (s *ScrollPanel) RowHeaderView() *Panel
- func (s *ScrollPanel) SetColumnHeader(p Paneler)
- func (s *ScrollPanel) SetContent(p Paneler, behave Behavior)
- func (s *ScrollPanel) SetPosition(h, v float32)
- func (s *ScrollPanel) SetRowHeader(p Paneler)
- func (s *ScrollPanel) Sync()
- type ScrollPanelTheme
- type Separator
- type SeparatorTheme
- type Shader
- func New2PtConicalGradientShader(startPt, endPt geom32.Point, startRadius, endRadius float32, colors []Color, ...) *Shader
- func NewBlendShader(blendMode BlendMode, dst, src *Shader) *Shader
- func NewColorShader(color Color) *Shader
- func NewFractalPerlinNoiseShader(baseFreqX, baseFreqY, seed float32, numOctaves, tileWidth, tileHeight int) *Shader
- func NewImageShader(canvas *Canvas, img *Image, tileModeX, tileModeY TileMode, ...) *Shader
- func NewLinearGradientShader(start, end geom32.Point, colors []Color, colorPos []float32, tileMode TileMode, ...) *Shader
- func NewRadialGradientShader(center geom32.Point, radius float32, colors []Color, colorPos []float32, ...) *Shader
- func NewSweepGradientShader(center geom32.Point, startAngle, endAngle float32, colors []Color, ...) *Shader
- func NewTurbulencePerlinNoiseShader(baseFreqX, baseFreqY, seed float32, numOctaves, tileWidth, tileHeight int) *Shader
- type Side
- type Sizer
- type SortState
- type StartupOption
- func AllowQuitCallback(f func() bool) StartupOption
- func NoGlobalMenuBar() StartupOption
- func OpenFilesCallback(f func(urls []string)) StartupOption
- func QuitAfterLastWindowClosedCallback(f func() bool) StartupOption
- func QuittingCallback(f func()) StartupOption
- func RecoveryCallback(f errs.RecoveryHandler) StartupOption
- func StartupFinishedCallback(f func()) StartupOption
- func ThemeChangedCallback(f func()) StartupOption
- type Stop
- type StrokeCap
- type StrokeJoin
- type TabCloser
- type Table
- func (t *Table) CellFrame(row, col int) geom32.Rect
- func (t *Table) CellWidth(row, col int) float32
- func (t *Table) ClearSelection()
- func (t *Table) DefaultDraw(canvas *Canvas, dirty geom32.Rect)
- func (t *Table) DefaultMouseDown(where geom32.Point, button, clickCount int, mod Modifiers) bool
- func (t *Table) DefaultMouseDrag(where geom32.Point, button int, mod Modifiers) bool
- func (t *Table) DefaultMouseEnter(where geom32.Point, mod Modifiers) bool
- func (t *Table) DefaultMouseExit() bool
- func (t *Table) DefaultMouseMove(where geom32.Point, mod Modifiers) bool
- func (t *Table) DefaultMouseUp(where geom32.Point, button int, mod Modifiers) bool
- func (t *Table) DefaultSizes(hint geom32.Size) (min, pref, max geom32.Size)
- func (t *Table) DefaultUpdateCursorCallback(where geom32.Point) *Cursor
- func (t *Table) DefaultUpdateTooltipCallback(where geom32.Point, suggestedAvoidInRoot geom32.Rect) geom32.Rect
- func (t *Table) DeselectByIndex(indexes ...int)
- func (t *Table) DiscloseRow(row TableRowData, delaySync bool) bool
- func (t *Table) EventuallySizeColumnsToFit(adjust bool)
- func (t *Table) EventuallySyncToModel()
- func (t *Table) IsRowOrAnyParentSelected(index int) bool
- func (t *Table) IsRowSelected(index int) bool
- func (t *Table) OverColumn(x float32) int
- func (t *Table) OverColumnDivider(x float32) int
- func (t *Table) OverRow(y float32) int
- func (t *Table) RowFrame(row int) geom32.Rect
- func (t *Table) RowToIndex(row TableRowData) int
- func (t *Table) ScrollRowIntoView(row int)
- func (t *Table) SelectByIndex(indexes ...int)
- func (t *Table) SelectedRows() []TableRowData
- func (t *Table) SetTopLevelRows(rows []TableRowData)
- func (t *Table) SizeColumnToFit(index int, adjust bool)
- func (t *Table) SizeColumnsToFit(adjust bool)
- func (t *Table) SyncToModel()
- func (t *Table) TopLevelRows() []TableRowData
- type TableColumnHeader
- type TableHeader
- func (h *TableHeader) ApplySort()
- func (h *TableHeader) ColumnFrame(col int) geom32.Rect
- func (h *TableHeader) DefaultDraw(canvas *Canvas, dirty geom32.Rect)
- func (h *TableHeader) DefaultMouseDown(where geom32.Point, button, clickCount int, mod Modifiers) bool
- func (h *TableHeader) DefaultMouseDrag(where geom32.Point, button int, mod Modifiers) bool
- func (h *TableHeader) DefaultMouseMove(where geom32.Point, mod Modifiers) bool
- func (h *TableHeader) DefaultMouseUp(where geom32.Point, button int, mod Modifiers) bool
- func (h *TableHeader) DefaultSizes(hint geom32.Size) (min, pref, max geom32.Size)
- func (h *TableHeader) DefaultUpdateCursorCallback(where geom32.Point) *Cursor
- func (h *TableHeader) DefaultUpdateTooltipCallback(where geom32.Point, suggestedAvoidInRoot geom32.Rect) geom32.Rect
- func (h *TableHeader) SortOn(header TableColumnHeader)
- type TableHeaderTheme
- type TableRowData
- type TableTheme
- type Text
- func (t *Text) AddRunes(runes []rune, decoration *TextDecoration)
- func (t *Text) AddString(str string, decoration *TextDecoration)
- func (t *Text) Baseline() float32
- func (t *Text) BreakToWidth(width float32) []*Text
- func (t *Text) Draw(canvas *Canvas, x, y float32)
- func (t *Text) Extents() geom32.Size
- func (t *Text) Height() float32
- func (t *Text) PositionForRuneIndex(index int) float32
- func (t *Text) RuneIndexForPosition(x float32) int
- func (t *Text) Slice(i, j int) *Text
- func (t *Text) String() string
- func (t *Text) Width() float32
- type TextDecoration
- type ThemeColor
- type TileMode
- type TooltipTheme
- type TrimMode
- type UndoEdit
- type UndoManager
- func (m *UndoManager) Add(edit UndoEdit)
- func (m *UndoManager) CanRedo() bool
- func (m *UndoManager) CanUndo() bool
- func (m *UndoManager) Clear()
- func (m *UndoManager) CostLimit() int
- func (m *UndoManager) Redo()
- func (m *UndoManager) RedoTitle() string
- func (m *UndoManager) SetCostLimit(limit int)
- func (m *UndoManager) Undo()
- func (m *UndoManager) UndoTitle() string
- type Well
- func (w *Well) Click()
- func (w *Well) DefaultClick()
- func (w *Well) DefaultDraw(canvas *Canvas, dirty geom32.Rect)
- func (w *Well) DefaultFileDrop(files []string)
- func (w *Well) DefaultKeyDown(keyCode KeyCode, mod Modifiers, repeat bool) bool
- func (w *Well) DefaultMouseDown(where geom32.Point, button, clickCount int, mod Modifiers) bool
- func (w *Well) DefaultMouseDrag(where geom32.Point, button int, mod Modifiers) bool
- func (w *Well) DefaultMouseUp(where geom32.Point, button int, mod Modifiers) bool
- func (w *Well) DefaultSizes(hint geom32.Size) (min, pref, max geom32.Size)
- func (w *Well) Ink() Ink
- func (w *Well) SetInk(ink Ink)
- type WellMask
- type WellTheme
- type Window
- func (w *Window) AttemptClose()
- func (w *Window) BackingScale() (x, y float32)
- func (w *Window) ClearTooltip()
- func (w *Window) ClientData() map[string]interface{}
- func (w *Window) Content() *Panel
- func (w *Window) ContentRect() geom32.Rect
- func (w *Window) ContentRectForFrameRect(frame geom32.Rect) geom32.Rect
- func (w *Window) Dispose()
- func (w *Window) Draw(c *Canvas)
- func (w *Window) FlushDrawing()
- func (w *Window) Focus() *Panel
- func (w *Window) FocusNext()
- func (w *Window) FocusPrevious()
- func (w *Window) Focused() bool
- func (w *Window) FrameRect() geom32.Rect
- func (w *Window) FrameRectForContentRect(cr geom32.Rect) geom32.Rect
- func (w *Window) Hide()
- func (w *Window) HideCursor()
- func (w *Window) HideCursorUntilMouseMoves()
- func (w *Window) IsDragGesture(where geom32.Point) bool
- func (w *Window) IsValid() bool
- func (w *Window) IsVisible() bool
- func (w *Window) LocalContentRect() geom32.Rect
- func (w *Window) MarkForRedraw()
- func (w *Window) Minimize()
- func (w *Window) MouseLocation() geom32.Point
- func (w *Window) Pack()
- func (w *Window) Resizable() bool
- func (w *Window) RunModal() int
- func (w *Window) SetContent(panel Paneler)
- func (w *Window) SetContentRect(rect geom32.Rect)
- func (w *Window) SetFocus(target Paneler)
- func (w *Window) SetFrameRect(rect geom32.Rect)
- func (w *Window) SetTitle(title string)
- func (w *Window) Show()
- func (w *Window) ShowCursor()
- func (w *Window) StartDataDrag(data *DragData)
- func (w *Window) StopModal(code int)
- func (w *Window) String() string
- func (w *Window) Title() string
- func (w *Window) ToFront()
- func (w *Window) UpdateCursorNow()
- func (w *Window) ValidateLayout()
- func (w *Window) Zoom()
- type WindowOption
Constants ¶
const ( ModalResponseDiscard = iota - 1 ModalResponseOK ModalResponseCancel ModalResponseUserBase = 100 )
Pre-defined modal response codes. Apps should start their codes at ModalResponseUserBase.
const ( UnderlineThicknessIsValidFontMetricsFlag = 1 << iota UnderlinePositionIsValidFontMetricsFlag StrikeoutThicknessIsValidFontMetricsFlag StrikeoutPositionIsValidFontMetricsFlag BoundsInvalidFontMetricsFlag )
FontMetrics flags
const ( ButtonLeft = int(glfw.MouseButtonLeft) ButtonRight = int(glfw.MouseButtonRight) ButtonMiddle = int(glfw.MouseButtonMiddle) )
Constants for mouse buttons.
const ( KeyNone = KeyCode(glfw.KeyUnknown) KeySpace = KeyCode(glfw.KeySpace) KeyApostrophe = KeyCode(glfw.KeyApostrophe) KeyComma = KeyCode(glfw.KeyComma) KeyMinus = KeyCode(glfw.KeyMinus) KeyPeriod = KeyCode(glfw.KeyPeriod) KeySlash = KeyCode(glfw.KeySlash) Key0 = KeyCode(glfw.Key0) Key1 = KeyCode(glfw.Key1) Key2 = KeyCode(glfw.Key2) Key3 = KeyCode(glfw.Key3) Key4 = KeyCode(glfw.Key4) Key5 = KeyCode(glfw.Key5) Key6 = KeyCode(glfw.Key6) Key7 = KeyCode(glfw.Key7) Key8 = KeyCode(glfw.Key8) Key9 = KeyCode(glfw.Key9) KeySemiColon = KeyCode(glfw.KeySemicolon) KeyEqual = KeyCode(glfw.KeyEqual) KeyA = KeyCode(glfw.KeyA) KeyB = KeyCode(glfw.KeyB) KeyC = KeyCode(glfw.KeyC) KeyD = KeyCode(glfw.KeyD) KeyE = KeyCode(glfw.KeyE) KeyF = KeyCode(glfw.KeyF) KeyG = KeyCode(glfw.KeyG) KeyH = KeyCode(glfw.KeyH) KeyI = KeyCode(glfw.KeyI) KeyJ = KeyCode(glfw.KeyJ) KeyK = KeyCode(glfw.KeyK) KeyL = KeyCode(glfw.KeyL) KeyM = KeyCode(glfw.KeyM) KeyN = KeyCode(glfw.KeyN) KeyO = KeyCode(glfw.KeyO) KeyP = KeyCode(glfw.KeyP) KeyQ = KeyCode(glfw.KeyQ) KeyR = KeyCode(glfw.KeyR) KeyS = KeyCode(glfw.KeyS) KeyT = KeyCode(glfw.KeyT) KeyU = KeyCode(glfw.KeyU) KeyV = KeyCode(glfw.KeyV) KeyW = KeyCode(glfw.KeyW) KeyX = KeyCode(glfw.KeyX) KeyY = KeyCode(glfw.KeyY) KeyZ = KeyCode(glfw.KeyZ) KeyOpenBracket = KeyCode(glfw.KeyLeftBracket) KeyBackslash = KeyCode(glfw.KeyBackslash) KeyCloseBracket = KeyCode(glfw.KeyRightBracket) KeyBackQuote = KeyCode(glfw.KeyGraveAccent) KeyWorld1 = KeyCode(glfw.KeyWorld1) KeyWorld2 = KeyCode(glfw.KeyWorld2) KeyEscape = KeyCode(glfw.KeyEscape) KeyReturn = KeyCode(glfw.KeyEnter) KeyTab = KeyCode(glfw.KeyTab) KeyBackspace = KeyCode(glfw.KeyBackspace) KeyInsert = KeyCode(glfw.KeyInsert) KeyDelete = KeyCode(glfw.KeyDelete) KeyRight = KeyCode(glfw.KeyRight) KeyLeft = KeyCode(glfw.KeyLeft) KeyDown = KeyCode(glfw.KeyDown) KeyUp = KeyCode(glfw.KeyUp) KeyPageUp = KeyCode(glfw.KeyPageUp) KeyPageDown = KeyCode(glfw.KeyPageDown) KeyHome = KeyCode(glfw.KeyHome) KeyEnd = KeyCode(glfw.KeyEnd) KeyCapsLock = KeyCode(glfw.KeyCapsLock) KeyScrollLock = KeyCode(glfw.KeyScrollLock) KeyNumLock = KeyCode(glfw.KeyNumLock) KeyPrintScreen = KeyCode(glfw.KeyPrintScreen) KeyPause = KeyCode(glfw.KeyPause) KeyF1 = KeyCode(glfw.KeyF1) KeyF2 = KeyCode(glfw.KeyF2) KeyF3 = KeyCode(glfw.KeyF3) KeyF4 = KeyCode(glfw.KeyF4) KeyF5 = KeyCode(glfw.KeyF5) KeyF6 = KeyCode(glfw.KeyF6) KeyF7 = KeyCode(glfw.KeyF7) KeyF8 = KeyCode(glfw.KeyF8) KeyF9 = KeyCode(glfw.KeyF9) KeyF10 = KeyCode(glfw.KeyF10) KeyF11 = KeyCode(glfw.KeyF11) KeyF12 = KeyCode(glfw.KeyF12) KeyF13 = KeyCode(glfw.KeyF13) KeyF14 = KeyCode(glfw.KeyF14) KeyF15 = KeyCode(glfw.KeyF15) KeyF16 = KeyCode(glfw.KeyF16) KeyF17 = KeyCode(glfw.KeyF17) KeyF18 = KeyCode(glfw.KeyF18) KeyF19 = KeyCode(glfw.KeyF19) KeyF20 = KeyCode(glfw.KeyF20) KeyF21 = KeyCode(glfw.KeyF21) KeyF22 = KeyCode(glfw.KeyF22) KeyF23 = KeyCode(glfw.KeyF23) KeyF24 = KeyCode(glfw.KeyF24) KeyF25 = KeyCode(glfw.KeyF25) KeyNumPad0 = KeyCode(glfw.KeyKP0) KeyNumPad1 = KeyCode(glfw.KeyKP1) KeyNumPad2 = KeyCode(glfw.KeyKP2) KeyNumPad3 = KeyCode(glfw.KeyKP3) KeyNumPad4 = KeyCode(glfw.KeyKP4) KeyNumPad5 = KeyCode(glfw.KeyKP5) KeyNumPad6 = KeyCode(glfw.KeyKP6) KeyNumPad7 = KeyCode(glfw.KeyKP7) KeyNumPad8 = KeyCode(glfw.KeyKP8) KeyNumPad9 = KeyCode(glfw.KeyKP9) KeyNumPadDecimal = KeyCode(glfw.KeyKPDecimal) KeyNumPadDivide = KeyCode(glfw.KeyKPDivide) KeyNumPadMultiply = KeyCode(glfw.KeyKPMultiply) KeyNumPadSubtract = KeyCode(glfw.KeyKPSubtract) KeyNumPadAdd = KeyCode(glfw.KeyKPAdd) KeyNumPadEnter = KeyCode(glfw.KeyKPEnter) KeyNumPadEqual = KeyCode(glfw.KeyKPEqual) KeyLShift = KeyCode(glfw.KeyLeftShift) KeyLControl = KeyCode(glfw.KeyLeftControl) KeyLOption = KeyCode(glfw.KeyLeftAlt) KeyLCommand = KeyCode(glfw.KeyLeftSuper) KeyRShift = KeyCode(glfw.KeyRightShift) KeyRControl = KeyCode(glfw.KeyRightControl) KeyROption = KeyCode(glfw.KeyRightAlt) KeyRCommand = KeyCode(glfw.KeyRightSuper) KeyMenu = KeyCode(glfw.KeyMenu) KeyLast = KeyCode(glfw.KeyLast) KeyNumPadEnd = KeyNumPad1 KeyNumPadDown = KeyNumPad2 KeyNumPadPageDown = KeyNumPad3 KeyNumPadLeft = KeyNumPad4 KeyNumPadRight = KeyNumPad6 KeyNumPadHome = KeyNumPad7 KeyNumPadUp = KeyNumPad8 KeyNumPadPageUp = KeyNumPad9 KeyNumPadDelete = KeyNumPadDecimal KeyClear = KeyNumLock KeyFn = KeyInsert )
Virtual key codes.
const ( // DefaultMaxSize is the default size that should be used for a maximum dimension if the target has no real // preference and can be expanded beyond its preferred size. This is intentionally not something very large to allow // basic math operations an opportunity to succeed when laying out panels. It is perfectly acceptable to use a // larger value than this, however, if that makes sense for your specific target. DefaultMaxSize = 10000 // StdHSpacing is the typical spacing between columns. StdHSpacing = 8 // StdVSpacing is the typical spacing between rows. StdVSpacing = 4 )
const ( RootMenuID int = 1 + iota AppMenuID FileMenuID EditMenuID WindowMenuID HelpMenuID ServicesMenuID AboutItemID PreferencesItemID QuitItemID CutItemID CopyItemID PasteItemID DeleteItemID SelectAllItemID MinimizeItemID ZoomItemID BringAllWindowsToFrontItemID CloseItemID HideItemID HideOthersItemID ShowAllItemID PopupMenuTemporaryBaseID ContextMenuIDFlag = 1 << 15 // Should be or'd into IDs for context menus UserBaseID = 5000 MaxUserBaseID = ContextMenuIDFlag - 1 )
Pre-defined menu IDs. Apps should start their IDs at UserBaseID.
const DefaultSystemFamilyName = "Roboto"
DefaultSystemFamilyName is the default system font family name and will be used as a fallback where needed.
Variables ¶
var ( // CutAction removes the selection and places it on the clipboard. CutAction = &Action{ ID: CutItemID, Title: i18n.Text("Cut"), KeyBinding: KeyBinding{KeyCode: KeyX, Modifiers: OSMenuCmdModifier()}, EnabledCallback: RouteActionToFocusEnabledFunc, ExecuteCallback: RouteActionToFocusExecuteFunc, } // CopyAction copies the selection and places it on the clipboard. CopyAction = &Action{ ID: CopyItemID, Title: i18n.Text("Copy"), KeyBinding: KeyBinding{KeyCode: KeyC, Modifiers: OSMenuCmdModifier()}, EnabledCallback: RouteActionToFocusEnabledFunc, ExecuteCallback: RouteActionToFocusExecuteFunc, } // PasteAction pastes the contents of the clipboard, replacing the selection. PasteAction = &Action{ ID: PasteItemID, Title: i18n.Text("Paste"), KeyBinding: KeyBinding{KeyCode: KeyV, Modifiers: OSMenuCmdModifier()}, EnabledCallback: RouteActionToFocusEnabledFunc, ExecuteCallback: RouteActionToFocusExecuteFunc, } // DeleteAction deletes the selection. DeleteAction = &Action{ ID: DeleteItemID, Title: i18n.Text("Delete"), KeyBinding: KeyBinding{KeyCode: KeyBackspace}, EnabledCallback: RouteActionToFocusEnabledFunc, ExecuteCallback: RouteActionToFocusExecuteFunc, } // SelectAllAction selects everything in the current focus. SelectAllAction = &Action{ ID: SelectAllItemID, Title: i18n.Text("Select All"), KeyBinding: KeyBinding{KeyCode: KeyA, Modifiers: OSMenuCmdModifier()}, EnabledCallback: RouteActionToFocusEnabledFunc, ExecuteCallback: RouteActionToFocusExecuteFunc, } )
var ( AliceBlue = RGB(240, 248, 255) AntiqueWhite = RGB(250, 235, 215) Aqua = RGB(0, 255, 255) Aquamarine = RGB(127, 255, 212) Azure = RGB(240, 255, 255) Beige = RGB(245, 245, 220) Bisque = RGB(255, 228, 196) Black = RGB(0, 0, 0) BlanchedAlmond = RGB(255, 235, 205) Blue = RGB(0, 0, 255) BlueViolet = RGB(138, 43, 226) Brown = RGB(165, 42, 42) BurlyWood = RGB(222, 184, 135) CadetBlue = RGB(95, 158, 160) Chartreuse = RGB(127, 255, 0) Chocolate = RGB(210, 105, 30) Coral = RGB(255, 127, 80) CornflowerBlue = RGB(100, 149, 237) Cornsilk = RGB(255, 248, 220) Crimson = RGB(220, 20, 60) Cyan = RGB(0, 255, 255) DarkBlue = RGB(0, 0, 139) DarkCyan = RGB(0, 139, 139) DarkGoldenRod = RGB(184, 134, 11) DarkGray = RGB(169, 169, 169) DarkGreen = RGB(0, 100, 0) DarkGrey = RGB(169, 169, 169) DarkKhaki = RGB(189, 183, 107) DarkMagenta = RGB(139, 0, 139) DarkOliveGreen = RGB(85, 107, 47) DarkOrange = RGB(255, 140, 0) DarkOrchid = RGB(153, 50, 204) DarkRed = RGB(139, 0, 0) DarkSalmon = RGB(233, 150, 122) DarkSeaGreen = RGB(143, 188, 143) DarkSlateBlue = RGB(72, 61, 139) DarkSlateGray = RGB(47, 79, 79) DarkSlateGrey = RGB(47, 79, 79) DarkTurquoise = RGB(0, 206, 209) DarkViolet = RGB(148, 0, 211) DeepPink = RGB(255, 20, 147) DeepSkyBlue = RGB(0, 191, 255) DimGray = RGB(105, 105, 105) DimGrey = RGB(105, 105, 105) DodgerBlue = RGB(30, 144, 255) FireBrick = RGB(178, 34, 34) FloralWhite = RGB(255, 250, 240) ForestGreen = RGB(34, 139, 34) Fuchsia = RGB(255, 0, 255) Gainsboro = RGB(220, 220, 220) GhostWhite = RGB(248, 248, 255) Gold = RGB(255, 215, 0) GoldenRod = RGB(218, 165, 32) Gray = RGB(128, 128, 128) Green = RGB(0, 128, 0) GreenYellow = RGB(173, 255, 47) Grey = RGB(128, 128, 128) HoneyDew = RGB(240, 255, 240) HotPink = RGB(255, 105, 180) IndianRed = RGB(205, 92, 92) Indigo = RGB(75, 0, 130) Ivory = RGB(255, 255, 240) Khaki = RGB(240, 230, 140) Lavender = RGB(230, 230, 250) LavenderBlush = RGB(255, 240, 245) LawnGreen = RGB(124, 252, 0) LemonChiffon = RGB(255, 250, 205) LightBlue = RGB(173, 216, 230) LightCoral = RGB(240, 128, 128) LightCyan = RGB(224, 255, 255) LightGoldenRodYellow = RGB(250, 250, 210) LightGray = RGB(211, 211, 211) LightGreen = RGB(144, 238, 144) LightGrey = RGB(211, 211, 211) LightPink = RGB(255, 182, 193) LightSalmon = RGB(255, 160, 122) LightSeaGreen = RGB(32, 178, 170) LightSkyBlue = RGB(135, 206, 250) LightSlateGray = RGB(119, 136, 153) LightSlateGrey = RGB(119, 136, 153) LightSteelBlue = RGB(176, 196, 222) LightYellow = RGB(255, 255, 224) Lime = RGB(0, 255, 0) LimeGreen = RGB(50, 205, 50) Linen = RGB(250, 240, 230) Magenta = RGB(255, 0, 255) Maroon = RGB(128, 0, 0) MediumAquaMarine = RGB(102, 205, 170) MediumBlue = RGB(0, 0, 205) MediumOrchid = RGB(186, 85, 211) MediumPurple = RGB(147, 112, 219) MediumSeaGreen = RGB(60, 179, 113) MediumSlateBlue = RGB(123, 104, 238) MediumSpringGreen = RGB(0, 250, 154) MediumTurquoise = RGB(72, 209, 204) MediumVioletRed = RGB(199, 21, 133) MidnightBlue = RGB(25, 25, 112) MintCream = RGB(245, 255, 250) MistyRose = RGB(255, 228, 225) Moccasin = RGB(255, 228, 181) OldLace = RGB(253, 245, 230) Olive = RGB(128, 128, 0) OliveDrab = RGB(107, 142, 35) Orange = RGB(255, 165, 0) OrangeRed = RGB(255, 69, 0) Orchid = RGB(218, 112, 214) PaleGoldenRod = RGB(238, 232, 170) PaleGreen = RGB(152, 251, 152) PaleTurquoise = RGB(175, 238, 238) PaleVioletRed = RGB(219, 112, 147) PapayaWhip = RGB(255, 239, 213) PeachPuff = RGB(255, 218, 185) Peru = RGB(205, 133, 63) Pink = RGB(255, 192, 203) Plum = RGB(221, 160, 221) PowderBlue = RGB(176, 224, 230) Purple = RGB(128, 0, 128) Red = RGB(255, 0, 0) RosyBrown = RGB(188, 143, 143) RoyalBlue = RGB(65, 105, 225) SaddleBrown = RGB(139, 69, 19) Salmon = RGB(250, 128, 114) SandyBrown = RGB(244, 164, 96) SeaGreen = RGB(46, 139, 87) SeaShell = RGB(255, 245, 238) Sienna = RGB(160, 82, 45) Silver = RGB(192, 192, 192) SkyBlue = RGB(135, 206, 235) SlateBlue = RGB(106, 90, 205) SlateGray = RGB(112, 128, 144) SlateGrey = RGB(112, 128, 144) Snow = RGB(255, 250, 250) SpringGreen = RGB(0, 255, 127) SteelBlue = RGB(70, 130, 180) Tan = RGB(210, 180, 140) Teal = RGB(0, 128, 128) Thistle = RGB(216, 191, 216) Tomato = RGB(255, 99, 71) Transparent = Color(0) Turquoise = RGB(64, 224, 208) Violet = RGB(238, 130, 238) Wheat = RGB(245, 222, 179) White = RGB(255, 255, 255) WhiteSmoke = RGB(245, 245, 245) Yellow = RGB(255, 255, 0) YellowGreen = RGB(154, 205, 50) )
CSS named colors.
var ( SystemFont = &IndirectFont{} EmphasizedSystemFont = &IndirectFont{} SmallSystemFont = &IndirectFont{} EmphasizedSmallSystemFont = &IndirectFont{} LabelFont = &IndirectFont{} FieldFont = &IndirectFont{} KeyboardFont = &IndirectFont{} )
Pre-defined fonts
var ( BackgroundColor = &ThemeColor{Light: RGB(238, 238, 238), Dark: RGB(50, 50, 50)} OnBackgroundColor = &ThemeColor{Light: RGB(0, 0, 0), Dark: RGB(221, 221, 221)} ContentColor = &ThemeColor{Light: RGB(255, 255, 255), Dark: RGB(32, 32, 32)} OnContentColor = &ThemeColor{Light: RGB(0, 0, 0), Dark: RGB(221, 221, 221)} BandingColor = &ThemeColor{Light: RGB(235, 235, 220), Dark: RGB(42, 42, 42)} OnBandingColor = &ThemeColor{Light: RGB(0, 0, 0), Dark: RGB(221, 221, 221)} DividerColor = &ThemeColor{Light: RGB(192, 192, 192), Dark: RGB(102, 102, 102)} TabFocusedColor = &ThemeColor{Light: RGB(224, 212, 175), Dark: RGB(68, 102, 0)} OnTabFocusedColor = &ThemeColor{Light: RGB(0, 0, 0), Dark: RGB(221, 221, 221)} TabCurrentColor = &ThemeColor{Light: RGB(211, 207, 197), Dark: RGB(41, 61, 0)} OnTabCurrentColor = &ThemeColor{Light: RGB(0, 0, 0), Dark: RGB(221, 221, 221)} DropAreaColor = &ThemeColor{Light: RGB(204, 0, 51), Dark: RGB(255, 0, 0)} EditableColor = &ThemeColor{Light: RGB(255, 255, 255), Dark: RGB(24, 24, 24)} OnEditableColor = &ThemeColor{Light: RGB(0, 0, 160), Dark: RGB(100, 153, 153)} SelectionColor = &ThemeColor{Light: RGB(0, 96, 160), Dark: RGB(0, 96, 160)} OnSelectionColor = &ThemeColor{Light: RGB(255, 255, 255), Dark: RGB(255, 255, 255)} InactiveSelectionColor = &ThemeColor{Light: RGB(0, 64, 148), Dark: RGB(0, 64, 148)} OnInactiveSelectionColor = &ThemeColor{Light: RGB(228, 228, 228), Dark: RGB(228, 228, 228)} ScrollColor = &ThemeColor{Light: ARGB(0.5, 192, 192, 192), Dark: ARGB(0.5, 128, 128, 128)} ScrollRolloverColor = &ThemeColor{Light: RGB(192, 192, 192), Dark: RGB(128, 128, 128)} ScrollEdgeColor = &ThemeColor{Light: RGB(128, 128, 128), Dark: RGB(160, 160, 160)} ControlColor = &ThemeColor{Light: RGB(248, 248, 255), Dark: RGB(64, 64, 64)} OnControlColor = &ThemeColor{Light: RGB(0, 0, 0), Dark: RGB(221, 221, 221)} ControlPressedColor = &ThemeColor{Light: RGB(0, 96, 160), Dark: RGB(0, 96, 160)} OnControlPressedColor = &ThemeColor{Light: RGB(255, 255, 255), Dark: RGB(255, 255, 255)} ControlEdgeColor = &ThemeColor{Light: RGB(96, 96, 96), Dark: RGB(96, 96, 96)} IconButtonColor = &ThemeColor{Light: RGB(96, 96, 96), Dark: RGB(128, 128, 128)} IconButtonRolloverColor = &ThemeColor{Light: RGB(0, 0, 0), Dark: RGB(192, 192, 192)} IconButtonPressedColor = &ThemeColor{Light: RGB(0, 96, 160), Dark: RGB(0, 96, 160)} TooltipColor = &ThemeColor{Light: RGB(252, 252, 196), Dark: RGB(252, 252, 196)} OnTooltipColor = &ThemeColor{Light: RGB(0, 0, 0), Dark: RGB(0, 0, 0)} ErrorColor = &ThemeColor{Light: RGB(192, 64, 64), Dark: RGB(115, 37, 37)} OnErrorColor = &ThemeColor{Light: RGB(255, 255, 255), Dark: RGB(221, 221, 221)} WarningColor = &ThemeColor{Light: RGB(224, 128, 0), Dark: RGB(192, 96, 0)} OnWarningColor = &ThemeColor{Light: RGB(255, 255, 255), Dark: RGB(221, 221, 221)} )
Pre-defined theme colors.
var DefaultButtonTheme = ButtonTheme{ Font: SystemFont, BackgroundInk: ControlColor, OnBackgroundInk: OnControlColor, EdgeInk: ControlEdgeColor, SelectionInk: SelectionColor, OnSelectionInk: OnSelectionColor, Gap: 3, CornerRadius: 4, HMargin: 8, VMargin: 1, DrawableOnlyHMargin: 3, DrawableOnlyVMargin: 3, ClickAnimationTime: 100 * time.Millisecond, HAlign: MiddleAlignment, VAlign: MiddleAlignment, Side: LeftSide, HideBase: false, }
DefaultButtonTheme holds the default ButtonTheme values for Buttons. Modifying this data will not alter existing Buttons, but will alter any Buttons created in the future.
var DefaultCheckBoxTheme = CheckBoxTheme{ Font: SystemFont, OnBackgroundInk: OnBackgroundColor, EdgeInk: ControlEdgeColor, SelectionInk: SelectionColor, OnSelectionInk: OnSelectionColor, ControlInk: ControlColor, OnControlInk: OnControlColor, Gap: 3, CornerRadius: 4, ClickAnimationTime: 100 * time.Millisecond, HAlign: StartAlignment, VAlign: MiddleAlignment, Side: LeftSide, }
DefaultCheckBoxTheme holds the default CheckBoxTheme values for CheckBoxes. Modifying this data will not alter existing CheckBoxes, but will alter any CheckBoxes created in the future.
var DefaultDialogTheme = DialogTheme{ ErrorIcon: &DrawableSVG{ SVG: CircledExclamationSVG(), Size: geom32.NewSize(48, 48), }, ErrorIconInk: ErrorColor, WarningIcon: &DrawableSVG{ SVG: TriangleExclamationSVG(), Size: geom32.NewSize(48, 48), }, WarningIconInk: WarningColor, QuestionIcon: &DrawableSVG{ SVG: CircledQuestionSVG(), Size: geom32.NewSize(48, 48), }, QuestionIconInk: OnBackgroundColor, }
DefaultDialogTheme holds the default DialogTheme values for Dialogs. Modifying this data will not alter existing Dialogs, but will alter any Dialogs created in the future.
var DefaultDockHeaderTheme = DockHeaderTheme{ BackgroundInk: BackgroundColor, DropAreaInk: DropAreaColor, HeaderBorder: NewCompoundBorder(NewLineBorder(DividerColor, 0, geom32.Insets{Bottom: 1}, false), NewEmptyBorder(geom32.NewHorizontalInsets(4))), MinimumTabWidth: 50, TabGap: 4, TabInsertSize: 3, }
DefaultDockHeaderTheme holds the default DockHeaderTheme values for DockHeaders. Modifying this data will not alter existing DockHeaders, but will alter any DockHeaders created in the future.
var DefaultDockTabTheme = DockTabTheme{ BackgroundInk: ControlColor, OnBackgroundInk: OnControlColor, EdgeInk: ControlEdgeColor, TabFocusedInk: TabFocusedColor, OnTabFocusedInk: OnTabFocusedColor, TabCurrentInk: TabCurrentColor, OnTabCurrentInk: OnTabCurrentColor, TabBorder: NewEmptyBorder(geom32.Insets{Top: 2, Left: 4, Bottom: 2, Right: 4}), Gap: 4, LabelTheme: defaultLabelTheme(), ButtonTheme: defaultButtonTheme(), }
DefaultDockTabTheme holds the default DockTabTheme values for DockTabs. Modifying this data will not alter existing DockTabs, but will alter any DockTabs created in the future.
var DefaultDockTheme = DockTheme{ BackgroundInk: BackgroundColor, GripInk: DividerColor, DropAreaInk: DropAreaColor, GripCount: 5, GripGap: 1, GripWidth: 4, GripHeight: 2, GripMargin: 2, }
DefaultDockTheme holds the default DockTheme values for Docks. Modifying this data will not alter existing Docks, but will alter any Docks created in the future.
var DefaultFieldTheme = FieldTheme{ Font: FieldFont, BackgroundInk: BackgroundColor, OnBackgroundInk: OnBackgroundColor, EditableInk: EditableColor, OnEditableInk: OnEditableColor, SelectionInk: SelectionColor, OnSelectionInk: OnSelectionColor, ErrorInk: ErrorColor, OnErrorInk: OnErrorColor, FocusedBorder: NewCompoundBorder(NewLineBorder(ControlEdgeColor, 0, geom32.NewUniformInsets(2), false), NewEmptyBorder(geom32.Insets{Top: 2, Left: 2, Bottom: 1, Right: 2})), UnfocusedBorder: NewCompoundBorder(NewLineBorder(ControlEdgeColor, 0, geom32.NewUniformInsets(1), false), NewEmptyBorder(geom32.Insets{Top: 3, Left: 3, Bottom: 2, Right: 3})), BlinkRate: 560 * time.Millisecond, MinimumTextWidth: 10, HAlign: StartAlignment, }
DefaultFieldTheme holds the default FieldTheme values for Fields. Modifying this data will not alter existing Fields, but will alter any Fields created in the future.
var DefaultLabelTheme = LabelTheme{ Font: LabelFont, OnBackgroundInk: OnBackgroundColor, Gap: 3, HAlign: StartAlignment, VAlign: MiddleAlignment, Side: LeftSide, }
DefaultLabelTheme holds the default LabelTheme values for Labels. Modifying this data will not alter existing Labels, but will alter any Labels created in the future.
var DefaultListTheme = ListTheme{ BackgroundInk: ContentColor, OnBackgroundInk: OnContentColor, BandingInk: BandingColor, OnBandingInk: OnBandingColor, SelectionInk: SelectionColor, OnSelectionInk: OnSelectionColor, FlashAnimationTime: 100 * time.Millisecond, }
DefaultListTheme holds the default ListTheme values for Lists. Modifying this data will not alter existing Lists, but will alter any Lists created in the future.
var DefaultMenuItemTheme = MenuItemTheme{ TitleFont: SystemFont, KeyFont: KeyboardFont, BackgroundColor: BackgroundColor, OnBackgroundColor: OnBackgroundColor, SelectionColor: SelectionColor, OnSelectionColor: OnSelectionColor, ItemBorder: NewEmptyBorder(geom32.Insets{Top: 4, Left: 8, Bottom: 4, Right: 8}), SeparatorBorder: NewEmptyBorder(geom32.NewVerticalInsets(4)), KeyGap: 16, }
DefaultMenuItemTheme holds the default MenuItemTheme values for menu items. Modifying this data will not alter existing menu items, but will alter any menu items created in the future.
var DefaultMenuTheme = MenuTheme{ BarBorder: NewLineBorder(DividerColor, 0, geom32.Insets{Bottom: 1}, false), MenuBorder: NewLineBorder(DividerColor, 0, geom32.NewUniformInsets(1), false), }
DefaultMenuTheme holds the default MenuTheme values for Menus. Modifying this data will not alter existing Menus, but will alter any Menus created in the future.
var DefaultPopupMenuTheme = PopupMenuTheme{ Font: SystemFont, BackgroundInk: ControlColor, OnBackgroundInk: OnControlColor, EdgeInk: ControlEdgeColor, SelectionInk: SelectionColor, OnSelectionInk: OnSelectionColor, CornerRadius: 4, HMargin: 8, VMargin: 1, }
DefaultPopupMenuTheme holds the default PopupMenuTheme values for PopupMenus. Modifying this data will not alter existing PopupMenus, but will alter any PopupMenus created in the future.
var DefaultProgressBarTheme = ProgressBarTheme{ BackgroundInk: BackgroundColor, FillInk: SelectionColor, EdgeInk: ControlEdgeColor, TickSpeed: time.Second / 30, FullTraversalSpeed: time.Second, PreferredBarHeight: 8, CornerRadius: 8, IndeterminateWidth: 15, EdgeThickness: 1, }
DefaultProgressBarTheme holds the default ProgressBarTheme values for ProgressBars. Modifying this data will not alter existing ProgressBars, but will alter any ProgressBars created in the future.
var DefaultRadioButtonTheme = RadioButtonTheme{ Font: SystemFont, BackgroundInk: ControlColor, OnBackgroundInk: OnControlColor, EdgeInk: ControlEdgeColor, LabelInk: OnBackgroundColor, SelectionInk: SelectionColor, OnSelectionInk: OnSelectionColor, Gap: 3, CornerRadius: 4, ClickAnimationTime: 100 * time.Millisecond, HAlign: MiddleAlignment, VAlign: MiddleAlignment, Side: LeftSide, }
DefaultRadioButtonTheme holds the default RadioButtonTheme values for RadioButtons. Modifying this data will not alter existing RadioButtons, but will alter any RadioButtons created in the future.
var DefaultSVGButtonTheme = ButtonTheme{ Font: SystemFont, BackgroundInk: ControlColor, OnBackgroundInk: IconButtonColor, EdgeInk: ControlEdgeColor, SelectionInk: SelectionColor, OnSelectionInk: IconButtonPressedColor, RolloverInk: IconButtonRolloverColor, Gap: 3, CornerRadius: 4, HMargin: 8, VMargin: 1, DrawableOnlyHMargin: 3, DrawableOnlyVMargin: 3, ClickAnimationTime: 100 * time.Millisecond, HAlign: MiddleAlignment, VAlign: MiddleAlignment, Side: LeftSide, HideBase: false, }
DefaultSVGButtonTheme holds the default ButtonTheme values for SVG Buttons. Modifying this data will not alter existing Buttons, but will alter any Buttons created in the future.
var DefaultScrollBarTheme = ScrollBarTheme{ EdgeInk: ScrollEdgeColor, ThumbInk: ScrollColor, RolloverInk: ScrollRolloverColor, MinimumThickness: 16, MinimumThumb: 16, ThumbIndent: 3, CornerRadius: 8, }
DefaultScrollBarTheme holds the default ScrollBarTheme values for ScrollBars. Modifying this data will not alter existing ScrollBars, but will alter any ScrollBars created in the future.
var DefaultScrollPanelTheme = ScrollPanelTheme{ BackgroundInk: BackgroundColor, }
DefaultScrollPanelTheme holds the default ScrollPanelTheme values for ScrollPanels. Modifying this data will not alter existing ScrollPanels, but will alter any ScrollPanels created in the future.
var DefaultSeparatorTheme = SeparatorTheme{ LineInk: DividerColor, Vertical: false, }
DefaultSeparatorTheme holds the default SeparatorTheme values for Separators. Modifying this data will not alter existing Separators, but will alter any Separators created in the future.
var DefaultTableColumnHeaderTheme = LabelTheme{ Font: LabelFont, OnBackgroundInk: OnBackgroundColor, Gap: 3, HAlign: MiddleAlignment, VAlign: MiddleAlignment, Side: LeftSide, }
DefaultTableColumnHeaderTheme holds the default TableColumnHeaderTheme values for TableColumnHeaders. Modifying this data will not alter existing TableColumnHeaders, but will alter any TableColumnHeaders created in the future.
var DefaultTableHeaderTheme = TableHeaderTheme{ BackgroundInk: ControlColor, DividerInk: DividerColor, HeaderBorder: NewLineBorder(DividerColor, 0, geom32.Insets{Bottom: 1}, false), }
DefaultTableHeaderTheme holds the default TableHeaderTheme values for TableHeaders. Modifying this data will not alter existing TableHeaders, but will alter any TableHeaders created in the future.
var DefaultTableTheme = TableTheme{ BackgroundInk: ContentColor, OnBackgroundInk: OnContentColor, BandingInk: BandingColor, OnBandingInk: OnBandingColor, DividerInk: DividerColor, SelectionInk: SelectionColor, OnSelectionInk: OnSelectionColor, Padding: geom32.NewUniformInsets(4), HierarchyColumnIndex: 0, HierarchyIndent: 16, MinimumRowHeight: 16, ColumnResizeSlop: 4, ShowRowDivider: true, ShowColumnDivider: true, }
DefaultTableTheme holds the default TableTheme values for Tables. Modifying this data will not alter existing Tables, but will alter any Tables created in the future.
var DefaultTooltipTheme = TooltipTheme{ BackgroundInk: TooltipColor, BaseBorder: NewCompoundBorder(NewLineBorder(ControlEdgeColor, 0, geom32.NewUniformInsets(1), false), NewEmptyBorder(geom32.Insets{Top: 4, Left: 8, Bottom: 4, Right: 8})), Label: defaultToolTipLabelTheme(), Delay: 1500 * time.Millisecond, Dismissal: 5 * time.Second, }
DefaultTooltipTheme holds the default TooltipTheme values for Tooltips. Modifying this data will not alter existing Tooltips, but will alter any Tooltips created in the future.
var DefaultWellTheme = WellTheme{ BackgroundInk: ControlColor, EdgeInk: ControlEdgeColor, SelectionInk: SelectionColor, ImageScale: 0.5, ContentSize: 20, CornerRadius: 4, ClickAnimationTime: 100 * time.Millisecond, Mask: ColorWellMask | GradientWellMask | PatternWellMask, }
DefaultWellTheme holds the default WellTheme values for Wells. Modifying this data will not alter existing Wells, but will alter any Wells created in the future.
var ( // DisableMenus overrides all application menus when set to true, causing them to become disabled. This is primarily // provided to allow a way to disable menu key capture temporarily. This will not allow system keys to be captured, // but will prevent the menus from capturing keys while it is true. DisableMenus bool )
var ( // ErrColorDecode is the sentinel error returned by the ColorDecode function on failure. ErrColorDecode = errors.New("invalid color string") )
var FontWeights = []FontWeight{ InvisibleFontWeight, ThinFontWeight, ExtraLightFontWeight, LightFontWeight, NormalFontWeight, MediumFontWeight, SemiBoldFontWeight, BoldFontWeight, ExtraBoldFontWeight, BlackFontWeight, ExtraBlackFontWeight, }
FontWeights holds the set of possible FontWeight values.
var GlobalClipboard = &Clipboard{}
GlobalClipboard holds the global clipboard.
var ( // KeyCodeToName maps virtual key codes to a human-readable name. KeyCodeToName = map[KeyCode]string{}/* 120 elements not displayed */ )
var ( // KnownImageFormatExtensions holds the list of known image file format extensions. KnownImageFormatExtensions []string )
var Slants = []FontSlant{ NoSlant, ItalicSlant, ObliqueSlant, }
Slants holds the set of possible FontSlant values.
var Spacings = []FontSpacing{ UltraCondensedSpacing, ExtraCondensedSpacing, CondensedSpacing, SemiCondensedSpacing, StandardSpacing, SemiExpandedSpacing, ExpandedSpacing, ExtraExpandedSpacing, UltraExpandedSpacing, }
Spacings holds the set of possible FontSpacing values.
Functions ¶
func AllWindowsToFront ¶
func AllWindowsToFront()
AllWindowsToFront brings all of the application's windows to the foreground.
func AttachConsole ¶ added in v0.3.0
func AttachConsole()
AttachConsole attempts to fix Windows console output, which is generally broken thanks to their oddball and unnecessary split between graphical and command-line applications. This attempts to fix that by attaching the console so that a graphical application can also be used as a command-line application without having to build two variants. May be called more than once. Subsequent calls do nothing. Does nothing on non-Windows platforms.
func DistillImageSpecFor ¶
DistillImageSpecFor distills a file path or URL string into one that likely has an image we can read, or an empty string.
func DockableHasFocus ¶ added in v0.5.0
DockableHasFocus returns true if the given Dockable has the current focus inside it.
func DoubleClickParameters ¶
DoubleClickParameters returns the maximum delay between clicks and the maximum pixel drift allowed to register as a double-click.
func DragGestureParameters ¶ added in v0.3.0
DragGestureParameters returns the minimum delay before mouse movement should be recognized as a drag as well as the minimum pixel drift required to trigger a drag.
func DrawEllipseBase ¶
DrawEllipseBase fills and strokes an ellipse.
func DrawLabel ¶
func DrawLabel(canvas *Canvas, rect geom32.Rect, hAlign, vAlign Alignment, text string, font Font, textInk Ink, drawable Drawable, drawableSide Side, imgGap float32, applyDisabledFilter bool)
DrawLabel draws a label. Provided as a standalone function so that other types of panels can make use of it.
func DrawRectBase ¶
DrawRectBase fills and strokes a rectangle.
func DrawRoundedRectBase ¶
func DrawRoundedRectBase(canvas *Canvas, rect geom32.Rect, cornerRadius, thickness float32, fillInk, strokeInk Ink)
DrawRoundedRectBase fills and strokes a rounded rectangle.
func ErrorDialogWithError ¶
ErrorDialogWithError displays a standard error dialog with the specified primary message and extracts the message from the error for its detail. The full error will be logged via jot.Error(). Embedded line feeds are OK.
func ErrorDialogWithMessage ¶
func ErrorDialogWithMessage(primary, detail string)
ErrorDialogWithMessage displays a standard error dialog with the specified primary and detail messages. Embedded line feeds are OK.
func ErrorDialogWithPanel ¶
func ErrorDialogWithPanel(msgPanel Paneler)
ErrorDialogWithPanel displays a standard error dialog with the specified panel.
func FontFamilies ¶
func FontFamilies() []string
FontFamilies retrieves the names of the installed font families.
func InsertAboutItem ¶
InsertAboutItem creates the standard "About" menu item that will call the provided handler when chosen.
func InsertBringAllToFrontItem ¶
InsertBringAllToFrontItem creates the standard "Bring All to Front" menu item that will call AllWindowsToFront when chosen.
func InsertCloseFocusedWindowItem ¶
InsertCloseFocusedWindowItem creates the standard "Close" menu item that will close the currently focused window when chosen.
func InsertMinimizeItem ¶
InsertMinimizeItem creates the standard "Minimize" menu item that will issue the Minimize command to the currently focused window when chosen.
func InsertPreferencesItem ¶
InsertPreferencesItem creates the standard "Preferences…" menu item that will call the provided handler when chosen.
func InsertQuitItem ¶
InsertQuitItem creates the standard "Quit"/"Exit" menu item that will issue the Quit command when chosen.
func InsertStdMenus ¶
InsertStdMenus adds the standard menus to the menu bar.
func InsertZoomItem ¶
InsertZoomItem creates the standard "Zoom" menu item that will issue the Zoom command to the currently focused window when chosen.
func InvokeTask ¶
func InvokeTask(f func())
InvokeTask calls a function on the UI thread. The function is put into the system event queue and will be run at the next opportunity.
func InvokeTaskAfter ¶
InvokeTaskAfter schedules a function to be run on the UI thread after waiting for the specified duration.
func IsControlAction ¶
IsControlAction returns true if the keyCode should trigger a control, such as a button, that is focused.
func IsDarkModeEnabled ¶
func IsDarkModeEnabled() bool
IsDarkModeEnabled returns true if the OS is currently using a "dark mode".
func IsDarkModeTrackingPossible ¶
func IsDarkModeTrackingPossible() bool
IsDarkModeTrackingPossible returns true if the underlying platform can provide the current dark mode state. On those platforms that return false from this function, DarkModeTrackPlatform is the same as DarkModeForcedOff.
func LabelSize ¶
func LabelSize(text string, font Font, drawable Drawable, drawableSide Side, imgGap float32) geom32.Size
LabelSize returns the preferred size of a label. Provided as a standalone function so that other types of panels can make use of it.
func MarkDynamicColorsForRebuild ¶
func MarkDynamicColorsForRebuild()
MarkDynamicColorsForRebuild marks the dynamic colors to be updated the next time RebuildDynamicColors() is called.
func MaxSize ¶
MaxSize returns the size that is at least as large as DefaultMaxSize in both dimensions, but larger if the size that is passed in is larger.
func QuestionDialog ¶
QuestionDialog displays a standard question dialog with the specified primary and detail messages. Embedded line feeds are OK. This function returns ids.ModalResponseOK if the OK button was pressed and ids.ModalResponseCancel if the Cancel button was pressed.
func QuestionDialogWithPanel ¶
QuestionDialogWithPanel displays a standard question dialog with the specified panel. This function returns ids.ModalResponseOK if the OK button was pressed and ids.ModalResponseCancel if the Cancel button was pressed.
func RebuildDynamicColors ¶
func RebuildDynamicColors()
RebuildDynamicColors rebuilds the dynamic colors, but only if a call to MarkDynamicColorsForRebuild() has been made since the last time this function was called.
func ReleaseOnUIThread ¶
func ReleaseOnUIThread(f func())
ReleaseOnUIThread will add f to the release queue and eventually call it on the UI thread.
func RouteActionToFocusEnabledFunc ¶
RouteActionToFocusEnabledFunc is intended to be the EnabledCallback for actions that will route to the currently focused UI widget and call CanPerformCmdCallback() on them.
func RouteActionToFocusExecuteFunc ¶
func RouteActionToFocusExecuteFunc(action *Action, src interface{})
RouteActionToFocusExecuteFunc is intended to be the ExecuteCallback for actions that will route to the currently focused UI widget and call PerformCmdCallback() on them.
func SanitizeExtensionList ¶
SanitizeExtensionList ensures the extension list is consistent:
- removal of leading and trailing white space
- removal of leading "*." or "."
- lower-cased
- removal of duplicates
- removal of empty extensions
func SetDarkModeTracking ¶
func SetDarkModeTracking(mode DarkModeTracking)
SetDarkModeTracking sets the way dark mode is tracked.
func Start ¶
func Start(options ...StartupOption)
Start the application. This function does NOT return. While some calls may be safe to make, it should be assumed no calls into unison can be made prior to Start() being called unless explicitly stated otherwise.
func ThemeChanged ¶ added in v0.7.0
func ThemeChanged()
ThemeChanged marks dynamic colors for rebuilding, calls any installed theme change callback, and then redraws all windows. This is normally called automatically for you, however, it has been made public to allow you to trigger it on demand.
func WarningDialogWithMessage ¶ added in v0.5.0
func WarningDialogWithMessage(primary, detail string)
WarningDialogWithMessage displays a standard warning dialog with the specified primary and detail messages. Embedded line feeds are OK.
func WarningDialogWithPanel ¶ added in v0.5.0
func WarningDialogWithPanel(msgPanel Paneler)
WarningDialogWithPanel displays a standard error dialog with the specified panel.
Types ¶
type Action ¶
type Action struct { ID int // Should be unique among all actions and menu items. Title string // Typically used in a menu item title or tooltip for a button. KeyBinding KeyBinding // The key binding that will trigger the action. EnabledCallback func(*Action, interface{}) bool // Should return true if the action can be used. Care should be made to keep this method fast to avoid slowing down the user interface. May be nil, in which case it is assumed to always be enabled. ExecuteCallback func(*Action, interface{}) // Will be called to run the action. May be nil. }
Action describes an action that can be performed.
func (*Action) NewContextMenuItemFromAction ¶
func (a *Action) NewContextMenuItemFromAction(f MenuFactory) MenuItem
NewContextMenuItemFromAction returns a newly created menu item for a context menu using this action. If the menuItem would be disabled, nil is returned instead.
func (*Action) NewMenuItem ¶
func (a *Action) NewMenuItem(f MenuFactory) MenuItem
NewMenuItem returns a newly created menu item using this action.
type Alignment ¶
type Alignment uint8
Alignment specifies how to align an object within its available space.
type Behavior ¶
type Behavior uint8
Behavior controls how auto-sizing of the scroll content's preferred size is handled.
type BlendMode ¶
type BlendMode byte
BlendMode holds the mode used for blending pixels.
const ( ClearBlendMode BlendMode = iota SrcBlendMode DstBlendMode SrcOverBlendMode DstOverBlendMode SrcInBlendMode DstInBlendMode SrcOutBlendMode DstOutBlendMode SrcAtopBlendMode DstAtopBlendMode XorBlendMode PlusBlendMode ModulateBlendMode ScreenBlendMode OverlayBlendMode DarkenBlendMode LightenBlendMode ColorDodgeBlendMode ColorBurnBlendMode HardLightBlendMode SoftLightBlendMode DifferenceBlendMode ExclusionBlendMode MultiplyBlendMode HueBlendMode SaturationBlendMode ColorBlendMode LuminosityBlendMode )
Possible values for BlendMode.
type Border ¶
type Border interface { // Insets returns the insets describing the space the border occupies on each side. Insets() geom32.Insets // Draw the border into rect. Draw(canvas *Canvas, rect geom32.Rect) }
Border defines methods required of all border providers.
type Button ¶
type Button struct { GroupPanel ButtonTheme ClickCallback func() Drawable Drawable Text string Pressed bool // contains filtered or unexported fields }
Button represents a clickable button.
func NewSVGButton ¶ added in v0.7.0
NewSVGButton creates an SVG icon button with a size equal to the default button theme's font baseline.
func (*Button) Click ¶
func (b *Button) Click()
Click makes the button behave as if a user clicked on it.
func (*Button) DefaultDraw ¶
DefaultDraw provides the default drawing.
func (*Button) DefaultKeyDown ¶
DefaultKeyDown provides the default key down handling.
func (*Button) DefaultMouseDown ¶
DefaultMouseDown provides the default mouse down handling.
func (*Button) DefaultMouseDrag ¶
DefaultMouseDrag provides the default mouse drag handling.
func (*Button) DefaultMouseEnter ¶ added in v0.7.0
DefaultMouseEnter provides the default mouse enter handling.
func (*Button) DefaultMouseExit ¶ added in v0.7.0
DefaultMouseExit provides the default mouse exit handling.
func (*Button) DefaultMouseUp ¶
DefaultMouseUp provides the default mouse up handling.
func (*Button) DefaultSizes ¶
DefaultSizes provides the default sizing.
func (*Button) HorizontalMargin ¶
HorizontalMargin returns the horizontal margin that will be used.
func (*Button) VerticalMargin ¶
VerticalMargin returns the vertical margin that will be used.
type ButtonTheme ¶ added in v0.4.0
type ButtonTheme struct { Font Font BackgroundInk Ink OnBackgroundInk Ink EdgeInk Ink SelectionInk Ink OnSelectionInk Ink RolloverInk Ink Gap float32 CornerRadius float32 HMargin float32 VMargin float32 DrawableOnlyHMargin float32 DrawableOnlyVMargin float32 ClickAnimationTime time.Duration HAlign Alignment VAlign Alignment Side Side HideBase bool Sticky bool }
ButtonTheme holds theming data for a Button.
type Canvas ¶
type Canvas struct {
// contains filtered or unexported fields
}
Canvas is a drawing surface.
func (*Canvas) ClipBounds ¶
ClipBounds returns the clip bounds.
func (*Canvas) ClipPath ¶
ClipPath replaces the clip with the intersection of difference of the current clip and path.
func (*Canvas) ClipRect ¶
ClipRect replaces the clip with the intersection of difference of the current clip and rect.
func (*Canvas) DrawArc ¶
func (c *Canvas) DrawArc(oval geom32.Rect, startAngle, sweepAngle float32, paint *Paint, useCenter bool)
DrawArc draws an arc. startAngle and sweepAngle are in degrees. If useCenter is true, this will draw a wedge that includes lines from the oval center to the arc end points. If useCenter is false, then just and arc between the end points will be drawn.
func (*Canvas) DrawCircle ¶
DrawCircle draws the circle with Paint.
func (*Canvas) DrawImage ¶
func (c *Canvas) DrawImage(img *Image, x, y float32, sampling *SamplingOptions, paint *Paint)
DrawImage draws the image at the specified location using its logical size. paint may be nil.
func (*Canvas) DrawImageInRect ¶
func (c *Canvas) DrawImageInRect(img *Image, rect geom32.Rect, sampling *SamplingOptions, paint *Paint)
DrawImageInRect draws the image into the area specified by the rect, scaling if necessary. paint may be nil.
func (*Canvas) DrawImageNine ¶
func (c *Canvas) DrawImageNine(img *Image, centerRect, dstRect geom32.Rect, filter FilterMode, paint *Paint)
DrawImageNine draws an image stretched proportionally to fit into dstRect. 'center' divides the image into nine sections: four sides, four corners, and the center. Corners are unmodified or scaled down proportionately if their sides are larger than dstRect; center and four sides are scaled to fit remaining space, if any. paint may be nil.
func (*Canvas) DrawImageRectInRect ¶
func (c *Canvas) DrawImageRectInRect(img *Image, srcRect, dstRect geom32.Rect, sampling *SamplingOptions, paint *Paint)
DrawImageRectInRect draws a portion of the image into the area specified, scaling if necessary. srcRect should be in raw pixel coordinates, not logical coordinates. dstRect should be in logical coordinates. paint may be nil.
func (*Canvas) DrawPaint ¶
DrawPaint fills the clip with Paint. Any MaskFilter or PathEffect in the Paint is ignored.
func (*Canvas) DrawPoints ¶
DrawPoints draws the points using the given mode.
func (*Canvas) DrawPolygon ¶
DrawPolygon draws a polygon.
func (*Canvas) DrawRoundedRect ¶
DrawRoundedRect draws a rounded rectangle with Paint.
func (*Canvas) DrawSimpleString ¶ added in v0.7.0
DrawSimpleString draws a string. It does not do any processing of embedded line endings nor tabs. It also does not do any font fallback. y is the baseline for the text.
func (*Canvas) DrawString ¶ added in v0.7.0
DrawString draws a string. It does not do any processing of embedded line endings nor tabs. y is the baseline for the text.
func (*Canvas) IsClipEmpty ¶
IsClipEmpty returns true if the clip is empty, i.e. nothing will draw.
func (*Canvas) IsClipRect ¶
IsClipRect returns true if the clip is a rectangle and not empty.
func (*Canvas) QuickRejectPath ¶
QuickRejectPath returns true if the path, after transformations by the current matrix, can be quickly determined to be outside of the current clip. May return false even though the path is outside of the clip.
func (*Canvas) QuickRejectRect ¶
QuickRejectRect returns true if the rect, after transformations by the current matrix, can be quickly determined to be outside of the current clip. May return false even though the rect is outside of the clip.
func (*Canvas) ResetMatrix ¶
func (c *Canvas) ResetMatrix()
ResetMatrix sets the current transform matrix to the identity matrix.
func (*Canvas) Restore ¶
func (c *Canvas) Restore()
Restore removes changes to the transformation matrix and clip since the last call to Save() or SaveWithOpacity(). Does nothing if the stack is empty.
func (*Canvas) RestoreToCount ¶
RestoreToCount restores the transformation matrix and clip to the state they where in when the specified count was returned from a call to Save() or SaveWithOpacity(). Does nothing if count is greater than the current state stack count. Restores the state to the initial values if count is <= 1.
func (*Canvas) Save ¶
Save pushes the current transformation matrix and clip onto a stack and returns the current count. Multiple save calls should be balanced by an equal number of calls to Restore().
func (*Canvas) SaveCount ¶
SaveCount returns the number of saved states, which equals the number of save calls minus the number of Restore() calls plus 1. The SaveCount() of a new Canvas is 1.
func (*Canvas) SaveLayer ¶
SaveLayer pushes the current transformation matrix and clip onto a stack and returns the current count. The provided paint will be applied to all subsequent drawing until the corresponding call to Restore(). Multiple save calls should be balanced by an equal number of calls to Restore().
func (*Canvas) SaveWithOpacity ¶
SaveWithOpacity pushes the current transformation matrix and clip onto a stack and returns the current count. The opacity (a value between 0 and 1, where 0 is fully transparent and 1 is fully opaque) will be applied to all subsequent drawing until the corresponding call to Restore(). Multiple save calls should be balanced by an equal number of calls to Restore().
type CellFactory ¶
type CellFactory interface { // CellHeight returns the height to use for the cells. A value less than 1 indicates that each cell's height may be // different. CellHeight() float32 // CreateCell creates a new cell for 'owner' using 'element' as the content. 'index' indicates which row the element // came from. 'selected' indicates the cell should be created in its selected state. 'focused' indicates the cell // should be created in its focused state. CreateCell(owner Paneler, element interface{}, index int, foreground Ink, selected, focused bool) *Panel }
CellFactory defines methods all cell factories must implement.
type CheckBox ¶
type CheckBox struct { Panel CheckBoxTheme ClickCallback func() Drawable Drawable Text string State CheckState Pressed bool }
CheckBox represents a clickable checkbox with an optional label.
func (*CheckBox) Click ¶
func (c *CheckBox) Click()
Click makes the checkbox behave as if a user clicked on it.
func (*CheckBox) DefaultDraw ¶
DefaultDraw provides the default drawing.
func (*CheckBox) DefaultKeyDown ¶
DefaultKeyDown provides the default key down handling.
func (*CheckBox) DefaultMouseDown ¶
DefaultMouseDown provides the default mouse down handling.
func (*CheckBox) DefaultMouseDrag ¶
DefaultMouseDrag provides the default mouse drag handling.
func (*CheckBox) DefaultMouseUp ¶
DefaultMouseUp provides the default mouse up handling.
type CheckBoxTheme ¶ added in v0.4.0
type CheckBoxTheme struct { Font Font OnBackgroundInk Ink EdgeInk Ink SelectionInk Ink OnSelectionInk Ink ControlInk Ink OnControlInk Ink Gap float32 CornerRadius float32 ClickAnimationTime time.Duration HAlign Alignment VAlign Alignment Side Side }
CheckBoxTheme holds theming data for a CheckBox.
type CheckState ¶
type CheckState uint8
CheckState represents the current state of something like a check box or mark.
const ( OffCheckState CheckState = iota OnCheckState MixedCheckState )
Possible values for CheckState.
func CheckStateFromBool ¶
func CheckStateFromBool(b bool) CheckState
CheckStateFromBool returns the equivalent CheckState.
type Clipboard ¶
type Clipboard struct {
// contains filtered or unexported fields
}
Clipboard provides access to the system clipboard as well as an internal, application-only, clipboard. Currently, due to limitations in the underlying glfw libraries, only strings may be set onto and retrieved from the system clipboard. The internal clipboard accepts any type of data and is passed around via interface. Due to this, you may want to consider serializing and unserializing your data into bytes to pass it through the clipboard, to avoid accidental mutations.
func (*Clipboard) GetData ¶
GetData returns the data associated with the specified type on the application clipboard and does not examine the system clipboard at all.
func (*Clipboard) GetText ¶
GetText returns text from the current clipboard data. This reads from the system clipboard.
func (*Clipboard) SetData ¶
SetData the data for a single type on the application clipboard, clearing out any others that were previously present. If the data can be converted to text by .(string), it will also be set onto the system clipboard, otherwise, the system clipboard will be cleared.
func (*Clipboard) SetMultipleData ¶
func (c *Clipboard) SetMultipleData(pairs []ClipboardData)
SetMultipleData sets the data for multiple types onto the application clipboard, clearing out any others that were previously present. The first one that is convertable to text via .(string) will be used to set the system clipboard value. If none is found, then the system clipboard will be cleared.
type ClipboardData ¶
type ClipboardData struct { Type string Data interface{} }
ClipboardData holds a type and data pair.
type Color ¶
type Color uint32
Color contains the value of a color used for drawing, stored as 0xAARRGGBB.
func ARGB ¶
ARGB creates a new Color from RGB values in the range 0-255 and an alpha value in the range 0-1.
func ColorDecode ¶
ColorDecode creates a Color from a string. The string may be in any of the standard CSS formats:
- CSS predefined color name, e.g. "Yellow" - CSS rgb(), e.g. "rgb(255, 255, 0)" - CSS rgba(), e.g. "rgba(255, 255, 0, 0.3)" - CSS short hexadecimal colors, e.g. "#FF0" - CSS long hexadecimal colors, e.g. "#FFFF00" - CCS hsl(), e.g. "hsl(120, 100%, 50%)" - CSS hsla(), e.g. "hsla(120, 100%, 50%, 0.3)"
func MustColorDecode ¶ added in v0.4.0
MustColorDecode is the same as ColorDecode(), but returns Black if an error occurs.
func (Color) AdjustBrightness ¶
AdjustBrightness creates a new color from this color with its brightness adjusted by the specified amount.
func (Color) AdjustHue ¶
AdjustHue creates a new color from this color with its hue adjusted by the specified amount.
func (Color) AdjustSaturation ¶
AdjustSaturation creates a new color from this color with its saturation adjusted by the specified amount.
func (Color) AlphaIntensity ¶
AlphaIntensity returns the alpha channel, in the range of 0-1.
func (Color) Blend ¶
Blend blends this color with another color. pct is the amount of the other color to use.
func (Color) BlueIntensity ¶
BlueIntensity returns the blue channel, in the range of 0-1.
func (Color) Brightness ¶
Brightness of the color, a value from 0-1.
func (Color) GetColor ¶ added in v0.2.0
GetColor returns this Color. Here to satisfy the ColorProvider interface.
func (Color) GreenIntensity ¶
GreenIntensity returns the green channel, in the range of 0-1.
func (Color) HSB ¶
HSB returns the hue, saturation and brightness of the color. Values are in the range 0-1.
func (Color) Luminance ¶
Luminance returns a value from 0-1 representing the perceived brightness. Lower values represent darker colors, while higher values represent brighter colors.
func (Color) MarshalText ¶
MarshalText implements encoding.TextMarshaler.
func (Color) Monochrome ¶
Monochrome returns true if each color component is the same, making it a shade of gray.
func (Color) Premultiply ¶
Premultiply multiplies the color channels by the alpha channel.
func (Color) RGBA ¶
RGBA implements color.Color. Assumes the color is not premultiplied and must be premultiplied to meet the contract of color.Color.
func (Color) RedIntensity ¶
RedIntensity returns the red channel, in the range of 0-1.
func (Color) Saturation ¶
Saturation of the color, a value from 0-1.
func (Color) SetAlpha ¶
SetAlpha returns a new color based on this color, but with the alpha channel replaced.
func (Color) SetAlphaIntensity ¶
SetAlphaIntensity returns a new color based on this color, but with the alpha channel replaced.
func (Color) SetBlue ¶
SetBlue returns a new color based on this color, but with the blue channel replaced.
func (Color) SetBlueIntensity ¶
SetBlueIntensity returns a new color based on this color, but with the blue channel replaced.
func (Color) SetBrightness ¶
SetBrightness creates a new color from this color with the specified brightness.
func (Color) SetGreen ¶
SetGreen returns a new color based on this color, but with the green channel replaced.
func (Color) SetGreenIntensity ¶
SetGreenIntensity returns a new color based on this color, but with the green channel replaced.
func (Color) SetHue ¶
SetHue creates a new color from this color with the specified hue, a value from 0-1.
func (Color) SetRed ¶
SetRed returns a new color based on this color, but with the red channel replaced.
func (Color) SetRedIntensity ¶
SetRedIntensity returns a new color based on this color, but with the red channel replaced.
func (Color) SetSaturation ¶
SetSaturation creates a new color from this color with the specified saturation.
func (Color) String ¶
String implements the fmt.Stringer interface. The output can be used as a color in CSS.
func (*Color) UnmarshalText ¶
UnmarshalText implements encoding.TextUnmarshaler.
func (Color) Unpremultiply ¶
Unpremultiply divides the color channels by the alpha channel, effectively undoing a Premultiply call. Note that you will not necessarily get the original value back after calling Premultiply followed by Unpremultiply.
type ColorChannel ¶
type ColorChannel byte
ColorChannel specifies a specific channel within an RGBA color.
const ( RedChannel ColorChannel = iota GreenChannel BlueChannel AlphaChannel )
Possible values for ColorChannel.
type ColorFilter ¶
type ColorFilter struct {
// contains filtered or unexported fields
}
ColorFilter is called with source colors and return new colors, which are then passed onto the next stage.
func Grayscale30PercentFilter ¶ added in v0.3.0
func Grayscale30PercentFilter() *ColorFilter
Grayscale30PercentFilter returns a ColorFilter that transforms colors to grayscale and applies a 30% alpha blend.
func NewARGBTableColorFilter ¶
func NewARGBTableColorFilter(a, r, g, b []byte) *ColorFilter
NewARGBTableColorFilter returns a new ARGB table color filter. Each of a, r, g, and b should be 256 bytes long. If shorter than that, they will be expanded to 256 and the new locations will be set to 0.
func NewAlphaFilter ¶ added in v0.4.0
func NewAlphaFilter(alpha float32) *ColorFilter
NewAlphaFilter returns a new ColorFilter that applies an alpha blend.
func NewBlendColorFilter ¶
func NewBlendColorFilter(color Color, blendMode BlendMode) *ColorFilter
NewBlendColorFilter returns a new blend color filter.
func NewComposeColorFilter ¶
func NewComposeColorFilter(outer, inner *ColorFilter) *ColorFilter
NewComposeColorFilter returns a new color filter that combines two other color filters.
func NewHighContrastColorFilter ¶
func NewHighContrastColorFilter(contrast float32, style InvertStyle, grayscale bool) *ColorFilter
NewHighContrastColorFilter returns a new high contrast color filter.
func NewLightingColorFilter ¶
func NewLightingColorFilter(mul, add Color) *ColorFilter
NewLightingColorFilter returns a new lighting color filter.
func NewLumaColorFilter ¶
func NewLumaColorFilter() *ColorFilter
NewLumaColorFilter returns a new luma color filter.
func NewMatrixColorFilter ¶
func NewMatrixColorFilter(array []float32) *ColorFilter
NewMatrixColorFilter returns a new matrix color filter. array should be 20 long. If smaller, it will be filled with zeroes to make it 20.
type ColorProvider ¶ added in v0.2.0
type ColorProvider interface {
GetColor() Color
}
ColorProvider allows for different types of objects that hold a color to be used interchangeably.
type ColumnSize ¶ added in v0.3.0
type ColumnSize struct { Current float32 Minimum float32 Maximum float32 AutoMinimum float32 AutoMaximum float32 }
ColumnSize holds the column sizing information.
type CompoundBorder ¶
type CompoundBorder struct {
// contains filtered or unexported fields
}
CompoundBorder provides stacking of borders together.
func NewCompoundBorder ¶
func NewCompoundBorder(borders ...Border) *CompoundBorder
NewCompoundBorder creates a border that contains other borders. The first one will be drawn in the outermost position, with each successive one moving further into the interior.
func (*CompoundBorder) Draw ¶
func (b *CompoundBorder) Draw(canvas *Canvas, rect geom32.Rect)
Draw the border into rect.
func (*CompoundBorder) Insets ¶
func (b *CompoundBorder) Insets() geom32.Insets
Insets returns the insets describing the space the border occupies on each side.
type CubicResampler ¶
CubicResampler holds the parameters for cubic resampling.
func CatmullRomResampler ¶
func CatmullRomResampler() CubicResampler
CatmullRomResampler is the standard "Catmull-Rom" filter.
func MitchellResampler ¶
func MitchellResampler() CubicResampler
MitchellResampler is the standard "Mitchell" filter.
type Cursor ¶
Cursor provides a graphical cursor for the mouse location.
func MoveCursor ¶ added in v0.5.0
func MoveCursor() *Cursor
MoveCursor returns the standard move cursor.
func ResizeHorizontalCursor ¶ added in v0.5.0
func ResizeHorizontalCursor() *Cursor
ResizeHorizontalCursor returns the standard horizontal resize cursor.
func ResizeLeftDiagonalCursor ¶ added in v0.5.0
func ResizeLeftDiagonalCursor() *Cursor
ResizeLeftDiagonalCursor returns the standard left diagonal resize cursor.
func ResizeRightDiagonalCursor ¶ added in v0.5.0
func ResizeRightDiagonalCursor() *Cursor
ResizeRightDiagonalCursor returns the standard right diagonal resize cursor.
func ResizeVerticalCursor ¶ added in v0.5.0
func ResizeVerticalCursor() *Cursor
ResizeVerticalCursor returns the standard vertical resize cursor.
type DarkModeTracking ¶
type DarkModeTracking uint8
DarkModeTracking holds the current dark mode control setting.
const ( DarkModeForcedOff DarkModeTracking = iota DarkModeForcedOn DarkModeTrackPlatform )
Possible values for DarkModeTracking.
func CurrentDarkModeTracking ¶
func CurrentDarkModeTracking() DarkModeTracking
CurrentDarkModeTracking returns the current DarkModeTracking state.
type DefaultCellFactory ¶
type DefaultCellFactory struct {
Height float32
}
DefaultCellFactory provides a simple implementation of a CellFactory that uses Labels for its cells.
func (*DefaultCellFactory) CellHeight ¶
func (f *DefaultCellFactory) CellHeight() float32
CellHeight implements CellFactory.
func (*DefaultCellFactory) CreateCell ¶
func (f *DefaultCellFactory) CreateCell(owner Paneler, element interface{}, index int, foreground Ink, selected, focused bool) *Panel
CreateCell implements CellFactory.
type DefaultTableColumnHeader ¶ added in v0.3.0
type DefaultTableColumnHeader struct { Label // contains filtered or unexported fields }
DefaultTableColumnHeader provides a default table column header panel.
func NewTableColumnHeader ¶ added in v0.3.0
func NewTableColumnHeader(title string) *DefaultTableColumnHeader
NewTableColumnHeader creates a new table column header panel with the given title.
func (*DefaultTableColumnHeader) DefaultDraw ¶ added in v0.7.0
func (h *DefaultTableColumnHeader) DefaultDraw(canvas *Canvas, dirty geom32.Rect)
DefaultDraw provides the default drawing.
func (*DefaultTableColumnHeader) DefaultMouseUp ¶ added in v0.3.0
func (h *DefaultTableColumnHeader) DefaultMouseUp(where geom32.Point, button int, mod Modifiers) bool
DefaultMouseUp provides the default mouse up handling.
func (*DefaultTableColumnHeader) DefaultSizes ¶ added in v0.7.0
func (h *DefaultTableColumnHeader) DefaultSizes(hint geom32.Size) (min, pref, max geom32.Size)
DefaultSizes provides the default sizing.
func (*DefaultTableColumnHeader) SetSortState ¶ added in v0.3.0
func (h *DefaultTableColumnHeader) SetSortState(state SortState)
SetSortState sets the SortState.
func (*DefaultTableColumnHeader) SortState ¶ added in v0.3.0
func (h *DefaultTableColumnHeader) SortState() SortState
SortState returns the current SortState.
type Dialog ¶
type Dialog struct {
// contains filtered or unexported fields
}
Dialog holds information about a dialog.
func NewDialog ¶
func NewDialog(icon Drawable, iconInk Ink, msgPanel Paneler, buttonInfo []*DialogButtonInfo) (*Dialog, error)
NewDialog creates a new standard dialog. To show the dialog you must call .RunModal() on the returned dialog.
func (*Dialog) RunModal ¶
RunModal displays and brings this dialog to the front, the runs a modal event loop until StopModal is called. Disposes the dialog before it returns.
type DialogButtonInfo ¶
DialogButtonInfo holds information for constructing the dialog button panel.
func NewCancelButtonInfo ¶
func NewCancelButtonInfo() *DialogButtonInfo
NewCancelButtonInfo creates a standard cancel button.
func NewOKButtonInfo ¶
func NewOKButtonInfo() *DialogButtonInfo
NewOKButtonInfo creates a standard OK button.
func NewOKButtonInfoWithTitle ¶
func NewOKButtonInfoWithTitle(title string) *DialogButtonInfo
NewOKButtonInfoWithTitle creates a standard OK button with a specific title.
func (*DialogButtonInfo) NewButton ¶
func (bi *DialogButtonInfo) NewButton(d *Dialog) *Button
NewButton creates a new button for the dialog.
type DialogTheme ¶ added in v0.5.0
type DialogTheme struct { ErrorIcon Drawable ErrorIconInk Ink WarningIcon Drawable WarningIconInk Ink QuestionIcon Drawable QuestionIconInk Ink }
DialogTheme holds theming data for a Dialog.
type Display ¶
type Display struct { Name string // The name of the display Frame geom32.Rect // The position of the display in the global screen coordinate system Usable geom32.Rect // The usable area, i.e. the Frame minus the area used by global menu bars or task bars ScaleX float32 // The horizontal scale of content ScaleY float32 // The vertical scale of content RefreshRate int // The refresh rate, in Hz WidthMM int // The display's physical width, in millimeters HeightMM int // The display's physical height, in millimeters }
Display holds information about each available active display.
type Dock ¶ added in v0.3.0
type Dock struct { Panel DockTheme MaximizedContainer *DockContainer DragKey string // contains filtered or unexported fields }
Dock provides an area where Dockable panels can be displayed and rearranged.
func (*Dock) DefaultDataDragExit ¶ added in v0.3.0
func (d *Dock) DefaultDataDragExit()
DefaultDataDragExit provides the default data drag exit handling.
func (*Dock) DefaultDataDragOver ¶ added in v0.3.0
DefaultDataDragOver provides the default data drag over handling.
func (*Dock) DefaultDataDrop ¶ added in v0.3.0
DefaultDataDrop provides the default data drop handling.
func (*Dock) DefaultDraw ¶ added in v0.3.0
DefaultDraw fills in the background.
func (*Dock) DefaultDrawOver ¶ added in v0.3.0
DefaultDrawOver draws the dividers and any drag markers.
func (*Dock) DefaultFocusChangeInHierarchy ¶ added in v0.3.0
DefaultFocusChangeInHierarchy marks the dock for redraw whenever the focus changes within it so that the tabs get the correct highlight state.
func (*Dock) DefaultMouseDown ¶ added in v0.3.0
DefaultMouseDown provides the default mouse down handling.
func (*Dock) DefaultMouseDrag ¶ added in v0.3.0
DefaultMouseDrag provides the default mouse drag handling.
func (*Dock) DefaultMouseUp ¶ added in v0.3.0
DefaultMouseUp provides the default mouse up handling.
func (*Dock) DefaultUpdateCursor ¶ added in v0.3.0
DefaultUpdateCursor adjusts the cursor for any dividers it may be over.
func (*Dock) DockDividerSize ¶ added in v0.3.0
DockDividerSize returns the size (running across the divider) of a divider.
func (*Dock) DockGripLength ¶ added in v0.3.0
DockGripLength returns the length (running along the divider) of a divider's grip area.
func (*Dock) DockTo ¶ added in v0.3.0
func (d *Dock) DockTo(dockable Dockable, target DockLayoutNode, side Side)
DockTo a Dockable within this Dock. If the Dockable already exists in this Dock, it will be moved to the new location. nil may be passed in for the target, in which case the top-most layout is used.
func (*Dock) Maximize ¶ added in v0.3.0
func (d *Dock) Maximize(dc *DockContainer)
Maximize the current Dockable.
func (*Dock) NextDockableFor ¶ added in v0.5.0
NextDockableFor returns the logical next Dockable in the Dock given the one passed in as a starting point. The returned value may be the same as the starting point if there are no other Dockables. Passing in nil will result in the first Dockable found being returned.
func (*Dock) PreviousDockableFor ¶ added in v0.5.0
PreviousDockableFor returns the logical previous Dockable in the Dock given the one passed in as a starting point. The returned value may be the same as the starting point if there are no other Dockables. Passing in nil will result in the last Dockable found being returned.
func (*Dock) Restore ¶ added in v0.3.0
func (d *Dock) Restore()
Restore the current Dockable to its non-maximized state.
func (*Dock) RootDockLayout ¶ added in v0.4.0
func (d *Dock) RootDockLayout() *DockLayout
RootDockLayout returns the root DockLayout.
type DockContainer ¶ added in v0.3.0
DockContainer holds one or more Dockable panels.
func DockContainerFor ¶ added in v0.3.0
func DockContainerFor(paneler Paneler) *DockContainer
DockContainerFor returns the DockContainer that holds the given Paneler in its hierarchy. May return nil.
func FocusedDockContainerFor ¶ added in v0.3.0
func FocusedDockContainerFor(wnd *Window) *DockContainer
FocusedDockContainerFor returns the DockContainer that holds the panel with the current focus in the given Window. May return nil.
func NewDockContainer ¶ added in v0.3.0
func NewDockContainer(dock *Dock, dockable Dockable) *DockContainer
NewDockContainer creates a new DockContainer.
func (*DockContainer) AcquireFocus ¶ added in v0.3.0
func (d *DockContainer) AcquireFocus()
AcquireFocus will set the focus within the current Dockable of this DockContainer. If the focus is already within it, nothing is changed.
func (*DockContainer) AttemptClose ¶ added in v0.3.0
func (d *DockContainer) AttemptClose(dockable Dockable)
AttemptClose attempts to close a Dockable within this DockContainer. This only has an affect if the Dockable is contained by this DockContainer and implements the TabCloser interface. Note that the TabCloser must call this DockContainer's close(Dockable) method to actually close the tab.
func (*DockContainer) Close ¶ added in v0.3.0
func (d *DockContainer) Close(dockable Dockable)
Close the specified Dockable. If the last Dockable within this DockContainer is closed, then this DockContainer is also removed from the Dock.
func (*DockContainer) CurrentDockable ¶ added in v0.3.0
func (d *DockContainer) CurrentDockable() Dockable
CurrentDockable returns the frontmost Dockable within this DockContainer. May return nil.
func (*DockContainer) CurrentDockableIndex ¶ added in v0.3.0
func (d *DockContainer) CurrentDockableIndex() int
CurrentDockableIndex returns the index of the frontmost Dockable within this DockContainer, or -1 if there are no Dockables.
func (*DockContainer) Dockables ¶ added in v0.3.0
func (d *DockContainer) Dockables() []Dockable
Dockables returns the list of Dockables within this DockContainer, in tab order.
func (*DockContainer) LayoutSizes ¶ added in v0.3.0
LayoutSizes implements Layout.
func (*DockContainer) PerformLayout ¶ added in v0.3.0
func (d *DockContainer) PerformLayout(target *Panel)
PerformLayout implements Layout.
func (*DockContainer) PreferredSize ¶ added in v0.3.0
func (d *DockContainer) PreferredSize() geom32.Size
PreferredSize implements DockLayoutNode.
func (*DockContainer) SetCurrentDockable ¶ added in v0.3.0
func (d *DockContainer) SetCurrentDockable(dockable Dockable)
SetCurrentDockable makes the provided dockable the current one.
func (*DockContainer) Stack ¶ added in v0.3.0
func (d *DockContainer) Stack(dockable Dockable, index int)
Stack adds the Dockable to this DockContainer at the specified index. An out-of-bounds index will cause the Dockable to be added at the end.
func (*DockContainer) UpdateTitle ¶ added in v0.3.0
func (d *DockContainer) UpdateTitle(dockable Dockable)
UpdateTitle will cause the dock tab for the given Dockable to update itself.
type DockHeaderTheme ¶ added in v0.4.0
type DockHeaderTheme struct { BackgroundInk Ink DropAreaInk Ink HeaderBorder Border MinimumTabWidth float32 TabGap float32 TabInsertSize float32 }
DockHeaderTheme holds theming data for a DockHeader.
type DockLayout ¶ added in v0.3.0
type DockLayout struct { Horizontal bool // contains filtered or unexported fields }
DockLayout provides layout of DockContainers and other DockLayouts within a Dock.
func (*DockLayout) Contains ¶ added in v0.3.0
func (d *DockLayout) Contains(node DockLayoutNode) bool
Contains returns true if the node is this DockLayout or one of its descendants.
func (*DockLayout) DividerMaximum ¶ added in v0.3.0
func (d *DockLayout) DividerMaximum() float32
DividerMaximum returns the maximum value the divider can be set to. Will always return 0 if Full() returns false.
func (*DockLayout) DividerPosition ¶ added in v0.3.0
func (d *DockLayout) DividerPosition() float32
DividerPosition returns the current divider position.
func (*DockLayout) DockTo ¶ added in v0.3.0
func (d *DockLayout) DockTo(dc *DockContainer, target DockLayoutNode, side Side)
DockTo docks a DockContainer within this DockLayout. If the DockContainer already exists in this DockLayout, it will be moved to the new location.
func (*DockLayout) Empty ¶ added in v0.3.0
func (d *DockLayout) Empty() bool
Empty returns true if this DockLayout has no children.
func (*DockLayout) FindLayout ¶ added in v0.3.0
func (d *DockLayout) FindLayout(dc *DockContainer) *DockLayout
FindLayout returns the DockLayout that contains the specified DockContainer, or nil if it is not present. Note that this method will always start at the root and work its way down, even if called on a sub-node.
func (*DockLayout) ForEachDockContainer ¶ added in v0.4.0
func (d *DockLayout) ForEachDockContainer(f func(*DockContainer) bool)
ForEachDockContainer iterates through all DockContainers in this DockLayout's hierarchy and calls the given function with them. The function should return true to stop further processing.
func (*DockLayout) FrameRect ¶ added in v0.3.0
func (d *DockLayout) FrameRect() geom32.Rect
FrameRect implements DockLayoutNode.
func (*DockLayout) Full ¶ added in v0.3.0
func (d *DockLayout) Full() bool
Full returns true if both child nodes of this DockLayout are occupied.
func (*DockLayout) LayoutSizes ¶ added in v0.3.0
LayoutSizes implements Layout.
func (*DockLayout) PerformLayout ¶ added in v0.3.0
func (d *DockLayout) PerformLayout(_ *Panel)
PerformLayout implements Layout.
func (*DockLayout) PreferredSize ¶ added in v0.3.0
func (d *DockLayout) PreferredSize() geom32.Size
PreferredSize implements DockLayoutNode.
func (*DockLayout) RawDividerPosition ¶ added in v0.3.0
func (d *DockLayout) RawDividerPosition() float32
RawDividerPosition returns the divider position, unadjusted for the current content.
func (*DockLayout) Remove ¶ added in v0.3.0
func (d *DockLayout) Remove(node DockLayoutNode) bool
Remove a node. Returns true if the node was found and removed.
func (*DockLayout) RootLayout ¶ added in v0.3.0
func (d *DockLayout) RootLayout() *DockLayout
RootLayout returns the topmost parent DockLayout.
func (*DockLayout) SetDividerPosition ¶ added in v0.3.0
func (d *DockLayout) SetDividerPosition(pos float32)
SetDividerPosition sets the new divider position. Use a value less than 0 to reset the divider to its default mode, which splits the available space evenly between the children.
func (*DockLayout) SetFrameRect ¶ added in v0.3.0
func (d *DockLayout) SetFrameRect(r geom32.Rect)
SetFrameRect implements DockLayoutNode.
type DockLayoutNode ¶ added in v0.3.0
type DockLayoutNode interface { PreferredSize() geom32.Size FrameRect() geom32.Rect SetFrameRect(r geom32.Rect) }
DockLayoutNode defines the methods for nodes within a DockLayout.
type DockTabTheme ¶ added in v0.4.0
type DockTabTheme struct { BackgroundInk Ink OnBackgroundInk Ink EdgeInk Ink TabFocusedInk Ink OnTabFocusedInk Ink TabCurrentInk Ink OnTabCurrentInk Ink TabBorder Border Gap float32 LabelTheme LabelTheme ButtonTheme ButtonTheme }
DockTabTheme holds theming data for a DockTab.
type DockTheme ¶ added in v0.4.0
type DockTheme struct { BackgroundInk Ink GripInk Ink DropAreaInk Ink GripCount int GripGap float32 GripWidth float32 GripHeight float32 GripMargin float32 }
DockTheme holds theming data for a Dock.
type Dockable ¶ added in v0.3.0
type Dockable interface { Paneler // TitleIcon returns an Drawable representing this Dockable. TitleIcon(suggestedSize geom32.Size) Drawable // Title returns the title of this Dockable. Title() string // Tooltip returns the tooltip of this Dockable. Tooltip() string // Modified returns true if the dockable has been modified. Modified() bool }
Dockable represents a dockable Panel.
func DockableFromDragData ¶ added in v0.3.0
DockableFromDragData attempts to extract a Dockable from the given key in the data.
type DragData ¶ added in v0.3.0
type DragData struct { Data map[string]interface{} Drawable Drawable SamplingOptions *SamplingOptions Ink Ink Offset geom32.Point }
DragData holds data drag information.
type Drawable ¶ added in v0.3.0
type Drawable interface { // LogicalSize returns the logical size of this object. LogicalSize() geom32.Size // DrawInRect draws this object in the given rectangle. DrawInRect(canvas *Canvas, rect geom32.Rect, sampling *SamplingOptions, paint *Paint) }
Drawable represents a drawable object.
type DrawableSVG ¶ added in v0.3.0
DrawableSVG makes an SVG conform to the Drawable interface.
func (*DrawableSVG) DrawInRect ¶ added in v0.3.0
func (s *DrawableSVG) DrawInRect(canvas *Canvas, rect geom32.Rect, _ *SamplingOptions, paint *Paint)
DrawInRect implements the Drawable interface.
func (*DrawableSVG) LogicalSize ¶ added in v0.3.0
func (s *DrawableSVG) LogicalSize() geom32.Size
LogicalSize implements the Drawable interface.
type DynamicColor ¶
DynamicColor holds a color that may be changed.
func NewDynamicColor ¶
func NewDynamicColor(rebuilder func() Color) *DynamicColor
NewDynamicColor creates a new DynamicColor and registers it for theme updates. If your color relies on another dynamic color to calculate its value, make sure it is created *after* the colors it relies on, since all dynamic colors are rebuilt in the order they were created.
func (*DynamicColor) GetColor ¶ added in v0.2.0
func (c *DynamicColor) GetColor() Color
GetColor returns the current color. Here to satisfy the ColorProvider interface.
func (*DynamicColor) Paint ¶
func (c *DynamicColor) Paint(canvas *Canvas, rect geom32.Rect, style PaintStyle) *Paint
Paint returns a Paint for this DynamicColor. Here to satisfy the Ink interface.
func (*DynamicColor) Unregister ¶
func (c *DynamicColor) Unregister()
Unregister removes this DynamicColor from participating in rebuilds via RebuildDynamicColors.
type DynamicFont ¶
type DynamicFont struct { Resolver func() FontDescriptor // contains filtered or unexported fields }
DynamicFont holds a Font that can be dynamically adjusted.
func (*DynamicFont) Baseline ¶ added in v0.4.0
func (f *DynamicFont) Baseline() float32
Baseline implements Font.
func (*DynamicFont) Descriptor ¶ added in v0.4.0
func (f *DynamicFont) Descriptor() FontDescriptor
Descriptor implements Font.
func (*DynamicFont) Face ¶ added in v0.4.0
func (f *DynamicFont) Face() *FontFace
Face implements Font.
func (*DynamicFont) GlyphWidth ¶ added in v0.7.0
func (f *DynamicFont) GlyphWidth(glyph uint16) float32
GlyphWidth implements Font.
func (*DynamicFont) GlyphWidths ¶ added in v0.7.0
func (f *DynamicFont) GlyphWidths(glyphs []uint16) []float32
GlyphWidths implements Font.
func (*DynamicFont) LineHeight ¶ added in v0.4.0
func (f *DynamicFont) LineHeight() float32
LineHeight implements Font.
func (*DynamicFont) Metrics ¶ added in v0.4.0
func (f *DynamicFont) Metrics() FontMetrics
Metrics implements Font.
func (*DynamicFont) RuneToGlyph ¶ added in v0.7.0
func (f *DynamicFont) RuneToGlyph(r rune) uint16
RuneToGlyph implements Font.
func (*DynamicFont) RunesToGlyphs ¶ added in v0.7.0
func (f *DynamicFont) RunesToGlyphs(r []rune) []uint16
RunesToGlyphs implements Font.
func (*DynamicFont) SimpleWidth ¶ added in v0.7.0
func (f *DynamicFont) SimpleWidth(str string) float32
SimpleWidth implements Font.
func (*DynamicFont) Size ¶ added in v0.4.0
func (f *DynamicFont) Size() float32
Size implements Font.
type EmptyBorder ¶
type EmptyBorder struct {
// contains filtered or unexported fields
}
EmptyBorder provides and empty border with the specified insets.
func NewEmptyBorder ¶
func NewEmptyBorder(insets geom32.Insets) *EmptyBorder
NewEmptyBorder creates a new empty border with the specified insets.
func (*EmptyBorder) Draw ¶
func (b *EmptyBorder) Draw(_ *Canvas, _ geom32.Rect)
Draw the border into rect.
func (*EmptyBorder) Insets ¶
func (b *EmptyBorder) Insets() geom32.Insets
Insets returns the insets describing the space the border occupies on each side.
type EncodedImageFormat ¶
type EncodedImageFormat byte
EncodedImageFormat holds the type of encoding an image was stored with.
const ( BMP EncodedImageFormat = iota GIF ICO JPEG PNG WBMP WEBP UnknownEncodedImageFormat EncodedImageFormat = 255 )
Possible values for EncodedImageFormat.
func EncodedImageFormatForPath ¶
func EncodedImageFormatForPath(p string) EncodedImageFormat
EncodedImageFormatForPath returns the EncodedImageFormat associated with the extension of the given path.
func (EncodedImageFormat) CanRead ¶
func (e EncodedImageFormat) CanRead() bool
CanRead returns true if the format can be read.
func (EncodedImageFormat) CanWrite ¶
func (e EncodedImageFormat) CanWrite() bool
CanWrite returns true if the format can be written.
func (EncodedImageFormat) Extension ¶
func (e EncodedImageFormat) Extension() string
Extension returns the primary extension for the format. An unknown / invalid format will return "\x00invalid".
func (EncodedImageFormat) Extensions ¶
func (e EncodedImageFormat) Extensions() []string
Extensions returns the list of valid extensions for the format. An unknown / invalid format will return nil.
func (EncodedImageFormat) String ¶
func (e EncodedImageFormat) String() string
type Field ¶
type Field struct { Panel FieldTheme ModifiedCallback func() ValidateCallback func() bool Watermark string // contains filtered or unexported fields }
Field provides a single-line text input control.
func (*Field) CanPaste ¶
CanPaste returns true if the clipboard has content that can be pasted into the field.
func (*Field) CanSelectAll ¶
CanSelectAll returns true if the field's selection can be expanded.
func (*Field) DefaultCanPerformCmd ¶
DefaultCanPerformCmd provides the default can perform command handling.
func (*Field) DefaultDraw ¶
DefaultDraw provides the default drawing.
func (*Field) DefaultFocusGained ¶
func (f *Field) DefaultFocusGained()
DefaultFocusGained provides the default focus gained handling.
func (*Field) DefaultFocusLost ¶
func (f *Field) DefaultFocusLost()
DefaultFocusLost provides the default focus lost handling.
func (*Field) DefaultKeyDown ¶
DefaultKeyDown provides the default key down handling.
func (*Field) DefaultMouseDown ¶
DefaultMouseDown provides the default mouse down handling.
func (*Field) DefaultMouseDrag ¶
DefaultMouseDrag provides the default mouse drag handling.
func (*Field) DefaultPerformCmd ¶
DefaultPerformCmd provides the default perform command handling.
func (*Field) DefaultRuneTyped ¶
DefaultRuneTyped provides the default rune typed handling.
func (*Field) DefaultSizes ¶
DefaultSizes provides the default sizing.
func (*Field) DefaultUpdateCursor ¶
DefaultUpdateCursor provides the default cursor update handling.
func (*Field) FromSelectionIndex ¶
FromSelectionIndex returns a location in local coordinates for the specified rune index.
func (*Field) HasSelectionRange ¶
HasSelectionRange returns true is a selection range is currently present.
func (*Field) RunesIfPasted ¶ added in v0.9.0
RunesIfPasted returns the resulting runes if the given input was pasted into the field.
func (*Field) ScrollOffset ¶
ScrollOffset returns the current autoscroll offset.
func (*Field) SelectAll ¶
func (f *Field) SelectAll()
SelectAll selects all of the text in the field.
func (*Field) SelectedText ¶
SelectedText returns the currently selected text.
func (*Field) SelectionCount ¶
SelectionCount returns the number of characters currently selected.
func (*Field) SetScrollOffset ¶
SetScrollOffset sets the autoscroll offset to the specified value.
func (*Field) SetSelection ¶
SetSelection sets the start and end range of the selection. Values beyond either end will be constrained to the appropriate end. Likewise, an end value less than the start value will be treated as if the start and end values were the same.
func (*Field) SetSelectionTo ¶
SetSelectionTo moves the cursor to the specified index and removes any range that may have been present.
func (*Field) SetSelectionToEnd ¶
func (f *Field) SetSelectionToEnd()
SetSelectionToEnd moves the cursor to the end of the text and removes any range that may have been present.
func (*Field) SetSelectionToStart ¶
func (f *Field) SetSelectionToStart()
SetSelectionToStart moves the cursor to the beginning of the text and removes any range that may have been present.
func (*Field) ToSelectionIndex ¶
ToSelectionIndex returns the rune index for the specified x-coordinate.
type FieldTheme ¶ added in v0.4.0
type FieldTheme struct { Font Font BackgroundInk Ink OnBackgroundInk Ink EditableInk Ink OnEditableInk Ink SelectionInk Ink OnSelectionInk Ink ErrorInk Ink OnErrorInk Ink FocusedBorder Border UnfocusedBorder Border BlinkRate time.Duration MinimumTextWidth float32 HAlign Alignment }
FieldTheme holds theming data for a Field.
type FillType ¶
type FillType byte
FillType holds the type of fill operation to perform, which affects how overlapping contours interact with each other.
type FilterMode ¶
type FilterMode int32
FilterMode holds the type of sampling to be done.
const ( FilterModeNearest FilterMode = iota // single sample point (nearest neighbor) FilterModeLinear // interporate between 2x2 sample points (bilinear interpolation) )
Possible values for FilterMode.
type FilterQuality ¶
type FilterQuality byte
FilterQuality holds the image filtering level. Lower settings draw faster, while higher settings look better when the image is scaled.
const ( NoQuality FilterQuality = iota LowQuality MediumQuality HighQuality )
Possible values for FilterQuality.
type FlexLayout ¶
type FlexLayout struct { Columns int HSpacing float32 VSpacing float32 HAlign Alignment VAlign Alignment EqualColumns bool // contains filtered or unexported fields }
FlexLayout lays out the children of its Layoutable based on the FlexLayoutData assigned to each child.
func (*FlexLayout) LayoutSizes ¶
LayoutSizes implements the Layout interface.
func (*FlexLayout) PerformLayout ¶
func (f *FlexLayout) PerformLayout(target *Panel)
PerformLayout implements the Layout interface.
type FlexLayoutData ¶
type FlexLayoutData struct { SizeHint geom32.Size MinSize geom32.Size HSpan int VSpan int HAlign Alignment VAlign Alignment HGrab bool VGrab bool // contains filtered or unexported fields }
FlexLayoutData is used to control how an object is laid out by the FlexLayout layout.
type FlowLayout ¶
FlowLayout is a Layout that lays components out left to right, then top to bottom.
func (*FlowLayout) LayoutSizes ¶
LayoutSizes implements Layout.
func (*FlowLayout) PerformLayout ¶
func (f *FlowLayout) PerformLayout(target *Panel)
PerformLayout implements Layout.
type Font ¶
type Font interface { // Face returns the FontFace this Font belongs to. Face() *FontFace // Size returns the size of the font. This is the value that was passed to FontFace.Font() when creating the font. Size() float32 // Metrics returns a copy of the FontMetrics for this font. Metrics() FontMetrics // Baseline returns the number of logical pixels to the bottom of characters without descenders. Baseline() float32 // LineHeight returns the recommended line height of the font. LineHeight() float32 // RuneToGlyph converts a rune into a glyph. Missing glyphs will have a value of 0. RuneToGlyph(r rune) uint16 // RunesToGlyphs converts the runes into glyphs. Missing glyphs will have a value of 0. RunesToGlyphs(r []rune) []uint16 // GlyphWidth returns the width for the glyph. This does not do font fallback for missing glyphs. GlyphWidth(glyph uint16) float32 // GlyphWidths returns the widths for each glyph. This does not do font fallback for missing glyphs. GlyphWidths(glyphs []uint16) []float32 // SimpleWidth returns the width of a string. It does not do font fallback, nor does it consider tabs or line // endings. SimpleWidth(str string) float32 // Descriptor returns a FontDescriptor for this Font. Descriptor() FontDescriptor // contains filtered or unexported methods }
Font holds a realized FontFace of a specific size that can be used to render text.
type FontDescriptor ¶
type FontDescriptor struct { Family string `json:"family"` Size float32 `json:"size"` Weight FontWeight `json:"weight"` Spacing FontSpacing `json:"spacing"` Slant FontSlant `json:"slant"` }
FontDescriptor holds information necessary to construct a Font. The Size field is the value that was passed to FontFace.Font() when creating the font.
func FontDescriptorFromString ¶
func FontDescriptorFromString(str string) (FontDescriptor, error)
FontDescriptorFromString extracts the FontDescriptor from a string.
func RegisterFont ¶
func RegisterFont(data []byte) (*FontDescriptor, error)
RegisterFont registers a font with the font manager.
func (FontDescriptor) Face ¶
func (fd FontDescriptor) Face() *FontFace
Face returns the matching FontFace, if any.
func (FontDescriptor) Font ¶
func (fd FontDescriptor) Font() Font
Font returns the matching Font. If the specified font family cannot be found, the DefaultSystemFamilyName will be substituted.
func (FontDescriptor) MarshalText ¶
func (fd FontDescriptor) MarshalText() (text []byte, err error)
MarshalText implements the encoding.TextMarshaler interface.
func (*FontDescriptor) String ¶
func (fd *FontDescriptor) String() string
func (*FontDescriptor) UnmarshalText ¶
func (fd *FontDescriptor) UnmarshalText(text []byte) error
UnmarshalText implements the encoding.TextUnmarshaler interface.
type FontFace ¶
type FontFace struct {
// contains filtered or unexported fields
}
FontFace holds the immutable portions of a font description.
func CreateFontFace ¶
CreateFontFace creates a new FontFace from font data.
func MatchFontFace ¶
func MatchFontFace(family string, weight FontWeight, spacing FontSpacing, slant FontSlant) *FontFace
MatchFontFace attempts to locate the FontFace with the given family and style. Will return nil if nothing suitable can be found.
func (*FontFace) FallbackForCharacter ¶ added in v0.7.0
FallbackForCharacter attempts to locate the FontFace that best matches this FontFace and has the given character. Will return nil if nothing suitable can be found.
func (*FontFace) Less ¶ added in v0.7.0
Less returns true if this FontFace is logically before the other FontFace.
func (*FontFace) Monospaced ¶
Monospaced returns true if this FontFace has been marked as having a fixed width for every character.
func (*FontFace) Style ¶
func (f *FontFace) Style() (weight FontWeight, spacing FontSpacing, slant FontSlant)
Style returns the style information for this FontFace.
func (*FontFace) UnitsPerEm ¶
UnitsPerEm returns the number of coordinate units on the "em square", an abstract square whose height is the intended distance between lines of type in the same type size. This is the size of the design grid on which glyphs are laid out.
type FontFamily ¶
type FontFamily struct {
// contains filtered or unexported fields
}
FontFamily holds information about one font family.
func MatchFontFamily ¶
func MatchFontFamily(family string) *FontFamily
MatchFontFamily returns a FontFamily for the specified family name. If no such family name exists, Count() will be 0.
func (*FontFamily) Count ¶
func (f *FontFamily) Count() int
Count returns the number of Faces within this FontFamily.
func (*FontFamily) Face ¶
func (f *FontFamily) Face(index int) *FontFace
Face returns the FontFace for the given index. Must be >= 0 and < Count().
func (*FontFamily) MatchStyle ¶
func (f *FontFamily) MatchStyle(weight FontWeight, spacing FontSpacing, slant FontSlant) *FontFace
MatchStyle attempts to locate the FontFace within the family with the given style. Will return nil if nothing suitable can be found.
func (*FontFamily) String ¶
func (f *FontFamily) String() string
func (*FontFamily) Style ¶
func (f *FontFamily) Style(index int) (description string, weight FontWeight, spacing FontSpacing, slant FontSlant)
Style returns the style information for the given index. Must be >= 0 and < Count().
type FontHinting ¶
type FontHinting byte
FontHinting holds the type of font hinting to use.
const ( FontHintingNone FontHinting = iota FontHintingSlight FontHintingNormal FontHintingFull )
Possible values for FontHinting.
type FontMetrics ¶
type FontMetrics struct { Flags uint32 // Flags indicating which metrics are valid Top float32 // Greatest extent above origin of any glyph bounding box; typically negative; deprecated with variable fonts; only if Flags & BoundsInvalidFontMetricsFlag == 0 Ascent float32 // Distance to reserve above baseline; typically negative Descent float32 // Distance to reserve below baseline; typically positive Bottom float32 // Greatest extent below origin of any glyph bounding box; typically positive; deprecated with variable fonts; only if Flags & BoundsInvalidFontMetricsFlag == 0 Leading float32 // Distance to add between lines; typically positive or zero AvgCharWidth float32 // Average character width; zero if unknown MaxCharWidth float32 // Maximum character width; zero if unknown XMin float32 // Greatest extent to left of origin of any glyph bounding box; typically negative; deprecated with variable fonts; only if Flags & BoundsInvalidFontMetricsFlag == 0 XMax float32 // Greatest extent to right of origin of any glyph bounding box; typically positive; deprecated with variable fonts; only if Flags & BoundsInvalidFontMetricsFlag == 0 XHeight float32 // Height of lowercase 'x'; zero if unknown; typically negative CapHeight float32 // Height of uppercase letter; zero if unknown; typically negative UnderlineThickness float32 // Underline thickness; only if Flags & UnderlineThicknessIsValidFontMetricsFlag != 0 UnderlinePosition float32 // Distance from baseline to top of stroke; typically positive; only if Flags & UnderlinePositionIsValidFontMetricsFlag != 0 StrikeoutThickness float32 // Strikeout thickness; only if Flags & StrikeoutThicknessIsValidFontMetricsFlag != 0 StrikeoutPosition float32 // Distance from baseline to bottom of stroke; typically negative; only if Flags & StrikeoutPositionIsValidFontMetricsFlag != 0 }
FontMetrics holds various metrics about a font.
type FontSlant ¶
type FontSlant int32
FontSlant holds the slant of a font.
Possible values for the slant of a font.
func SlantFromString ¶
SlantFromString extracts the FontSlant from a string.
func (FontSlant) MarshalText ¶
MarshalText implements the encoding.TextMarshaler interface.
func (*FontSlant) UnmarshalText ¶
UnmarshalText implements the encoding.TextUnmarshaler interface.
type FontSpacing ¶
type FontSpacing int32
FontSpacing holds the text spacing of a font.
const ( UltraCondensedSpacing FontSpacing = 1 + iota ExtraCondensedSpacing CondensedSpacing SemiCondensedSpacing StandardSpacing SemiExpandedSpacing ExpandedSpacing ExtraExpandedSpacing UltraExpandedSpacing )
Possible values for FontSpacing.
func SpacingFromString ¶
func SpacingFromString(str string) FontSpacing
SpacingFromString extracts the FontSpacing from a string.
func (FontSpacing) Key ¶ added in v0.7.0
func (s FontSpacing) Key() string
Key returns the key that is used when serializing.
func (FontSpacing) MarshalText ¶
func (s FontSpacing) MarshalText() (text []byte, err error)
MarshalText implements the encoding.TextMarshaler interface.
func (FontSpacing) String ¶
func (s FontSpacing) String() string
func (*FontSpacing) UnmarshalText ¶
func (s *FontSpacing) UnmarshalText(text []byte) error
UnmarshalText implements the encoding.TextUnmarshaler interface.
type FontWeight ¶
type FontWeight int32
FontWeight holds the weight of a font.
const ( InvisibleFontWeight FontWeight = iota * 100 ThinFontWeight ExtraLightFontWeight LightFontWeight NormalFontWeight MediumFontWeight SemiBoldFontWeight BoldFontWeight ExtraBoldFontWeight BlackFontWeight ExtraBlackFontWeight )
Possible values for FontWeight.
func WeightFromString ¶
func WeightFromString(str string) FontWeight
WeightFromString extracts the FontWeight from a string.
func (FontWeight) Key ¶ added in v0.7.0
func (w FontWeight) Key() string
Key returns the key that is used when serializing.
func (FontWeight) MarshalText ¶
func (w FontWeight) MarshalText() (text []byte, err error)
MarshalText implements the encoding.TextMarshaler interface.
func (FontWeight) String ¶
func (w FontWeight) String() string
func (*FontWeight) UnmarshalText ¶
func (w *FontWeight) UnmarshalText(text []byte) error
UnmarshalText implements the encoding.TextUnmarshaler interface.
type Gradient ¶
type Gradient struct { Start geom32.Point StartRadius float32 End geom32.Point EndRadius float32 Stops []Stop }
Gradient defines a smooth transition between colors across an area. Start and End should hold values from 0 to 1. These will be be used to set a relative starting and ending position for the gradient. If StartRadius and EndRadius are both greater than 0, then the gradient will be a radial one instead of a linear one.
func NewEvenlySpacedGradient ¶
func NewEvenlySpacedGradient(start, end geom32.Point, startRadius, endRadius float32, colors ...ColorProvider) *Gradient
NewEvenlySpacedGradient creates a new gradient with the specified colors evenly spread across the whole range. start and end should hold values from 0 to 1, representing the percentage position within the area that will be filled.
func NewHorizontalEvenlySpacedGradient ¶
func NewHorizontalEvenlySpacedGradient(colors ...ColorProvider) *Gradient
NewHorizontalEvenlySpacedGradient creates a new gradient with the specified colors evenly spread across the whole range.
func NewVerticalEvenlySpacedGradient ¶
func NewVerticalEvenlySpacedGradient(colors ...ColorProvider) *Gradient
NewVerticalEvenlySpacedGradient creates a new gradient with the specified colors evenly spread across the whole range.
type Group ¶
type Group struct {
// contains filtered or unexported fields
}
Group is used to ensure only one panel in a group is selected at a time.
func NewGroup ¶
func NewGroup(panel ...*GroupPanel) *Group
NewGroup creates a new group for the specified set of panels. Each panel is removed from any other group it may be in and placed in the newly created one.
func (*Group) Add ¶
func (sg *Group) Add(panel *GroupPanel)
Add a panel to the group, removing it from any group it may have previously been associated with.
func (*Group) Select ¶
func (sg *Group) Select(panel *GroupPanel)
Select a panel, deselecting all others in the group.
type GroupPanel ¶
type GroupPanel struct { Panel // contains filtered or unexported fields }
GroupPanel is a panel that can be used in a Group. A GroupPanel is typically embedded into another widget that wants to participate in group selection. If used standalone, .Self should be set appropriately.
func (*GroupPanel) AsGroupPanel ¶
func (p *GroupPanel) AsGroupPanel() *GroupPanel
AsGroupPanel returns the object as a GroupPanel.
func (*GroupPanel) Selected ¶
func (p *GroupPanel) Selected() bool
Selected returns true if the panel is currently selected.
func (*GroupPanel) SetSelected ¶
func (p *GroupPanel) SetSelected(selected bool)
SetSelected sets the panel's selected state.
type Image ¶
Image holds a reference to an image.
func MoveCursorImage ¶ added in v0.5.0
func MoveCursorImage() *Image
MoveCursorImage returns the standard move cursor image.
func NewImageFromBytes ¶
NewImageFromBytes creates a new image from raw bytes.
func NewImageFromFilePathOrURL ¶
NewImageFromFilePathOrURL creates a new image from data retrieved from the file path or URL. The http.DefaultClient will be used if the data is remote.
func NewImageFromPixels ¶
NewImageFromPixels creates a new image from pixel data.
func ResizeHorizontalCursorImage ¶ added in v0.5.0
func ResizeHorizontalCursorImage() *Image
ResizeHorizontalCursorImage returns the standard horizontal resize cursor image.
func ResizeLeftDiagonalCursorImage ¶ added in v0.5.0
func ResizeLeftDiagonalCursorImage() *Image
ResizeLeftDiagonalCursorImage returns the standard left diagonal resize cursor image.
func ResizeRightDiagonalCursorImage ¶ added in v0.5.0
func ResizeRightDiagonalCursorImage() *Image
ResizeRightDiagonalCursorImage returns the standard right diagonal resize cursor image.
func ResizeVerticalCursorImage ¶ added in v0.5.0
func ResizeVerticalCursorImage() *Image
ResizeVerticalCursorImage returns the standard vertical resize cursor image.
func (*Image) DrawInRect ¶ added in v0.3.0
func (img *Image) DrawInRect(canvas *Canvas, rect geom32.Rect, sampling *SamplingOptions, paint *Paint)
DrawInRect draws this image in the given rectangle.
func (*Image) LogicalSize ¶
LogicalSize returns the logical (device-independent) size.
func (*Image) Size ¶
Size returns the size, in pixels, of the image. These dimensions will always be whole numbers > 0 for valid images.
func (*Image) ToJPEG ¶
ToJPEG creates JPEG data from the image. quality should be greater than 0 and equal to or less than 100.
type ImageFilter ¶
type ImageFilter struct {
// contains filtered or unexported fields
}
ImageFilter performs a transformation on the image before drawing it.
func NewArithmeticImageFilter ¶
func NewArithmeticImageFilter(k1, k2, k3, k4 float32, background, foreground *ImageFilter, enforcePMColor bool, cropRect *geom32.Rect) *ImageFilter
NewArithmeticImageFilter returns a new arithmetic image filter. Each output pixel is the result of combining the corresponding background and foreground pixels using the 4 coefficients: k1 * foreground * background + k2 * foreground + k3 * background + k4 Both background and foreground may be nil, in which case the source bitmap is used. If enforcePMColor is true, the RGB channels will clamped to the calculated alpha. cropRect may be nil.
func NewBlurImageFilter ¶
func NewBlurImageFilter(sigmaX, sigmaY float32, tileMode TileMode, input *ImageFilter, cropRect *geom32.Rect) *ImageFilter
NewBlurImageFilter returns a new blur image filter. input may be nil, in which case the source bitmap is used. cropRect may be nil.
func NewColorImageFilter ¶
func NewColorImageFilter(colorFilter *ColorFilter, input *ImageFilter, cropRect *geom32.Rect) *ImageFilter
NewColorImageFilter returns a new color image filter. input may be nil, in which case the source bitmap is used. cropRect may be nil.
func NewComposeImageFilter ¶
func NewComposeImageFilter(outer, inner *ImageFilter) *ImageFilter
NewComposeImageFilter returns a new combining image filter.
func NewDilateImageFilter ¶
func NewDilateImageFilter(radiusX, radiusY int, input *ImageFilter, cropRect *geom32.Rect) *ImageFilter
NewDilateImageFilter returns a new dilate image filter. input may be nil, in which case the source bitmap will be used. cropRect may be nil.
func NewDisplacementImageFilter ¶
func NewDisplacementImageFilter(xChannelSelector, yChannelSelector ColorChannel, scale float32, displacement, color *ImageFilter, cropRect *geom32.Rect) *ImageFilter
NewDisplacementImageFilter returns a new displacement image filter. displayment may be nil, in which case the source bitmap will be used. cropRect may be nil.
func NewDistantLitDiffuseImageFilter ¶
func NewDistantLitDiffuseImageFilter(x, y, z, scale, reflectivity float32, color Color, input *ImageFilter, cropRect *geom32.Rect) *ImageFilter
NewDistantLitDiffuseImageFilter returns a new distant lit diffuse image filter. input may be nil, in which case the source bitmap will be used. cropRect may be nil.
func NewDistantLitSpecularImageFilter ¶
func NewDistantLitSpecularImageFilter(x, y, z, scale, reflectivity, shine float32, color Color, input *ImageFilter, cropRect *geom32.Rect) *ImageFilter
NewDistantLitSpecularImageFilter returns a new distant lit specular image filter. input may be nil, in which case the source bitmap will be used. cropRect may be nil.
func NewDropShadowImageFilter ¶
func NewDropShadowImageFilter(dx, dy, sigmaX, sigmaY float32, color Color, input *ImageFilter, cropRect *geom32.Rect) *ImageFilter
NewDropShadowImageFilter returns a new drop shadow image filter. input may be nil, in which case the source bitmap will be used. cropRect may be nil.
func NewDropShadowOnlyImageFilter ¶
func NewDropShadowOnlyImageFilter(dx, dy, sigmaX, sigmaY float32, color Color, input *ImageFilter, cropRect *geom32.Rect) *ImageFilter
NewDropShadowOnlyImageFilter returns a new drop shadow only image filter. input may be nil, in which case the source bitmap will be used. cropRect may be nil.
func NewErodeImageFilter ¶
func NewErodeImageFilter(radiusX, radiusY int, input *ImageFilter, cropRect *geom32.Rect) *ImageFilter
NewErodeImageFilter returns a new erode image filter. input may be nil, in which case the source bitmap will be used. cropRect may be nil.
func NewImageSourceDefaultImageFilter ¶
func NewImageSourceDefaultImageFilter(canvas *Canvas, img *Image) *ImageFilter
NewImageSourceDefaultImageFilter returns a new image source image filter that uses the default quality and the full image size. If canvas is not nil, a hardware-accellerated image will be used if possible.
func NewImageSourceImageFilter ¶
func NewImageSourceImageFilter(canvas *Canvas, img *Image, srcRect, dstRect geom32.Rect, sampling *SamplingOptions) *ImageFilter
NewImageSourceImageFilter returns a new image source image filter. If canvas is not nil, a hardware-accellerated image will be used if possible.
func NewMagnifierImageFilter ¶
func NewMagnifierImageFilter(src geom32.Rect, inset float32, input *ImageFilter, cropRect *geom32.Rect) *ImageFilter
NewMagnifierImageFilter returns a new magnifier image filter. input may be nil, in which case the source bitmap will be used. cropRect may be nil.
func NewMatrixConvolutionImageFilter ¶
func NewMatrixConvolutionImageFilter(width, height int, kernel []float32, gain, bias float32, offsetX, offsetY int, tileMode TileMode, convolveAlpha bool, input *ImageFilter, cropRect *geom32.Rect) *ImageFilter
NewMatrixConvolutionImageFilter returns a new matrix convolution image filter.
width, height: The kernel size in pixels kernel: The image processing kernel. Must contain width * height elements, in row order. If less than this, zeroes
will be added to make up the difference.
gain: A scale factor applied to each pixel after convolution. This can be used to normalize the kernel, if it does
not already sum to 1.
bias: A bias factor added to each pixel after convolution. offsetX, offsetY: An offset applied to each pixel coordinate before convolution. This can be used to center the
kernel over the image (e.g., a 3x3 kernel should have an offset of {1, 1}).
tileMode: How accesses outside the image are treated. convolveAlpha: If true, all channels are convolved. If false, only the RGB channels are convolved, and alpha is
copied from the source image.
input: The input image filter, if nil the source bitmap is used instead. cropRect: Rectangle to which the output processing will be limited. May be nil.
func NewMatrixTransformImageFilter ¶
func NewMatrixTransformImageFilter(matrix *geom32.Matrix2D, sampling *SamplingOptions, input *ImageFilter) *ImageFilter
NewMatrixTransformImageFilter returns a new matrix transform image filter. input may be nil, in which case the source bitmap will be used.
func NewMergeImageFilter ¶
func NewMergeImageFilter(filters []*ImageFilter, cropRect *geom32.Rect) *ImageFilter
NewMergeImageFilter returns a new merge image filter. Each filter will draw their results in order with src-over blending. A nil filter will use the source bitmap instead. cropRect may be nil.
func NewOffsetImageFilter ¶
func NewOffsetImageFilter(dx, dy float32, input *ImageFilter, cropRect *geom32.Rect) *ImageFilter
NewOffsetImageFilter returns a new offset image filter. input may be nil, in which case the source bitmap will be used. cropRect may be nil.
func NewPointLitDiffuseImageFilter ¶
func NewPointLitDiffuseImageFilter(x, y, z, scale, reflectivity float32, color Color, input *ImageFilter, cropRect *geom32.Rect) *ImageFilter
NewPointLitDiffuseImageFilter returns a new point lit diffuse image filter. input may be nil, in which case the source bitmap will be used. cropRect may be nil.
func NewPointLitSpecularImageFilter ¶
func NewPointLitSpecularImageFilter(x, y, z, scale, reflectivity, shine float32, color Color, input *ImageFilter, cropRect *geom32.Rect) *ImageFilter
NewPointLitSpecularImageFilter returns a new point lit specular image filter. input may be nil, in which case the source bitmap will be used. cropRect may be nil.
func NewSpotLitDiffuseImageFilter ¶
func NewSpotLitDiffuseImageFilter(x, y, z, targetX, targetY, targetZ, specularExponent, cutoffAngle, scale, reflectivity float32, color Color, input *ImageFilter, cropRect *geom32.Rect) *ImageFilter
NewSpotLitDiffuseImageFilter returns a new spot lit diffuse image filter. input may be nil, in which case the source bitmap will be used. cropRect may be nil.
func NewSpotLitSpecularImageFilter ¶
func NewSpotLitSpecularImageFilter(x, y, z, targetX, targetY, targetZ, specularExponent, cutoffAngle, scale, reflectivity, shine float32, color Color, input *ImageFilter, cropRect *geom32.Rect) *ImageFilter
NewSpotLitSpecularImageFilter returns a new spot lit specular image filter. input may be nil, in which case the source bitmap will be used. cropRect may be nil.
func NewTileImageFilter ¶
func NewTileImageFilter(src, dst geom32.Rect, input *ImageFilter) *ImageFilter
NewTileImageFilter returns a new tile image filter. input may be nil, in which case the source bitmap will be used.
type IndirectFont ¶
type IndirectFont struct {
Font Font
}
IndirectFont holds a Font that references another font.
func (*IndirectFont) Baseline ¶ added in v0.4.0
func (f *IndirectFont) Baseline() float32
Baseline implements Font.
func (*IndirectFont) Descriptor ¶ added in v0.4.0
func (f *IndirectFont) Descriptor() FontDescriptor
Descriptor implements Font.
func (*IndirectFont) Face ¶ added in v0.4.0
func (f *IndirectFont) Face() *FontFace
Face implements Font.
func (*IndirectFont) GlyphWidth ¶ added in v0.7.0
func (f *IndirectFont) GlyphWidth(glyph uint16) float32
GlyphWidth implements Font.
func (*IndirectFont) GlyphWidths ¶ added in v0.7.0
func (f *IndirectFont) GlyphWidths(glyphs []uint16) []float32
GlyphWidths implements Font.
func (*IndirectFont) LineHeight ¶ added in v0.4.0
func (f *IndirectFont) LineHeight() float32
LineHeight implements Font.
func (*IndirectFont) Metrics ¶ added in v0.4.0
func (f *IndirectFont) Metrics() FontMetrics
Metrics implements Font.
func (*IndirectFont) RuneToGlyph ¶ added in v0.7.0
func (f *IndirectFont) RuneToGlyph(r rune) uint16
RuneToGlyph implements Font.
func (*IndirectFont) RunesToGlyphs ¶ added in v0.7.0
func (f *IndirectFont) RunesToGlyphs(r []rune) []uint16
RunesToGlyphs implements Font.
func (*IndirectFont) SimpleWidth ¶ added in v0.7.0
func (f *IndirectFont) SimpleWidth(str string) float32
SimpleWidth implements Font.
func (*IndirectFont) Size ¶ added in v0.4.0
func (f *IndirectFont) Size() float32
Size implements Font.
type Ink ¶
type Ink interface {
Paint(canvas *Canvas, rect geom32.Rect, style PaintStyle) *Paint
}
Ink holds a color, pattern, or gradient to draw with.
type InputCallbacks ¶
type InputCallbacks struct { // GainedFocusCallback is called when the keyboard focus is gained. GainedFocusCallback func() // LostFocusCallback is called when the keyboard focus is lost. LostFocusCallback func() // MouseDownCallback is called when the mouse is pressed. Return true to stop further handling or false to propagate // up to parents. MouseDownCallback func(where geom32.Point, button, clickCount int, mod Modifiers) bool // MouseDragCallback is called when the mouse is dragged after being pressed. Return true to stop further handling // or false to propagate up to parents. MouseDragCallback func(where geom32.Point, button int, mod Modifiers) bool // MouseUpCallback is called when the mouse is released after being pressed. Return true to stop further handling or // false to propagate up to parents. MouseUpCallback func(where geom32.Point, button int, mod Modifiers) bool // MouseEnterCallback is called on mouse entry. Return true to stop further handling or false to propagate up to // parents. MouseEnterCallback func(where geom32.Point, mod Modifiers) bool // MouseMoveCallback is called when the mouse moves. Return true to stop further handling or false to propagate up // to parents. MouseMoveCallback func(where geom32.Point, mod Modifiers) bool // MouseExitCallback is called on mouse exit. Return true to stop further handling or false to propagate up to // parents. MouseExitCallback func() bool // MouseWheelCallback is called when the mouse wheel is rotated. Return true to stop further handling or false to // propagate up to parents. MouseWheelCallback func(where, delta geom32.Point, mod Modifiers) bool // KeyDownCallback is called when a key is pressed. Return true to stop further handling or false to propagate up to // parents. KeyDownCallback func(keyCode KeyCode, mod Modifiers, repeat bool) bool // KeyUpCallback is called when a key is released. Return true to stop further handling or false to propagate up to // parents. KeyUpCallback func(keyCode KeyCode, mod Modifiers) bool // RuneTypedCallback is called when a key is typed. Return true to stop further handling or false to propagate up to // parents. RuneTypedCallback func(ch rune) bool // FileDropCallback is called when files are drag & dropped from the OS. FileDropCallback func(files []string) }
InputCallbacks holds the callbacks that client code can hook into for user input events.
type InvertStyle ¶
type InvertStyle int32
InvertStyle holds the type inversion.
const ( NoInvert InvertStyle = iota InvertBrightness InvertLightness )
Possible values for InvertStyle.
type KeyBinding ¶ added in v0.7.0
KeyBinding holds a key code and/or modifier.
func KeyBindingFromKey ¶ added in v0.7.0
func KeyBindingFromKey(key string) KeyBinding
KeyBindingFromKey extracts a KeyBinding from a string created via a call to .Key().
func (KeyBinding) Key ¶ added in v0.7.0
func (b KeyBinding) Key() string
Key returns a string version of the KeyCode for the purpose of serialization.
func (KeyBinding) MarshalText ¶ added in v0.7.0
func (b KeyBinding) MarshalText() (text []byte, err error)
MarshalText implements encoding.TextMarshaler.
func (KeyBinding) ShouldOmit ¶ added in v0.7.0
func (b KeyBinding) ShouldOmit() bool
ShouldOmit implements json.Omitter.
func (KeyBinding) String ¶ added in v0.7.0
func (b KeyBinding) String() string
func (*KeyBinding) UnmarshalText ¶ added in v0.7.0
func (b *KeyBinding) UnmarshalText(text []byte) error
UnmarshalText implements encoding.TextUnmarshaler.
type KeyCode ¶
type KeyCode int16
KeyCode holds a virtual key code.
func KeyCodeFromKey ¶ added in v0.7.0
KeyCodeFromKey extracts KeyCode from a string created via a call to .Key().
func (KeyCode) Key ¶ added in v0.7.0
Key returns a string version of the KeyCode for the purpose of serialization.
func (KeyCode) MarshalText ¶ added in v0.7.0
MarshalText implements encoding.TextMarshaler.
func (KeyCode) ShouldOmit ¶ added in v0.7.0
ShouldOmit implements json.Omitter.
func (*KeyCode) UnmarshalText ¶ added in v0.7.0
UnmarshalText implements encoding.TextUnmarshaler.
type Label ¶
type Label struct { Panel LabelTheme Drawable Drawable Text string }
Label represents non-interactive text and/or a Drawable.
func (*Label) DefaultDraw ¶
DefaultDraw provides the default drawing.
type LabelTheme ¶ added in v0.4.0
type LabelTheme struct { Font Font OnBackgroundInk Ink Gap float32 HAlign Alignment VAlign Alignment Side Side }
LabelTheme holds theming data for a Label.
type Layout ¶
type Layout interface { LayoutSizes(target *Panel, hint geom32.Size) (min, pref, max geom32.Size) PerformLayout(target *Panel) }
Layout defines methods that all layouts must provide.
type LineBorder ¶
type LineBorder struct {
// contains filtered or unexported fields
}
LineBorder private a lined border.
func NewLineBorder ¶
NewLineBorder creates a new line border. The cornerRadius specifies the amount of rounding to use on the corners. The insets represent how thick the border will be drawn on that edge. If noInset is true, the Insets() method will return zeroes.
func (*LineBorder) Draw ¶
func (b *LineBorder) Draw(canvas *Canvas, rect geom32.Rect)
Draw the border into rect.
func (*LineBorder) Insets ¶
func (b *LineBorder) Insets() geom32.Insets
Insets returns the insets describing the space the border occupies on each side.
type List ¶
type List struct { Panel ListTheme DoubleClickCallback func() NewSelectionCallback func() Factory CellFactory Selection *xmath.BitSet // contains filtered or unexported fields }
List provides a control that allows the user to select from a list of items, represented by cells.
func (*List) AllowMultipleSelection ¶
AllowMultipleSelection returns whether multiple rows may be selected at once.
func (*List) Anchor ¶
Anchor returns the index that is the current anchor point. Will be -1 if there is no anchor point.
func (*List) Append ¶
func (l *List) Append(values ...interface{})
Append values to the list of items.
func (*List) DataAtIndex ¶
DataAtIndex returns the data for the specified row index.
func (*List) DefaultCanPerformCmd ¶
DefaultCanPerformCmd provides the default can perform cmd handling.
func (*List) DefaultDraw ¶
DefaultDraw provides the default drawing.
func (*List) DefaultKeyDown ¶
DefaultKeyDown provides the default key down handling.
func (*List) DefaultMouseDown ¶
DefaultMouseDown provides the default mouse down handling.
func (*List) DefaultMouseDrag ¶
DefaultMouseDrag provides the default mouse drag handling.
func (*List) DefaultMouseUp ¶
DefaultMouseUp provides the default mouse up handling.
func (*List) DefaultPerformCmd ¶
DefaultPerformCmd provides the default perform cmd handling.
func (*List) DefaultSizes ¶
DefaultSizes provides the default sizing.
func (*List) FlashSelection ¶
func (l *List) FlashSelection()
FlashSelection flashes the current selection.
func (*List) RemoveRange ¶
RemoveRange removes the items at the specified index range, inclusive.
func (*List) Select ¶
Select items at the specified indexes. If 'add' is true, then any existing selection is added to rather than replaced.
func (*List) SelectRange ¶
SelectRange selects items from 'start' to 'end', inclusive. If 'add' is true, then any existing selection is added to rather than replaced.
func (*List) SetAllowMultipleSelection ¶
SetAllowMultipleSelection sets whether multiple rows may be selected at once.
type ListTheme ¶ added in v0.4.0
type ListTheme struct { BackgroundInk Ink OnBackgroundInk Ink BandingInk Ink OnBandingInk Ink SelectionInk Ink OnSelectionInk Ink FlashAnimationTime time.Duration }
ListTheme holds theming data for a List.
type MaskFilter ¶
type MaskFilter struct {
// contains filtered or unexported fields
}
MaskFilter performs a transformation on the mask before drawing it.
func NewBlurMaskFilter ¶
func NewBlurMaskFilter(style Blur, sigma float32, respectMatrix bool) *MaskFilter
NewBlurMaskFilter returns a new blur mask filter. sigma is the standard deviation of the gaussian blur to apply. Must be greater than 0. If respectMatrix is true, the blur's sigma is modified by the current matrix.
func NewClipMaskFilter ¶
func NewClipMaskFilter(min, max byte) *MaskFilter
NewClipMaskFilter returns a new clip mask filter.
func NewGammaMaskFilter ¶
func NewGammaMaskFilter(gamma float32) *MaskFilter
NewGammaMaskFilter returns a new gamma mask filter.
func NewShaderMaskFilter ¶
func NewShaderMaskFilter(shader *Shader) *MaskFilter
NewShaderMaskFilter returns a new shader mask filter.
func NewTableMaskFilter ¶
func NewTableMaskFilter(table []byte) *MaskFilter
NewTableMaskFilter returns a new table mask filter. The table should be 256 elements long. If shorter, it will be expanded to 256 elements and the new entries will be filled with 0.
type Menu ¶
type Menu interface { // Factory returns the MenuFactory that created this Menu. Factory() MenuFactory // ID returns the id of this Menu. ID() int // IsSame returns true if the two menus represent the same object. Do not use == to test for equality. IsSame(other Menu) bool // ItemAtIndex returns the menu item at the specified index within the menu. ItemAtIndex(index int) MenuItem // Item returns the menu item with the specified id anywhere in the menu and and its sub-menus. Item(id int) MenuItem // Menu returns the menu with the specified id anywhere in the menu and and its sub-menus. Menu(id int) Menu // InsertSeparator inserts a menu separator at the specified menuItem index within this menu. Pass in a negative // index to append to the end. If onlyIfNeeded is true, then a separator is only inserted if the menuItem that would // precede it at the insertion location is not a separator. InsertSeparator(atIndex int, onlyIfNeeded bool) // InsertItem inserts a menu item at the specified menuItem index within this menu. Pass in a negative index to // append to the end. If the menu item is nil, then nothing happens. InsertItem(atIndex int, mi MenuItem) // InsertMenu inserts a new sub-menu at the specified menuItem index within this menu. Pass in a negative index to // append to the end. InsertMenu(atIndex int, subMenu Menu) // RemoveItem removes the menu item at the specified index from this menu. RemoveItem(index int) // Title returns the title of this menu. Title() string // Count of menu items in this menu. Count() int // Popup the menu at the specified position within the active window. Popup(where geom32.Rect, itemIndex int) // Dispose releases any OS resources associated with this menu. Dispose() }
Menu holds a set of menu items.
func NewAppMenu ¶
func NewAppMenu(f MenuFactory, aboutHandler, prefsHandler func(MenuItem), updater func(Menu)) Menu
NewAppMenu creates a standard 'App' menu. Really only intended for macOS, although other platforms can use it if desired.
func NewEditMenu ¶
func NewEditMenu(f MenuFactory, prefsHandler func(MenuItem), updater func(Menu)) Menu
NewEditMenu creates a standard 'Edit' menu.
func NewFileMenu ¶
func NewFileMenu(f MenuFactory, updater func(Menu)) Menu
NewFileMenu creates a standard 'File' menu.
func NewHelpMenu ¶
func NewHelpMenu(f MenuFactory, aboutHandler func(MenuItem), updater func(Menu)) Menu
NewHelpMenu creates a standard 'Help' menu.
func NewWindowMenu ¶
func NewWindowMenu(f MenuFactory, updater func(Menu)) Menu
NewWindowMenu creates a standard 'Window' menu.
type MenuFactory ¶
type MenuFactory interface { // BarForWindow returns the menu bar for the given window. If this is the first time the menu bar has been returned // from this call, initializer will be called so that your code can configure the menus. BarForWindow(window *Window, initializer func(Menu)) Menu // BarForWindowNoCreate returns the menu bar for the given window. May return nil if no menu bar for the window has // been created yet. BarForWindowNoCreate(window *Window) Menu // BarIsPerWindow returns true if the menu bar returned from this MenuFactory is per-window instead of global. BarIsPerWindow() bool // NewMenu creates a new Menu. updater is optional and, if present, will be called prior to showing the Menu, giving // a chance to modify it. NewMenu(id int, title string, updater func(Menu)) Menu // NewItem creates a new MenuItem. Both validator and handler may be nil for default behavior. NewItem(id int, title string, keyBinding KeyBinding, validator func(MenuItem) bool, handler func(MenuItem)) MenuItem }
MenuFactory provides methods for creating a menu bar and its menus.
func DefaultMenuFactory ¶
func DefaultMenuFactory() MenuFactory
DefaultMenuFactory returns the default MenuFactory for the platform. Multiple calls always return the same object.
func NewInWindowMenuFactory ¶
func NewInWindowMenuFactory() MenuFactory
NewInWindowMenuFactory creates a new MenuFactory for in-window usage. This is the fallback Go-only version of menus used when a non-platform-native version doesn't exist. TODO: Consider doing something similar to Java and only create native windows for menu content when absolutely
necessary. While the current approach works extremely well on macOS, it is slow on both Windows and Linux, thanks to gratuitous animations upon window creation that I don't see a way to disable.
type MenuItem ¶
type MenuItem interface { // Factory returns the MenuFactory that created this MenuItem. Factory() MenuFactory // ID returns the id of this menu item. ID() int // IsSame returns true if the two items represent the same object. Do not use == to test for equality. IsSame(other MenuItem) bool // Menu returns the owning menu. Menu() Menu // Index returns the index of the menu item within its menu. Returns -1 if it is not yet attached to a menu. Index() int // IsSeparator returns true if this menu item is a separator. IsSeparator() bool // Title returns the menu item's title. Title() string // SetTitle sets the menu item's title. SetTitle(title string) // KeyBinding returns the key binding for the menu item. KeyBinding() KeyBinding // SetKeyBinding sets the key binding for the menu item. SetKeyBinding(keyBinding KeyBinding) // SubMenu returns the menu item's sub-menu, if any. SubMenu() Menu // CheckState returns the menu item's current check state. CheckState() CheckState // SetCheckState sets the menu item's check state. SetCheckState(s CheckState) }
MenuItem describes a choice that can be made from a Menu.
type MenuItemTheme ¶ added in v0.4.0
type MenuItemTheme struct { TitleFont Font KeyFont Font BackgroundColor Ink OnBackgroundColor Ink SelectionColor Ink OnSelectionColor Ink ItemBorder Border SeparatorBorder Border KeyGap float32 }
MenuItemTheme holds theming data for a menu item.
type MipMapMode ¶
type MipMapMode int32
MipMapMode holds the type of mipmapping to be done.
const ( MipMapModeNone MipMapMode = iota // ignore mipmap levels, sample from the "base" MipMapModeNearest // sample from the nearest level MipMapModeLinear // interpolate between the two nearest levels )
Possible values for MipMapMode.
type Modifiers ¶
type Modifiers byte
Modifiers contains flags indicating which modifier keys were down when an event occurred.
const ( ShiftModifier Modifiers = 1 << iota ControlModifier OptionModifier CommandModifier CapsLockModifier NumLockModifier NonStickyModifiers = ShiftModifier | ControlModifier | OptionModifier | CommandModifier StickyModifiers = CapsLockModifier | NumLockModifier AllModifiers = StickyModifiers | NonStickyModifiers NoModifiers Modifiers = 0 )
Possible Modifiers values.
func ModifiersFromKey ¶ added in v0.7.0
ModifiersFromKey extracts Modifiers from a string created via a call to .Key().
func OSMenuCmdModifier ¶
func OSMenuCmdModifier() Modifiers
OSMenuCmdModifier returns the OS's standard menu command key modifier.
func (Modifiers) CapsLockDown ¶
CapsLockDown returns true if the caps lock key is being pressed.
func (Modifiers) CommandDown ¶
CommandDown returns true if the command/meta key is being pressed.
func (Modifiers) ControlDown ¶
ControlDown returns true if the control key is being pressed.
func (Modifiers) Key ¶ added in v0.7.0
Key returns a string version of the Modifiers for the purpose of serialization.
func (Modifiers) MarshalText ¶ added in v0.7.0
MarshalText implements encoding.TextMarshaler.
func (Modifiers) NumLockDown ¶
NumLockDown returns true if the num lock key is being pressed.
func (Modifiers) OSMenuCmdModifierDown ¶
OSMenuCmdModifierDown returns true if the OS's standard menu command key is being pressed.
func (Modifiers) OptionDown ¶
OptionDown returns true if the option/alt key is being pressed.
func (*Modifiers) UnmarshalText ¶ added in v0.7.0
UnmarshalText implements encoding.TextUnmarshaler.
type OpenDialog ¶
type OpenDialog interface { SaveDialog // CanChooseFiles returns true if the open dialog is permitted to select files. CanChooseFiles() bool // SetCanChooseFiles sets whether the open dialog is permitted to select files. SetCanChooseFiles(canChoose bool) // CanChooseDirectories returns true if the open dialog is permitted to select directories. CanChooseDirectories() bool // SetCanChooseDirectories sets whether the open dialog is permitted to select directories. SetCanChooseDirectories(canChoose bool) // ResolvesAliases returns whether the returned paths have been resolved in the case where the selection was an // alias. ResolvesAliases() bool // SetResolvesAliases sets whether the returned paths will be resolved in the case where the selection was an alias. SetResolvesAliases(resolves bool) // AllowsMultipleSelection returns true if more than one item can be selected. AllowsMultipleSelection() bool // SetAllowsMultipleSelection sets whether more than one item can be selected. SetAllowsMultipleSelection(allow bool) // Paths returns the paths that were chosen. Paths() []string }
OpenDialog represents a dialog that permits a user to select one or more files or directories.
func NewCommonOpenDialog ¶
func NewCommonOpenDialog() OpenDialog
NewCommonOpenDialog creates a new OpenDialog. This is the fallback Go-only version of the OpenDialog used when a non-platform-native version doesn't exist. Where possible, use of NewOpenDialog() should be preferred, since platforms like macOS and Windows usually have restrictions on file access that their native dialogs automatically remove for the user.
func NewOpenDialog ¶
func NewOpenDialog() OpenDialog
NewOpenDialog creates a new open dialog using native support where possible.
type Paint ¶
type Paint struct {
// contains filtered or unexported fields
}
Paint controls options applied when drawing.
func (*Paint) Antialias ¶
Antialias returns true if pixels on the active edges of a path may be drawn with partial transparency.
func (*Paint) ColorFilter ¶
func (p *Paint) ColorFilter() *ColorFilter
ColorFilter returns the current ColorFilter.
func (*Paint) Dither ¶
Dither returns true if color error may be distributed to smooth color transition.
func (*Paint) Equivalent ¶ added in v0.7.0
Equivalent returns true if these Paint objects are equivalent.
func (*Paint) FillPath ¶
FillPath returns a path representing the path if it was stroked. resScale determines the precision used. Values >1 increase precision, while those <1 reduce precision to favor speed and size. If hairline returns true, the path represents a hairline, otherwise it represents a fill.
func (*Paint) FillPathWithCull ¶
func (p *Paint) FillPathWithCull(path *Path, cullRect geom32.Rect, resScale float32) (result *Path, hairline bool)
FillPathWithCull returns a path representing the path if it was stroked. cullRect will prune any parts outside of the rect. resScale determines the precision used. Values >1 increase precision, while those <1 reduce precision to favor speed and size. If hairline returns true, the path represents a hairline, otherwise it represents a fill.
func (*Paint) ImageFilter ¶
func (p *Paint) ImageFilter() *ImageFilter
ImageFilter returns the current ImageFilter.
func (*Paint) MaskFilter ¶
func (p *Paint) MaskFilter() *MaskFilter
MaskFilter returns the current MaskFilter.
func (*Paint) PathEffect ¶
func (p *Paint) PathEffect() *PathEffect
PathEffect returns the current PathEffect.
func (*Paint) SetAntialias ¶
SetAntialias sets whether pixels on the active edges of a path may be drawn with partial transparency.
func (*Paint) SetBlendMode ¶
SetBlendMode sets the BlendMode.
func (*Paint) SetColorFilter ¶
func (p *Paint) SetColorFilter(filter *ColorFilter)
SetColorFilter sets the ColorFilter.
func (*Paint) SetDither ¶
SetDither sets whether color error may be distributed to smooth color transition.
func (*Paint) SetImageFilter ¶
func (p *Paint) SetImageFilter(filter *ImageFilter)
SetImageFilter sets the ImageFilter.
func (*Paint) SetMaskFilter ¶
func (p *Paint) SetMaskFilter(filter *MaskFilter)
SetMaskFilter sets the MaskFilter.
func (*Paint) SetPathEffect ¶
func (p *Paint) SetPathEffect(effect *PathEffect)
SetPathEffect sets the PathEffect.
func (*Paint) SetStrokeCap ¶
SetStrokeCap sets the StrokeCap.
func (*Paint) SetStrokeJoin ¶
func (p *Paint) SetStrokeJoin(strokeJoin StrokeJoin)
SetStrokeJoin sets the StrokeJoin.
func (*Paint) SetStrokeMiter ¶
SetStrokeMiter sets the miter limit for sharp corners.
func (*Paint) SetStrokeWidth ¶
SetStrokeWidth sets the stroke width.
func (*Paint) StrokeJoin ¶
func (p *Paint) StrokeJoin() StrokeJoin
StrokeJoin returns the current StrokeJoin.
func (*Paint) StrokeMiter ¶
StrokeMiter returns the current stroke miter limit for sharp corners.
func (*Paint) StrokeWidth ¶
StrokeWidth returns the current stroke width.
type PaintStyle ¶
type PaintStyle byte
PaintStyle holds the type of painting to do.
const ( Fill PaintStyle = iota Stroke StrokeAndFill )
Possible values for PaintStyle.
type Panel ¶
type Panel struct { InputCallbacks Self interface{} DrawCallback func(gc *Canvas, rect geom32.Rect) DrawOverCallback func(gc *Canvas, rect geom32.Rect) UpdateCursorCallback func(where geom32.Point) *Cursor UpdateTooltipCallback func(where geom32.Point, suggestedAvoidInRoot geom32.Rect) geom32.Rect CanPerformCmdCallback func(source interface{}, id int) bool PerformCmdCallback func(source interface{}, id int) FrameChangeCallback func() FrameChangeInChildHierarchyCallback func(panel *Panel) ScrollRectIntoViewCallback func(rect geom32.Rect) bool ParentChangedCallback func() FocusChangeInHierarchyCallback func(from, to *Panel) // DataDragOverCallback is called when a data drag is over a potential drop target. Return true to stop further // handling or false to propagate up to parents. DataDragOverCallback func(where geom32.Point, data map[string]interface{}) bool // DataDragExitCallback is called when a previous call to DataDragOverCallback returned true and the data drag // leaves the component. DataDragExitCallback func() // DataDragDropCallback is called when a data drag is dropped and a previous call to DataDragOverCallback returned // true. DataDragDropCallback func(where geom32.Point, data map[string]interface{}) Tooltip *Panel NeedsLayout bool Hidden bool // contains filtered or unexported fields }
Panel is the basic user interface element that interacts with the user. During construction, new objects must always set the Self field to the final object. Failure to do so may result in incorrect behavior.
func NewMessagePanel ¶
NewMessagePanel creates a new panel containing the given primary and detail messages. Embedded line feeds are OK.
func NewTooltipWithSecondaryText ¶
NewTooltipWithSecondaryText creates a text tooltip panel containing a primary piece of text along with a secondary piece of text in a slightly smaller font.
func NewTooltipWithText ¶
NewTooltipWithText creates a standard text tooltip panel.
func (*Panel) AddChild ¶
AddChild adds child to this panel, removing it from any previous parent it may have had.
func (*Panel) AddChildAtIndex ¶
AddChildAtIndex adds child to this panel at the index, removing it from any previous parent it may have had. Passing in a negative value for the index will add it to the end.
func (*Panel) ClientData ¶
ClientData returns a map of client data for this Panel.
func (*Panel) ContentRect ¶
ContentRect returns the location and size of the panel in local coordinates.
func (*Panel) Draw ¶
Draw is called by its owning window when a panel needs to be drawn. The canvas has already had its clip set to rect.
func (*Panel) Enabled ¶
Enabled returns true if this panel is currently enabled and can receive events.
func (*Panel) FlushDrawing ¶
func (p *Panel) FlushDrawing()
FlushDrawing is a convenience for calling the parent window's (if any) FlushDrawing() method.
func (*Panel) FrameRect ¶
FrameRect returns the location and size of the panel in its parent's coordinate system.
func (*Panel) IndexOfChild ¶
IndexOfChild returns the index of the specified child, or -1 if the passed in panel is not a child of this panel.
func (*Panel) IsDragGesture ¶ added in v0.3.0
IsDragGesture returns true if a gesture to start a drag operation was made.
func (*Panel) LayoutData ¶
func (p *Panel) LayoutData() interface{}
LayoutData returns the layout data, if any, associated with this panel.
func (*Panel) MarkForLayoutAndRedraw ¶
func (p *Panel) MarkForLayoutAndRedraw()
MarkForLayoutAndRedraw marks this panel as needing to be laid out as well as redrawn at the next update.
func (*Panel) MarkForRedraw ¶
func (p *Panel) MarkForRedraw()
MarkForRedraw finds the parent window and marks it for drawing at the next update. Note that currently I have found no way to get glfw to both only redraw a subset of the window AND retain the previous contents of that window, such that incremental updates can be done. So... we just redraw everything in the window every time.
func (*Panel) PanelAt ¶
PanelAt returns the leaf-most child panel containing the point, or this panel if no child is found.
func (*Panel) PointFromRoot ¶
PointFromRoot converts root coordinates (i.e. window-local, when rooted within a window) into panel-local coordinates.
func (*Panel) PointToRoot ¶
PointToRoot converts panel-local coordinates into root coordinates, which when rooted within a window, will be window-local coordinates.
func (*Panel) RectFromRoot ¶
RectFromRoot converts root coordinates (i.e. window-local, when rooted within a window) into panel-local coordinates.
func (*Panel) RectToRoot ¶
RectToRoot converts panel-local coordinates into root coordinates, which when rooted within a window, will be window-local coordinates.
func (*Panel) RemoveAllChildren ¶
func (p *Panel) RemoveAllChildren()
RemoveAllChildren removes all child panels from this panel.
func (*Panel) RemoveChild ¶
RemoveChild removes 'child' from this panel. If 'child' is not a direct descendent of this panel, nothing happens.
func (*Panel) RemoveChildAtIndex ¶
RemoveChildAtIndex removes the child panel at 'index' from this panel. If 'index' is out of range, nothing happens.
func (*Panel) RemoveFromParent ¶
func (p *Panel) RemoveFromParent()
RemoveFromParent removes this panel from its parent, if any.
func (*Panel) RequestFocus ¶
func (p *Panel) RequestFocus()
RequestFocus attempts to make this panel the keyboard focus.
func (*Panel) Scale ¶ added in v0.8.0
Scale returns the scale that has been applied to this panel. This will be automatically applied, transforming the graphics and mouse events.
func (*Panel) ScrollIntoView ¶
func (p *Panel) ScrollIntoView()
ScrollIntoView attempts to scroll this panel into the current view if it is not already there, using ScrollAreas in this Panel's hierarchy.
func (*Panel) ScrollRectIntoView ¶
ScrollRectIntoView attempts to scroll the rect (in coordinates local to this Panel) into the current view if it is not already there, using scroll areas in this Panel's hierarchy.
func (*Panel) SetEnabled ¶
SetEnabled sets this panel's enabled state.
func (*Panel) SetFocusable ¶
SetFocusable sets whether this panel can have the keyboard focus.
func (*Panel) SetFrameRect ¶
SetFrameRect sets the location and size of the panel in its parent's coordinate system.
func (*Panel) SetLayoutData ¶
func (p *Panel) SetLayoutData(data interface{})
SetLayoutData sets layout data on this panel. May be nil.
func (*Panel) SetScale ¶ added in v0.8.0
SetScale sets the scale for this panel and the panels in the hierarchy below it.
func (*Panel) Sizes ¶
Sizes returns the minimum, preferred, and maximum sizes the panel wishes to be. It does this by first asking the panel's layout. If no layout is present, then the panel's sizer is asked. If no sizer is present, then it finally uses a default set of sizes that are used for all panels.
func (*Panel) StartDataDrag ¶ added in v0.3.0
StartDataDrag starts a data drag operation.
func (*Panel) UpdateCursorNow ¶
func (p *Panel) UpdateCursorNow()
UpdateCursorNow causes the cursor to be updated as if the mouse had moved.
func (*Panel) ValidateLayout ¶
func (p *Panel) ValidateLayout()
ValidateLayout performs any layout that needs to be run by this panel or its children.
type Paneler ¶
type Paneler interface {
AsPanel() *Panel
}
Paneler is used to convert widgets into the base Panel type.
type Path ¶
type Path struct {
// contains filtered or unexported fields
}
Path holds geometry.
func CombinePaths ¶
func CombinePaths(ops []PathOpPair) (*Path, error)
CombinePaths combines two or more paths into a new path.
func NewPathFromSVGString ¶
NewPathFromSVGString attempts to create a path from the given SVG string.
func (*Path) ArcToFromTangent ¶
ArcToFromTangent appends an arc. The arc is contained by the tangent from the current point to (x1, y1) and the tangent from (x1, y1) to (x2, y2). The arc is part of the circle sized to radius, positioned so it touches both tangent lines.
func (*Path) ArcToOval ¶
ArcToOval appends an arc bounded by an oval. Both startAngle and sweepAngle are in degrees. A positive sweepAngle extends clockwise while a negative value extends counter-clockwise. If forceMoveTo is true, a new contour is started.
func (*Path) ArcToRelative ¶
func (p *Path) ArcToRelative(dx, dy, rx, ry, rotation float32, arcSize ArcSize, direction Direction)
ArcToRelative appends an arc. The destination point is relative to the current point. rotation is in degrees.
func (*Path) Bounds ¶
Bounds returns the bounding rectangle of the path. This is an approximation and may be different than the actual area covered when drawn.
func (*Path) Circle ¶
Circle adds a circle to the path with a clockwise direction. The circle is a complete contour, i.e. it starts with a MoveTo and ends with a Close operation.
func (*Path) CircleWithDirection ¶
CircleWithDirection adds a circle to the path. The circle is a complete contour, i.e. it starts with a MoveTo and ends with a Close operation.
func (*Path) ComputeTightBounds ¶
ComputeTightBounds returns the bounding rectangle of the path. This is an approximation and may be different than the actual area covered when drawn. When a path contains only lines, this method is functionally equivalent a call to Bounds(), though slower. When a path contains curves, the computed bounds includes the maximum extent of the quad, conic, or cubic.
func (*Path) ConicToRelative ¶
ConicToRelative appends a conic curve. The control point and end point are relative to the current point.
func (*Path) Contains ¶
Contains returns true if the point is within the path, taking into account the FillType.
func (*Path) CubicToRelative ¶
CubicToRelative appends a cubic curve. The control point and end point are relative to the current point.
func (*Path) LineToRelative ¶
LineToRelative appends a straight line segment. The end point is relative to the current point.
func (*Path) MoveToRelative ¶
MoveToRelative begins a new contour at the specified point, which is relative to the current point.
func (*Path) NewRotated ¶
NewRotated creates a copy of this path and then rotates it.
func (*Path) NewTransformed ¶
NewTransformed creates a copy of this path and then transforms it by the provided matrix.
func (*Path) NewTranslated ¶
NewTranslated creates a copy of this path and then translates it.
func (*Path) Oval ¶
Oval adds an oval to the path with a clockwise direction. The oval is a complete contour, i.e. it starts with a MoveTo and ends with a Close operation.
func (*Path) OvalWithDirection ¶
OvalWithDirection adds an oval to the path. The oval is a complete contour, i.e. it starts with a MoveTo and ends with a Close operation.
func (*Path) Path ¶
Path appends a path. If extend is true, a line from the current point to the start of the added path is created.
func (*Path) PathReverse ¶
PathReverse appends a path in reverse order.
func (*Path) PathRotated ¶
PathRotated appends a path after rotating it. If extend is true, a line from the current point to the start of the added path is created.
func (*Path) PathScaled ¶
PathScaled appends a path after scaling it. If extend is true, a line from the current point to the start of the added path is created.
func (*Path) PathTransformed ¶
PathTransformed appends a path after transforming it. If extend is true, a line from the current point to the start of the added path is created.
func (*Path) PathTranslated ¶
PathTranslated appends a path after translating it with the given offset. If extend is true, a line from the current point to the start of the added path is created.
func (*Path) Rect ¶
Rect adds a rectangle to the path with a clockwise direction. The rectangle is a complete contour, i.e. it starts with a MoveTo and ends with a Close operation.
func (*Path) RectWithDirection ¶
RectWithDirection adds a rectangle to the path. The rectangle is a complete contour, i.e. it starts with a MoveTo and ends with a Close operation.
func (*Path) Rewind ¶
func (p *Path) Rewind()
Rewind resets the path, as if it was newly created, but retains any allocated memory for future use, improving performance at the cost of memory.
func (*Path) RoundedRect ¶
RoundedRect adds a rectangle with curved corners to the path with a clockwise direction. The rectangle is a complete contour, i.e. it starts with a MoveTo and ends with a Close operation.
func (*Path) RoundedRectWithDirection ¶
func (p *Path) RoundedRectWithDirection(bounds geom32.Rect, radiusX, radiusY float32, direction Direction)
RoundedRectWithDirection adds a rectangle with curved corners to the path. The rectangle is a complete contour, i.e. it starts with a MoveTo and ends with a Close operation.
func (*Path) SetFillType ¶
SetFillType sets the FillType for this path.
func (*Path) ToSVGString ¶
ToSVGString returns an SVG string that represents this path.
type PathEffect ¶
type PathEffect struct {
// contains filtered or unexported fields
}
PathEffect affects the geometry of a drawing primitive before it is transformed by the canvas' matrix and drawn.
func New1dPathPathEffect ¶
func New1dPathPathEffect(path *Path, advance, phase float32, style PathEffect1DStyle) *PathEffect
New1dPathPathEffect creates a new 1D path PathEffect.
func New2dLinePathEffect ¶
func New2dLinePathEffect(width float32, matrix *geom32.Matrix2D) *PathEffect
New2dLinePathEffect creates a new 2D line PathEffect.
func New2dPathEffect ¶
func New2dPathEffect(matrix *geom32.Matrix2D, path *Path) *PathEffect
New2dPathEffect creates a new 2D PathEffect.
func NewComposePathEffect ¶
func NewComposePathEffect(outer, inner *PathEffect) *PathEffect
NewComposePathEffect creates a new PathEffect that combines two PathEffects.
func NewCornerPathEffect ¶
func NewCornerPathEffect(radius float32) *PathEffect
NewCornerPathEffect creates a new corner PathEffect.
func NewDashPathEffect ¶
func NewDashPathEffect(intervals []float32, phase float32) *PathEffect
NewDashPathEffect creates a new dash PathEffect.
func NewDiscretePathEffect ¶
func NewDiscretePathEffect(segLength, deviation float32, seedAssist uint32) *PathEffect
NewDiscretePathEffect creates a new discrete PathEffect.
func NewSumPathEffect ¶
func NewSumPathEffect(first, second *PathEffect) *PathEffect
NewSumPathEffect creates a new sum PathEffect.
func NewTrimPathEffect ¶
func NewTrimPathEffect(start, stop float32, mode TrimMode) *PathEffect
NewTrimPathEffect creates a new trim PathEffect.
type PathEffect1DStyle ¶
type PathEffect1DStyle byte
PathEffect1DStyle holds the 1D path effect.
const ( TranslatePathEffect PathEffect1DStyle = iota RotatePathEffect MorphPathEffect )
Possible values for PathEffect1DStyle.
type PathOp ¶
type PathOp byte
PathOp holds the possible operations that can be performed on a pair of paths.
type PathOpPair ¶
PathOpPair holds the combination of a Path and a PathOp.
type Pattern ¶
type Pattern struct { Image *Image Offset geom32.Point Scale geom32.Point TileModeX TileMode TileModeY TileMode SamplingOptions SamplingOptions }
Pattern holds the information necessary to draw an image in a pattern.
type PointMode ¶
type PointMode byte
PointMode controls how DrawPoints() renders the points passed to it.
type PopupMenu ¶
type PopupMenu struct { Panel PopupMenuTheme MenuFactory MenuFactory SelectionCallback func() Pressed bool // contains filtered or unexported fields }
PopupMenu represents a clickable button that displays a menu of choices.
func (*PopupMenu) AddDisabledItem ¶ added in v0.7.0
AddDisabledItem appends a disabled menu item to the end of the PopupMenu.
func (*PopupMenu) AddSeparator ¶
AddSeparator adds a separator to the end of the PopupMenu.
func (*PopupMenu) Click ¶
func (p *PopupMenu) Click()
Click performs any animation associated with a click and triggers the popup menu to appear.
func (*PopupMenu) DefaultDraw ¶
DefaultDraw provides the default drawing.
func (*PopupMenu) DefaultKeyDown ¶
DefaultKeyDown provides the default key down handling.
func (*PopupMenu) DefaultMouseDown ¶
func (p *PopupMenu) DefaultMouseDown(where geom32.Point, button, clickCount int, mod Modifiers) bool
DefaultMouseDown provides the default mouse down handling.
func (*PopupMenu) DefaultSizes ¶
DefaultSizes provides the default sizing.
func (*PopupMenu) IndexOfItem ¶
IndexOfItem returns the index of the specified menu item. -1 will be returned if the menu item isn't present.
func (*PopupMenu) RemoveAllItems ¶
RemoveAllItems removes all items from the PopupMenu.
func (*PopupMenu) RemoveItem ¶
RemoveItem from the PopupMenu.
func (*PopupMenu) RemoveItemAt ¶
RemoveItemAt the specified index from the PopupMenu.
func (*PopupMenu) SelectIndex ¶
SelectIndex selects an menuItem by its index.
func (*PopupMenu) Selected ¶
func (p *PopupMenu) Selected() interface{}
Selected returns the currently selected menuItem or nil.
func (*PopupMenu) SelectedIndex ¶
SelectedIndex returns the currently selected menuItem index.
type PopupMenuTheme ¶ added in v0.4.0
type PopupMenuTheme struct { Font Font BackgroundInk Ink OnBackgroundInk Ink EdgeInk Ink SelectionInk Ink OnSelectionInk Ink CornerRadius float32 HMargin float32 VMargin float32 }
PopupMenuTheme holds theming data for a PopupMenu.
type ProgressBar ¶
type ProgressBar struct { Panel ProgressBarTheme // contains filtered or unexported fields }
ProgressBar provides a meter showing progress.
func NewProgressBar ¶
func NewProgressBar(max float32) *ProgressBar
NewProgressBar creates a new progress bar. A max of zero will create an indeterminate progress bar, i.e. one whose meter animates back and forth.
func (*ProgressBar) Current ¶
func (p *ProgressBar) Current() float32
Current returns the current value of the progress bar towards its maximum.
func (*ProgressBar) DefaultDraw ¶
func (p *ProgressBar) DefaultDraw(canvas *Canvas, dirty geom32.Rect)
DefaultDraw provides the default drawing.
func (*ProgressBar) DefaultSizes ¶
func (p *ProgressBar) DefaultSizes(hint geom32.Size) (min, pref, max geom32.Size)
DefaultSizes provides the default sizing.
func (*ProgressBar) Maximum ¶
func (p *ProgressBar) Maximum() float32
Maximum returns the maximum value of the progress bar.
func (*ProgressBar) SetCurrent ¶
func (p *ProgressBar) SetCurrent(value float32)
SetCurrent sets the current value.
func (*ProgressBar) SetMaximum ¶
func (p *ProgressBar) SetMaximum(value float32)
SetMaximum sets the maximum value.
type ProgressBarTheme ¶ added in v0.4.0
type ProgressBarTheme struct { BackgroundInk Ink FillInk Ink EdgeInk Ink TickSpeed time.Duration FullTraversalSpeed time.Duration PreferredBarHeight float32 CornerRadius float32 IndeterminateWidth float32 EdgeThickness float32 }
ProgressBarTheme holds theming data for a ProgressBar.
type RadioButton ¶
type RadioButton struct { GroupPanel RadioButtonTheme ClickCallback func() Drawable Drawable Text string Pressed bool }
RadioButton represents a clickable radio button with an optional label.
func (*RadioButton) Click ¶
func (r *RadioButton) Click()
Click makes the radio button behave as if a user clicked on it.
func (*RadioButton) DefaultDraw ¶
func (r *RadioButton) DefaultDraw(canvas *Canvas, dirty geom32.Rect)
DefaultDraw provides the default drawing.
func (*RadioButton) DefaultKeyDown ¶
func (r *RadioButton) DefaultKeyDown(keyCode KeyCode, mod Modifiers, repeat bool) bool
DefaultKeyDown provides the default key down handling.
func (*RadioButton) DefaultMouseDown ¶
func (r *RadioButton) DefaultMouseDown(where geom32.Point, button, clickCount int, mod Modifiers) bool
DefaultMouseDown provides the default mouse down handling.
func (*RadioButton) DefaultMouseDrag ¶
DefaultMouseDrag provides the default mouse drag handling.
func (*RadioButton) DefaultMouseUp ¶
DefaultMouseUp provides the default mouse up handling.
func (*RadioButton) DefaultSizes ¶
func (r *RadioButton) DefaultSizes(hint geom32.Size) (min, pref, max geom32.Size)
DefaultSizes provides the default sizing.
type RadioButtonTheme ¶ added in v0.4.0
type RadioButtonTheme struct { Font Font BackgroundInk Ink OnBackgroundInk Ink EdgeInk Ink LabelInk Ink SelectionInk Ink OnSelectionInk Ink Gap float32 CornerRadius float32 ClickAnimationTime time.Duration HAlign Alignment VAlign Alignment Side Side }
RadioButtonTheme holds theming data for a RadioButton.
type SVG ¶ added in v0.3.0
type SVG struct {
// contains filtered or unexported fields
}
SVG holds an SVG path. Note that this is a subset of SVG: just the 'd' attribute of the 'path' directive.
func ChevronRightSVG ¶ added in v0.4.0
func ChevronRightSVG() *SVG
ChevronRightSVG returns an SVG that holds a chevron pointing towards the right.
func CircledChevronRightSVG ¶ added in v0.3.0
func CircledChevronRightSVG() *SVG
CircledChevronRightSVG returns an SVG that holds a circled chevron pointing towards the right.
func CircledExclamationSVG ¶ added in v0.5.0
func CircledExclamationSVG() *SVG
CircledExclamationSVG returns an SVG that holds a circled exclamation mark.
func CircledQuestionSVG ¶ added in v0.5.0
func CircledQuestionSVG() *SVG
CircledQuestionSVG returns an SVG that holds a circled question mark.
func CircledXSVG ¶ added in v0.3.0
func CircledXSVG() *SVG
CircledXSVG returns an SVG that holds an icon for closing content.
func DocumentSVG ¶ added in v0.3.0
func DocumentSVG() *SVG
DocumentSVG returns an SVG that holds an icon for a document.
func NewSVG ¶ added in v0.3.0
NewSVG creates a new SVG. The 'size' should be gotten from the original SVG's 'viewBox' parameter.
func SortAscendingSVG ¶ added in v0.3.0
func SortAscendingSVG() *SVG
SortAscendingSVG returns an SVG that holds an icon for an ascending sort.
func SortDescendingSVG ¶ added in v0.3.0
func SortDescendingSVG() *SVG
SortDescendingSVG returns an SVG that holds an icon for an descending sort.
func TriangleExclamationSVG ¶ added in v0.5.0
func TriangleExclamationSVG() *SVG
TriangleExclamationSVG returns an SVG that holds an exclamation mark inside a triangle.
func WindowMaximizeSVG ¶ added in v0.3.0
func WindowMaximizeSVG() *SVG
WindowMaximizeSVG returns an SVG that holds an icon for maximizing a window.
func WindowRestoreSVG ¶ added in v0.3.0
func WindowRestoreSVG() *SVG
WindowRestoreSVG returns an SVG that holds an icon for restoring a maximized window.
func (*SVG) OffsetToCenterWithinScaledSize ¶ added in v0.3.0
OffsetToCenterWithinScaledSize returns the scaled offset values to use to keep the image centered within the given size.
func (*SVG) PathForSize ¶ added in v0.3.0
PathForSize returns the path scaled to fit in the specified size. You should not modify this path, as it is cached.
func (*SVG) PathScaledTo ¶ added in v0.3.0
PathScaledTo returns the path with the specified scaling. You should not modify this path, as it is cached.
type SamplingOptions ¶
type SamplingOptions struct { UseCubic bool CubicResampler CubicResampler FilterMode FilterMode MipMapMode MipMapMode // contains filtered or unexported fields }
SamplingOptions controls how images are sampled.
type SaveDialog ¶
type SaveDialog interface { // InitialDirectory returns a path pointing to the directory the dialog will open up in. InitialDirectory() string // SetInitialDirectory sets the directory the dialog will open up in. SetInitialDirectory(dir string) // AllowedExtensions returns the set of permitted file extensions. nil will be returned if all files are allowed. AllowedExtensions() []string // SetAllowedExtensions sets the permitted file extensions that may be selected. Just the extension is needed, e.g. // "txt", not ".txt" or "*.txt", etc. Pass in nil to allow all files. SetAllowedExtensions(extensions ...string) // RunModal displays the dialog, allowing the user to make a selection. Returns true if successful or false if // canceled. RunModal() bool // Path returns the path that was chosen. Path() string }
SaveDialog represents a dialog that permits a user to select where to save a file.
func NewCommonSaveDialog ¶
func NewCommonSaveDialog() SaveDialog
NewCommonSaveDialog creates a new SaveDialog. This is the fallback Go-only version of the SaveDialog used when a non-platform-native version doesn't exist. Where possible, use of NewSaveDialog() should be preferred, since platforms like macOS and Windows usually have restrictions on file access that their native dialogs automatically remove for the user.
func NewSaveDialog ¶
func NewSaveDialog() SaveDialog
NewSaveDialog creates a new save dialog using native support where possible.
type ScrollBar ¶
type ScrollBar struct { Panel ScrollBarTheme ChangedCallback func() // contains filtered or unexported fields }
ScrollBar holds the data necessary for tracking a scroll bar's state.
func NewScrollBar ¶
NewScrollBar creates a new scroll bar.
func (*ScrollBar) DefaultDraw ¶
DefaultDraw provides the default drawing.
func (*ScrollBar) DefaultMouseDown ¶
func (s *ScrollBar) DefaultMouseDown(where geom32.Point, button, clickCount int, mod Modifiers) bool
DefaultMouseDown provides the default mouse down handling.
func (*ScrollBar) DefaultMouseDrag ¶
DefaultMouseDrag provides the default mouse drag handling.
func (*ScrollBar) DefaultMouseEnter ¶
DefaultMouseEnter provides the default mouse enter handling.
func (*ScrollBar) DefaultMouseExit ¶
DefaultMouseExit provides the default mouse enter handling.
func (*ScrollBar) DefaultMouseMove ¶
DefaultMouseMove provides the default mouse move handling.
func (*ScrollBar) DefaultMouseUp ¶
DefaultMouseUp provides the default mouse up handling.
func (*ScrollBar) DefaultSizes ¶
DefaultSizes provides the default sizing.
func (*ScrollBar) Extent ¶
Extent returns the amount of space representing the visible content area.
func (*ScrollBar) Horizontal ¶
Horizontal returns true if this is a horizontal scroll bar.
func (*ScrollBar) MaxValue ¶
MaxValue returns the maximum value that can be set without adjusting the extent or max.
type ScrollBarTheme ¶ added in v0.4.0
type ScrollBarTheme struct { EdgeInk Ink ThumbInk Ink RolloverInk Ink MinimumThickness float32 MinimumThumb float32 ThumbIndent float32 CornerRadius float32 }
ScrollBarTheme holds theming data for a ScrollBar.
type ScrollPanel ¶
type ScrollPanel struct { Panel ScrollPanelTheme MouseWheelMultiplier float32 // contains filtered or unexported fields }
ScrollPanel provides a scrollable area.
func NewScrollPanel ¶
func NewScrollPanel() *ScrollPanel
NewScrollPanel creates a new scrollable area.
func (*ScrollPanel) Bar ¶
func (s *ScrollPanel) Bar(horizontal bool) *ScrollBar
Bar returns the specified scroll bar.
func (*ScrollPanel) ColumnHeader ¶
func (s *ScrollPanel) ColumnHeader() Paneler
ColumnHeader returns the current column header, if any.
func (*ScrollPanel) ColumnHeaderView ¶ added in v0.7.0
func (s *ScrollPanel) ColumnHeaderView() *Panel
ColumnHeaderView returns the column header view port. May be nil, if there is no column header.
func (*ScrollPanel) Content ¶
func (s *ScrollPanel) Content() Paneler
Content returns the content panel.
func (*ScrollPanel) ContentView ¶ added in v0.7.0
func (s *ScrollPanel) ContentView() *Panel
ContentView returns the content view port.
func (*ScrollPanel) DefaultDraw ¶
func (s *ScrollPanel) DefaultDraw(canvas *Canvas, dirty geom32.Rect)
DefaultDraw provides the default drawing.
func (*ScrollPanel) DefaultFrameChangeInChildHierarchy ¶
func (s *ScrollPanel) DefaultFrameChangeInChildHierarchy(panel *Panel)
DefaultFrameChangeInChildHierarchy provides the default frame change in child hierarchy handling.
func (*ScrollPanel) DefaultMouseWheel ¶
func (s *ScrollPanel) DefaultMouseWheel(where, delta geom32.Point, mod Modifiers) bool
DefaultMouseWheel provides the default mouse wheel handling.
func (*ScrollPanel) DefaultScrollRectIntoView ¶
func (s *ScrollPanel) DefaultScrollRectIntoView(rect geom32.Rect) bool
DefaultScrollRectIntoView provides the default scroll rect into contentView handling.
func (*ScrollPanel) LayoutSizes ¶
LayoutSizes implements the Layout interface.
func (*ScrollPanel) PerformLayout ¶
func (s *ScrollPanel) PerformLayout(_ *Panel)
PerformLayout implements the Layout interface.
func (*ScrollPanel) Position ¶
func (s *ScrollPanel) Position() (h, v float32)
Position returns the current scroll position.
func (*ScrollPanel) RowHeader ¶
func (s *ScrollPanel) RowHeader() Paneler
RowHeader returns the current row header, if any.
func (*ScrollPanel) RowHeaderView ¶ added in v0.7.0
func (s *ScrollPanel) RowHeaderView() *Panel
RowHeaderView returns the row header view port. May be nil, if there is no row header.
func (*ScrollPanel) SetColumnHeader ¶
func (s *ScrollPanel) SetColumnHeader(p Paneler)
SetColumnHeader sets the current column header. May be nil.
func (*ScrollPanel) SetContent ¶
func (s *ScrollPanel) SetContent(p Paneler, behave Behavior)
SetContent sets the content panel.
func (*ScrollPanel) SetPosition ¶
func (s *ScrollPanel) SetPosition(h, v float32)
SetPosition sets the current scroll position.
func (*ScrollPanel) SetRowHeader ¶
func (s *ScrollPanel) SetRowHeader(p Paneler)
SetRowHeader sets the current row header. May be nil.
func (*ScrollPanel) Sync ¶ added in v0.8.0
func (s *ScrollPanel) Sync()
Sync the headers and content with the current scroll state.
type ScrollPanelTheme ¶ added in v0.4.0
type ScrollPanelTheme struct {
BackgroundInk Ink
}
ScrollPanelTheme holds theming data for a ScrollPanel.
type Separator ¶
type Separator struct { Panel SeparatorTheme }
Separator provides a simple vertical or horizontal separator line.
func (*Separator) DefaultDraw ¶
DefaultDraw provides the default drawing.
type SeparatorTheme ¶ added in v0.4.0
SeparatorTheme holds theming data for a Separator.
type Shader ¶
type Shader struct {
// contains filtered or unexported fields
}
Shader specifies the source color(s) for what is being drawn. If a paint has no shader, then the paint's color is used. If the paint has a shader, then the shader's color(s) are use instead, but they are modulated by the paint's alpha. This makes it easy to create a shader once (e.g. bitmap tiling or gradient) and then change its transparency without having to modify the original shader... only the paint's alpha needs to be modified.
func New2PtConicalGradientShader ¶
func New2PtConicalGradientShader(startPt, endPt geom32.Point, startRadius, endRadius float32, colors []Color, colorPos []float32, tileMode TileMode, matrix *geom32.Matrix2D) *Shader
New2PtConicalGradientShader creates a new 2-point conical gradient Shader. matrix may be nil.
func NewBlendShader ¶
NewBlendShader creates a new blend Shader.
func NewColorShader ¶
NewColorShader creates a new color Shader.
func NewFractalPerlinNoiseShader ¶
func NewFractalPerlinNoiseShader(baseFreqX, baseFreqY, seed float32, numOctaves, tileWidth, tileHeight int) *Shader
NewFractalPerlinNoiseShader creates a new fractal perlin noise Shader.
func NewImageShader ¶
func NewImageShader(canvas *Canvas, img *Image, tileModeX, tileModeY TileMode, sampling *SamplingOptions, matrix *geom32.Matrix2D) *Shader
NewImageShader creates a new image Shader. If canvas is not nil, a hardware-accellerated image will be used if possible.
func NewLinearGradientShader ¶
func NewLinearGradientShader(start, end geom32.Point, colors []Color, colorPos []float32, tileMode TileMode, matrix *geom32.Matrix2D) *Shader
NewLinearGradientShader creates a new linear gradient Shader. matrix may be nil.
func NewRadialGradientShader ¶
func NewRadialGradientShader(center geom32.Point, radius float32, colors []Color, colorPos []float32, tileMode TileMode, matrix *geom32.Matrix2D) *Shader
NewRadialGradientShader creates a new radial gradient Shader. matrix may be nil.
func NewSweepGradientShader ¶
func NewSweepGradientShader(center geom32.Point, startAngle, endAngle float32, colors []Color, colorPos []float32, tileMode TileMode, matrix *geom32.Matrix2D) *Shader
NewSweepGradientShader creates a new sweep gradient Shader. matrix may be nil.
func NewTurbulencePerlinNoiseShader ¶
func NewTurbulencePerlinNoiseShader(baseFreqX, baseFreqY, seed float32, numOctaves, tileWidth, tileHeight int) *Shader
NewTurbulencePerlinNoiseShader creates a new turbulence perlin noise Shader.
func (*Shader) NewWithColorFilter ¶
func (s *Shader) NewWithColorFilter(filter *ColorFilter) *Shader
NewWithColorFilter creates a new copy of this shader with a color filter applied.
type Side ¶
type Side uint8
Side specifies which side an object should be on.
func (Side) Horizontal ¶
Horizontal returns true if the side is to the left or right.
type Sizer ¶
Sizer returns minimum, preferred, and maximum sizes. The hint will contain values other than zero for a dimension that has already been determined.
type SortState ¶ added in v0.3.0
type SortState struct { Order int // A negative value indicates it isn't participating at the moment. Ascending bool Sortable bool // A false value indicates it is not sortable at all }
SortState holds data regarding a sort state.
type StartupOption ¶
type StartupOption func(startupOption) error
StartupOption holds an option for application startup.
func AllowQuitCallback ¶
func AllowQuitCallback(f func() bool) StartupOption
AllowQuitCallback will cause f to be called when app termination has been requested. Return true to permit the request. By default, app termination requests are permitted.
func NoGlobalMenuBar ¶
func NoGlobalMenuBar() StartupOption
NoGlobalMenuBar will disable the global menu bar on platforms that normally use it, instead using the in-window menu bar.
func OpenFilesCallback ¶ added in v0.5.0
func OpenFilesCallback(f func(urls []string)) StartupOption
OpenFilesCallback will cause f to be called when the application is asked to open one or more files by the OS or an external application. By default, nothing is done with the request.
func QuitAfterLastWindowClosedCallback ¶
func QuitAfterLastWindowClosedCallback(f func() bool) StartupOption
QuitAfterLastWindowClosedCallback will cause f to be called when the last window is closed to determine if the application should quit as a result. By default, the app will terminate when the last window is closed.
func QuittingCallback ¶
func QuittingCallback(f func()) StartupOption
QuittingCallback will cause f to be called just before the app terminates.
func RecoveryCallback ¶
func RecoveryCallback(f errs.RecoveryHandler) StartupOption
RecoveryCallback will cause f to be called should a task invoked via task.InvokeTask() or task.InvokeTaskAfter() panic. If no recovery callback is set, the panic will be logged via jot.Error(err).
func StartupFinishedCallback ¶
func StartupFinishedCallback(f func()) StartupOption
StartupFinishedCallback will cause f to be called once application startup has completed and it is about to start servicing the event loop. You should create your app's windows at this point.
func ThemeChangedCallback ¶
func ThemeChangedCallback(f func()) StartupOption
ThemeChangedCallback will cause f to be called when the theme is changed. This occurs after the colors have been updated, but before any windows have been redraw.
type Stop ¶
type Stop struct { Color ColorProvider Location float32 }
Stop provides information about the color and position of one 'color stop' in a gradient.
type StrokeCap ¶
type StrokeCap byte
StrokeCap holds the style for rendering the endpoint of a stroked line.
type StrokeJoin ¶
type StrokeJoin byte
StrokeJoin holds the method for drawing the junction between connected line segments.
const ( MiterJoin StrokeJoin = iota RoundJoin BevelJoin )
Possible values for StrokeJoin.
type TabCloser ¶ added in v0.3.0
type TabCloser interface { MayAttemptClose() bool AttemptClose() }
TabCloser defines the methods that must be implemented to cause the tabs to show a close button.
type Table ¶ added in v0.3.0
type Table struct { Panel TableTheme SelectionDoubleClickCallback func() ColumnSizes []ColumnSize // contains filtered or unexported fields }
Table provides a control that can display data in columns and rows.
func (*Table) ClearSelection ¶ added in v0.7.0
func (t *Table) ClearSelection()
ClearSelection clears the selection.
func (*Table) DefaultDraw ¶ added in v0.3.0
DefaultDraw provides the default drawing.
func (*Table) DefaultMouseDown ¶ added in v0.3.0
DefaultMouseDown provides the default mouse down handling.
func (*Table) DefaultMouseDrag ¶ added in v0.3.0
DefaultMouseDrag provides the default mouse drag handling.
func (*Table) DefaultMouseEnter ¶ added in v0.7.0
DefaultMouseEnter provides the default mouse enter handling.
func (*Table) DefaultMouseExit ¶ added in v0.7.0
DefaultMouseExit provides the default mouse exit handling.
func (*Table) DefaultMouseMove ¶ added in v0.3.0
DefaultMouseMove provides the default mouse move handling.
func (*Table) DefaultMouseUp ¶ added in v0.3.0
DefaultMouseUp provides the default mouse up handling.
func (*Table) DefaultSizes ¶ added in v0.3.0
DefaultSizes provides the default sizing.
func (*Table) DefaultUpdateCursorCallback ¶ added in v0.3.0
DefaultUpdateCursorCallback provides the default cursor update handling.
func (*Table) DefaultUpdateTooltipCallback ¶ added in v0.3.0
func (t *Table) DefaultUpdateTooltipCallback(where geom32.Point, suggestedAvoidInRoot geom32.Rect) geom32.Rect
DefaultUpdateTooltipCallback provides the default tooltip update handling.
func (*Table) DeselectByIndex ¶ added in v0.7.0
DeselectByIndex deselects the given indexes.
func (*Table) DiscloseRow ¶ added in v0.7.0
func (t *Table) DiscloseRow(row TableRowData, delaySync bool) bool
DiscloseRow ensures the given row can be viewed by opening all parents that lead to it. Returns true if any modification was made.
func (*Table) EventuallySizeColumnsToFit ¶ added in v0.3.0
EventuallySizeColumnsToFit sizes each column to its preferred size after a short delay, allowing multiple back-to-back calls to this function to only do work once. If 'adjust' is true, the Table's FrameRect will be set to its preferred size as well.
func (*Table) EventuallySyncToModel ¶ added in v0.6.0
func (t *Table) EventuallySyncToModel()
EventuallySyncToModel syncs the table to its underlying model after a short delay, allowing multiple back-to-back calls to this function to only do work once.
func (*Table) IsRowOrAnyParentSelected ¶ added in v0.3.0
IsRowOrAnyParentSelected returns true if the specified row index or any of its parents are selected.
func (*Table) IsRowSelected ¶ added in v0.7.0
IsRowSelected returns true if the specified row index is selected.
func (*Table) OverColumn ¶ added in v0.3.0
OverColumn returns the column index that the x coordinate is over, or -1 if it isn't over any column.
func (*Table) OverColumnDivider ¶ added in v0.3.0
OverColumnDivider returns the column index of the column divider that the x coordinate is over, or -1 if it isn't over any column divider.
func (*Table) OverRow ¶ added in v0.3.0
OverRow returns the row index that the y coordinate is over, or -1 if it isn't over any row.
func (*Table) RowToIndex ¶ added in v0.7.0
func (t *Table) RowToIndex(row TableRowData) int
RowToIndex returns the row's index within the displayed data, or -1 if it isn't currently in the disclosed rows.
func (*Table) ScrollRowIntoView ¶ added in v0.7.0
ScrollRowIntoView scrolls the row at the given index into view.
func (*Table) SelectByIndex ¶ added in v0.7.0
SelectByIndex selects the given indexes. The first one will be considered the anchor selection if no existing anchor selection exists.
func (*Table) SelectedRows ¶ added in v0.4.0
func (t *Table) SelectedRows() []TableRowData
SelectedRows returns the currently selected rows. Note that children of selected rows are not returned, just the topmost row that is selected in any given hierarchy.
func (*Table) SetTopLevelRows ¶ added in v0.3.0
func (t *Table) SetTopLevelRows(rows []TableRowData)
SetTopLevelRows sets the top-level rows this table will display. This will call SyncToModel() automatically.
func (*Table) SizeColumnToFit ¶ added in v0.3.0
SizeColumnToFit sizes the specified column to its preferred size. If 'adjust' is true, the Table's FrameRect will be set to its preferred size as well.
func (*Table) SizeColumnsToFit ¶ added in v0.3.0
SizeColumnsToFit sizes each column to its preferred size. If 'adjust' is true, the Table's FrameRect will be set to its preferred size as well.
func (*Table) SyncToModel ¶ added in v0.3.0
func (t *Table) SyncToModel()
SyncToModel causes the table to update its internal caches to reflect the current model.
func (*Table) TopLevelRows ¶ added in v0.5.0
func (t *Table) TopLevelRows() []TableRowData
TopLevelRows returns the top-level rows.
type TableColumnHeader ¶ added in v0.3.0
TableColumnHeader defines the methods a table column header must implement.
type TableHeader ¶ added in v0.3.0
type TableHeader struct { Panel TableHeaderTheme Table *Table ColumnHeaders []TableColumnHeader Less func(s1, s2 string) bool // contains filtered or unexported fields }
TableHeader provides a header for a Table.
func NewTableHeader ¶ added in v0.3.0
func NewTableHeader(table *Table, columnHeaders ...TableColumnHeader) *TableHeader
NewTableHeader creates a new TableHeader.
func (*TableHeader) ApplySort ¶ added in v0.3.0
func (h *TableHeader) ApplySort()
ApplySort sorts the table according to the current sort criteria.
func (*TableHeader) ColumnFrame ¶ added in v0.3.0
func (h *TableHeader) ColumnFrame(col int) geom32.Rect
ColumnFrame returns the frame of the given column.
func (*TableHeader) DefaultDraw ¶ added in v0.3.0
func (h *TableHeader) DefaultDraw(canvas *Canvas, dirty geom32.Rect)
DefaultDraw provides the default drawing.
func (*TableHeader) DefaultMouseDown ¶ added in v0.3.0
func (h *TableHeader) DefaultMouseDown(where geom32.Point, button, clickCount int, mod Modifiers) bool
DefaultMouseDown provides the default mouse down handling.
func (*TableHeader) DefaultMouseDrag ¶ added in v0.3.0
DefaultMouseDrag provides the default mouse drag handling.
func (*TableHeader) DefaultMouseMove ¶ added in v0.3.0
func (h *TableHeader) DefaultMouseMove(where geom32.Point, mod Modifiers) bool
DefaultMouseMove provides the default mouse move handling.
func (*TableHeader) DefaultMouseUp ¶ added in v0.3.0
DefaultMouseUp provides the default mouse up handling.
func (*TableHeader) DefaultSizes ¶ added in v0.3.0
func (h *TableHeader) DefaultSizes(hint geom32.Size) (min, pref, max geom32.Size)
DefaultSizes provides the default sizing.
func (*TableHeader) DefaultUpdateCursorCallback ¶ added in v0.3.0
func (h *TableHeader) DefaultUpdateCursorCallback(where geom32.Point) *Cursor
DefaultUpdateCursorCallback provides the default cursor update handling.
func (*TableHeader) DefaultUpdateTooltipCallback ¶ added in v0.3.0
func (h *TableHeader) DefaultUpdateTooltipCallback(where geom32.Point, suggestedAvoidInRoot geom32.Rect) geom32.Rect
DefaultUpdateTooltipCallback provides the default tooltip update handling.
func (*TableHeader) SortOn ¶ added in v0.3.0
func (h *TableHeader) SortOn(header TableColumnHeader)
SortOn adjusts the sort such that the specified header is the primary sort column. If the header was already the primary sort column, then its ascending/descending flag will be flipped instead.
type TableHeaderTheme ¶ added in v0.4.0
TableHeaderTheme holds theming data for a TableHeader.
type TableRowData ¶ added in v0.3.0
type TableRowData interface { // ParentRow returns the parent of this row, or nil if it is a root node. ParentRow() TableRowData // CanHaveChildRows returns true if this row can have children, even if it currently does not have any. CanHaveChildRows() bool // ChildRows returns the child rows. ChildRows() []TableRowData // ColumnCell returns the panel that should be placed at the position of the cell for the given column index. If you // need for the cell to retain widget state, make sure to return the same widget each time rather than creating a // new one. ColumnCell(row, col int, selected bool) Paneler // IsOpen returns true if the row can have children and is currently showing its children. IsOpen() bool // SetOpen sets the row's open state. SetOpen(open bool) // CellDataForSort returns the string that represents the data in the specified cell. CellDataForSort(index int) string }
TableRowData provides information about a single row of data.
type TableTheme ¶ added in v0.4.0
type TableTheme struct { BackgroundInk Ink OnBackgroundInk Ink BandingInk Ink OnBandingInk Ink DividerInk Ink SelectionInk Ink OnSelectionInk Ink Padding geom32.Insets HierarchyColumnIndex int HierarchyIndent float32 MinimumRowHeight float32 ColumnResizeSlop float32 ShowRowDivider bool ShowColumnDivider bool }
TableTheme holds theming data for a Table.
type Text ¶
type Text struct { Runes []rune Decorations []*TextDecoration // contains filtered or unexported fields }
Text holds data necessary to draw a string using font fallbacks where necessary.
func NewText ¶
func NewText(str string, decoration *TextDecoration) *Text
NewText creates a new Text. Note that tabs and line endings are not considered.
func NewTextFromRunes ¶ added in v0.7.0
func NewTextFromRunes(runes []rune, decoration *TextDecoration) *Text
NewTextFromRunes creates a new Text. Note that tabs and line endings are not considered. This is more efficient than NewText(), since the string doesn't have to be converted to runes first.
func NewTextLines ¶ added in v0.7.0
func NewTextLines(text string, decoration *TextDecoration) []*Text
NewTextLines creates a new list of Text, one for each logical line. Tabs are not considered, but the text is split on any line feeds found.
func NewTextWrappedLines ¶ added in v0.7.0
func NewTextWrappedLines(text string, decoration *TextDecoration, width float32) []*Text
NewTextWrappedLines creates a new list of Text, potentially multiple for each logical line. Tabs are not considered, but the text is split on any line feeds found and then wrapped to the given width. See Text.BreakToWidth().
func (*Text) AddRunes ¶ added in v0.7.0
func (t *Text) AddRunes(runes []rune, decoration *TextDecoration)
AddRunes adds runes with the given decoration to this Text. This is more efficient than AddString(), since the string doesn't have to be converted to runes first.
func (*Text) AddString ¶ added in v0.7.0
func (t *Text) AddString(str string, decoration *TextDecoration)
AddString adds a string with the given decoration to this Text.
func (*Text) Baseline ¶ added in v0.7.0
Baseline returns the largest baseline found, after considering any baseline offset adjustments.
func (*Text) BreakToWidth ¶ added in v0.7.0
BreakToWidth breaks the given text into multiple lines that are <= width. Trailing whitespace is not considered for purposes of fitting within the given width. A minimum of one word will be placed on a line, even if that word is wider than the given width.
func (*Text) Draw ¶ added in v0.7.0
Draw the Text at the given location. y is where the baseline of the text will be placed.
func (*Text) PositionForRuneIndex ¶ added in v0.7.0
PositionForRuneIndex returns the x-coordinate where the specified rune index starts. The returned coordinate assumes 0 is the start of the string. Note that this does not account for any embedded line endings nor tabs.
func (*Text) RuneIndexForPosition ¶ added in v0.7.0
RuneIndexForPosition returns the rune index within the string for the specified x-coordinate, where 0 is the start of the string.
func (*Text) Slice ¶ added in v0.7.0
Slice creates a new Text that is a slice of this Text. The indexes refer to rune positions.
type TextDecoration ¶ added in v0.7.0
type TextDecoration struct { Font Font Paint *Paint BaselineOffset float32 Underline bool StrikeThrough bool }
TextDecoration holds the decorations that can be applied to text when drawn.
func (*TextDecoration) Equivalent ¶ added in v0.7.0
func (d *TextDecoration) Equivalent(other *TextDecoration) bool
Equivalent returns true if this TextDecoration is equivalent to the other.
type ThemeColor ¶
ThemeColor holds a pair of colors, one for light mode and one for dark mode.
func (*ThemeColor) GetColor ¶ added in v0.2.0
func (t *ThemeColor) GetColor() Color
GetColor returns the current color. Here to satisfy the ColorProvider interface.
func (*ThemeColor) Paint ¶
func (t *ThemeColor) Paint(canvas *Canvas, rect geom32.Rect, style PaintStyle) *Paint
Paint returns a Paint for this ThemeColor. Here to satisfy the Ink interface.
type TooltipTheme ¶ added in v0.4.0
type TooltipTheme struct { SecondaryTextFont Font BackgroundInk Ink BaseBorder Border Label LabelTheme Delay time.Duration Dismissal time.Duration }
TooltipTheme holds theming data for a Tooltip.
type UndoEdit ¶
type UndoEdit interface { // Name returns the localized name of the edit, suitable for displaying in a user interface menu. Note that no // leading "Undo " or "Redo " should be part of this name, as the UndoManager will add this. Name() string // Cost returns a cost factor for this edit. When the cost values of the edits within a given UndoManager exceed the // UndoManager's defined cost limit, the oldest edits will be discarded until the cost values are less than or equal // to the UndoManager's defined limit. Note that if this method returns a value less than 1, it will be set to 1 for // purposes of this calculation. Cost() int // Undo the state. Undo() // Redo the state. Redo() // Absorb gives this edit a chance to absorb a new edit that is about to be added to the manager. If this method // returns true, it is assumed this edit has incorporated any necessary state into itself to perform an undo/redo // and the other edit will be discarded. Absorb(other UndoEdit) bool // Release is called when this edit is no longer needed by the UndoManager. Release() }
UndoEdit defines the required methods an undoable edit must implement.
type UndoManager ¶
type UndoManager struct {
// contains filtered or unexported fields
}
UndoManager provides management of an undo/redo stack.
func NewUndoManager ¶
func NewUndoManager(costLimit int, recoveryHandler errs.RecoveryHandler) *UndoManager
NewUndoManager creates a new undo/redo manager.
func (*UndoManager) Add ¶
func (m *UndoManager) Add(edit UndoEdit)
Add an edit. If one or more undos have been performed, this will cause any redo capability beyond this point to be lost.
func (*UndoManager) CanRedo ¶
func (m *UndoManager) CanRedo() bool
CanRedo returns true if Redo() can be called successfully.
func (*UndoManager) CanUndo ¶
func (m *UndoManager) CanUndo() bool
CanUndo returns true if Undo() can be called successfully.
func (*UndoManager) Clear ¶
func (m *UndoManager) Clear()
Clear removes all edits from this UndoManager.
func (*UndoManager) CostLimit ¶
func (m *UndoManager) CostLimit() int
CostLimit returns the current cost limit permitted by this undo manager.
func (*UndoManager) Redo ¶
func (m *UndoManager) Redo()
Redo re-applies the current state by one edit.
func (*UndoManager) RedoTitle ¶
func (m *UndoManager) RedoTitle() string
RedoTitle returns the title for the current redo state.
func (*UndoManager) SetCostLimit ¶
func (m *UndoManager) SetCostLimit(limit int)
SetCostLimit sets a new cost limit, potentially trimming existing edits to fit within the new limit. Note that if the most recent edit has a cost larger than the new limit, that last edit (and only that last edit) will still be retained.
func (*UndoManager) UndoTitle ¶
func (m *UndoManager) UndoTitle() string
UndoTitle returns the title for the current undo state.
type Well ¶
type Well struct { Panel WellTheme ImageFromSpecCallback func(filePathOrURL string, scale float32) (*Image, error) InkChangedCallback func() ClickCallback func() ValidateImageCallback func(*Image) *Image Pressed bool // contains filtered or unexported fields }
Well represents a control that holds and lets a user choose an ink.
func (*Well) Click ¶
func (w *Well) Click()
Click makes the ink well behave as if a user clicked on it.
func (*Well) DefaultClick ¶
func (w *Well) DefaultClick()
DefaultClick provides the default click handling, which shows a dialog for selecting an ink.
func (*Well) DefaultDraw ¶
DefaultDraw provides the default drawing.
func (*Well) DefaultFileDrop ¶
DefaultFileDrop provides the default file drop behavior.
func (*Well) DefaultKeyDown ¶
DefaultKeyDown provides the default key down handling.
func (*Well) DefaultMouseDown ¶
DefaultMouseDown provides the default mouse down handling.
func (*Well) DefaultMouseDrag ¶
DefaultMouseDrag provides the default mouse drag handling.
func (*Well) DefaultMouseUp ¶
DefaultMouseUp provides the default mouse up handling.
func (*Well) DefaultSizes ¶
DefaultSizes provides the default sizing.
type WellMask ¶
type WellMask uint8
WellMask is used to limit the types of ink permitted in the ink well.
type WellTheme ¶ added in v0.4.0
type WellTheme struct { BackgroundInk Ink EdgeInk Ink SelectionInk Ink ClickAnimationTime time.Duration ImageScale float32 ContentSize float32 CornerRadius float32 Mask WellMask }
WellTheme holds theming data for a Well.
type Window ¶
type Window struct { InputCallbacks // MinMaxContentSizeCallback returns the minimum and maximum size for the window content. MinMaxContentSizeCallback func() (min, max geom32.Size) // MovedCallback is called when the window is moved. MovedCallback func() // ResizedCallback is called when the window is resized. If constrained is true, then the resulting window size has // already been constrained and there is no need to do so again. ResizedCallback func(constrained bool) // AllowCloseCallback is called when the user has requested that the window be closed. Return true to permit it, // false to cancel the operation. Defaults to always returning true. AllowCloseCallback func() bool // WillCloseCallback is called just prior to the window closing. WillCloseCallback func() // contains filtered or unexported fields }
Window holds window information.
func ActiveWindow ¶
func ActiveWindow() *Window
ActiveWindow returns the window that currently has the keyboard focus, or nil if none of your application windows has the keyboard focus.
func NewWindow ¶
func NewWindow(title string, options ...WindowOption) (*Window, error)
NewWindow creates a new, initially hidden, window. Call Show() or ToFront() to make it visible.
func Windows ¶
func Windows() []*Window
Windows returns a slice containing the current set of open windows.
func (*Window) AttemptClose ¶
func (w *Window) AttemptClose()
AttemptClose closes the window if permitted.
func (*Window) BackingScale ¶
BackingScale returns the scale of the backing store for this window.
func (*Window) ClearTooltip ¶
func (w *Window) ClearTooltip()
ClearTooltip clears any existing tooltip and resets the timer.
func (*Window) ClientData ¶
ClientData returns a map of client data for this window.
func (*Window) ContentRect ¶
ContentRect returns the boundaries in display coordinates of the window's content area.
func (*Window) ContentRectForFrameRect ¶
ContentRectForFrameRect returns the content rect for the given frame rect.
func (*Window) FlushDrawing ¶
func (w *Window) FlushDrawing()
FlushDrawing causes any areas marked for drawing to be drawn now.
func (*Window) FocusNext ¶
func (w *Window) FocusNext()
FocusNext moves the keyboard focus to the next focusable panel.
func (*Window) FocusPrevious ¶
func (w *Window) FocusPrevious()
FocusPrevious moves the keyboard focus to the previous focusable panel.
func (*Window) FrameRect ¶
FrameRect returns the boundaries in display coordinates of the frame of this window (i.e. the area that includes both the content and its border and window controls).
func (*Window) FrameRectForContentRect ¶
FrameRectForContentRect returns the frame rect for the given content rect.
func (*Window) Hide ¶
func (w *Window) Hide()
Hide hides the window, if it was previously visible. If the window is already hidden or is in full screen mode, this function does nothing.
func (*Window) HideCursorUntilMouseMoves ¶
func (w *Window) HideCursorUntilMouseMoves()
HideCursorUntilMouseMoves hides the cursor until the mouse is moved.
func (*Window) IsDragGesture ¶ added in v0.3.0
IsDragGesture returns true if a gesture to start a drag operation was made.
func (*Window) IsValid ¶
IsValid returns true if the window is still valid (i.e. hasn't been disposed).
func (*Window) LocalContentRect ¶
LocalContentRect returns the boundaries in local coordinates of the window's content area.
func (*Window) MarkForRedraw ¶
func (w *Window) MarkForRedraw()
MarkForRedraw marks this window for drawing at the next update.
func (*Window) Minimize ¶
func (w *Window) Minimize()
Minimize performs the minimize function on the window.
func (*Window) MouseLocation ¶
MouseLocation returns the current mouse location relative to this window.
func (*Window) Pack ¶
func (w *Window) Pack()
Pack sets the window's content size to match the preferred size of the root panel.
func (*Window) RunModal ¶
RunModal displays and brings this window to the front, the runs a modal event loop until StopModal is called. Disposes the window before it returns.
func (*Window) SetContent ¶
SetContent sets the content panel for the window.
func (*Window) SetContentRect ¶
SetContentRect sets the boundaries of the frame of this window by converting the content rect into a suitable frame rect and then applying it to the window.
func (*Window) SetFrameRect ¶
SetFrameRect sets the boundaries of the frame of this window.
func (*Window) Show ¶
func (w *Window) Show()
Show makes the window visible, if it was previously hidden. If the window is already visible or is in full screen mode, this function does nothing.
func (*Window) StartDataDrag ¶ added in v0.3.0
StartDataDrag starts a data drag operation.
func (*Window) StopModal ¶
StopModal stops the current modal event loop and propagates the provided code as the result to RunModal().
func (*Window) ToFront ¶
func (w *Window) ToFront()
ToFront attempts to bring the window to the foreground and give it the keyboard focus. If it is hidden, it will be made visible first.
func (*Window) UpdateCursorNow ¶
func (w *Window) UpdateCursorNow()
UpdateCursorNow causes the cursor to be updated as if the mouse had moved.
func (*Window) ValidateLayout ¶
func (w *Window) ValidateLayout()
ValidateLayout performs any layout that needs to be run by this window or its children.
type WindowOption ¶
WindowOption holds an option for window creation.
func FloatingWindowOption ¶
func FloatingWindowOption() WindowOption
FloatingWindowOption causes the window to float in front of all other non-floating windows.
func NotResizableWindowOption ¶ added in v0.2.0
func NotResizableWindowOption() WindowOption
NotResizableWindowOption prevents the window from being resized by the user.
func TransientWindowOption ¶
func TransientWindowOption() WindowOption
TransientWindowOption causes the window to be marked as transient, which means it will never be considered the active window.
func UndecoratedWindowOption ¶
func UndecoratedWindowOption() WindowOption
UndecoratedWindowOption prevents the standard window decorations (title as well as things like close buttons) from being shown.
Source Files ¶
- action.go
- app.go
- app_linux.go
- border.go
- button.go
- canvas.go
- cell_factory.go
- check_box.go
- check_state.go
- clipboard.go
- color.go
- color_filter.go
- compound_border.go
- console.go
- console_other.go
- cursor.go
- dialog.go
- dialog_button_info.go
- display.go
- dock.go
- dock_container.go
- dock_container_content.go
- dock_header.go
- dock_layout.go
- dock_tab.go
- drawable.go
- dynamic_color.go
- dynamic_font.go
- empty_border.go
- field.go
- file_dialog.go
- flex_layout.go
- flow_layout.go
- font.go
- font_descriptor.go
- font_face.go
- font_family.go
- font_slant.go
- font_spacing.go
- font_weight.go
- gradient.go
- group.go
- group_panel.go
- helpers.go
- image.go
- image_filter.go
- image_format.go
- images.go
- indirect_font.go
- input_callbacks.go
- key_binding.go
- keys.go
- label.go
- layout.go
- line_border.go
- list.go
- mask_filter.go
- menu.go
- menu_bar.go
- menu_bar_other.go
- menu_factory.go
- menu_factory_other.go
- menu_item.go
- modifiers.go
- modifiers_other.go
- open_dialog.go
- open_dialog_linux.go
- paint.go
- panel.go
- path.go
- path_effect.go
- pattern.go
- popup_menu.go
- progress_bar.go
- radio_button.go
- release.go
- root_panel.go
- sampling_options.go
- save_dialog.go
- save_dialog_linux.go
- scroll_bar.go
- scroll_panel.go
- separator.go
- shader.go
- sort_state.go
- surface.go
- svg.go
- table.go
- table_column_header.go
- table_header.go
- task.go
- text.go
- theme_color.go
- tooltip.go
- undo.go
- well.go
- well_dialog.go
- window.go