Documentation ¶
Index ¶
- Constants
- Variables
- func AllWindowsToFront()
- func AttemptQuit()
- func Beep()
- func CannotRedoTitle() string
- func CannotUndoTitle() string
- func DistillImageSpecFor(filePathOrURL string) string
- func DoubleClickParameters() (maxDelay time.Duration, maxMouseDrift 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 *Panel)
- 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, image *Image, imgSide Side, imgGap float32) geom32.Size
- func MarkDynamicColorsForRebuild()
- func MaxSize(size geom32.Size) geom32.Size
- func QuestionDialog(primary, detail string) int
- func QuestionDialogWithPanel(msgPanel *Panel) int
- func RebuildDynamicColors()
- func ReleaseOnUIThread(f func())
- func ResolveFileURL(in []byte) string
- 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 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) 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 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(center geom32.Point, radius float32, paint *Paint)
- func (c *Canvas) DrawColor(color Color, mode BlendMode)
- func (c *Canvas) DrawImage(img *Image, pt geom32.Point, 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) DrawLinePt(start, end geom32.Point, 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) DrawPointPt(pt geom32.Point, 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, radius float32, paint *Paint)
- func (c *Canvas) DrawRoundedRectXY(rect geom32.Rect, radius geom32.Point, paint *Paint)
- func (c *Canvas) DrawSimpleText(str string, x, y float32, font *Font, paint *Paint)
- func (c *Canvas) DrawSimpleTextPt(str string, pt geom32.Point, font *Font, paint *Paint)
- func (c *Canvas) DrawText(text *Text, x, y float32, paint *Paint)
- func (c *Canvas) DrawTextPt(text *Text, pt geom32.Point, 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(radians float32)
- func (c *Canvas) RotateDegrees(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(scale float32)
- func (c *Canvas) ScaleIndependently(x, y float32)
- func (c *Canvas) SetMatrix(matrix *geom32.Matrix2D)
- func (c *Canvas) Skew(sx, sy float32)
- func (c *Canvas) SkewPt(skew geom32.Point)
- func (c *Canvas) Translate(dx, dy float32)
- func (c *Canvas) TranslatePt(offset geom32.Point)
- 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 CheckState
- type ClipOp
- type Clipboard
- type ClipboardData
- type 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 NewARGBTableColorFilter(a, r, g, b []byte) *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 CompoundBorder
- type CubicResampler
- type Cursor
- func ArrowCursor() *Cursor
- func ArrowsHorizontalCursor() *Cursor
- func ArrowsHorizontalVerticalCursor() *Cursor
- func ArrowsLeftDiagonalCursor() *Cursor
- func ArrowsRightDiagonalCursor() *Cursor
- func ArrowsVerticalCursor() *Cursor
- func ClosedHandCursor() *Cursor
- func NewCursor(img *Image, hotSpot geom32.Point) *Cursor
- func OpenHandCursor() *Cursor
- func TextCursor() *Cursor
- type DarkModeTracking
- type DefaultCellFactory
- type Dialog
- type DialogButtonInfo
- type Direction
- type Display
- type DynamicColor
- type DynamicFont
- type EmptyBorder
- type EncodedImageFormat
- type Field
- func (t *Field) CanCopy() bool
- func (t *Field) CanCut() bool
- func (t *Field) CanDelete() bool
- func (t *Field) CanPaste() bool
- func (t *Field) CanSelectAll() bool
- func (t *Field) Copy()
- func (t *Field) Cut()
- func (t *Field) DefaultCanPerformCmd(source interface{}, id int) bool
- func (t *Field) DefaultDraw(canvas *Canvas, dirty geom32.Rect)
- func (t *Field) DefaultFocusGained()
- func (t *Field) DefaultFocusLost()
- func (t *Field) DefaultKeyDown(keyCode KeyCode, mod Modifiers, repeat bool) bool
- func (t *Field) DefaultMouseDown(where geom32.Point, button, clickCount int, mod Modifiers) bool
- func (t *Field) DefaultMouseDrag(where geom32.Point, button int, mod Modifiers) bool
- func (t *Field) DefaultPerformCmd(source interface{}, id int)
- func (t *Field) DefaultRuneTyped(ch rune) bool
- func (t *Field) DefaultSizes(hint geom32.Size) (min, pref, max geom32.Size)
- func (t *Field) DefaultUpdateCursor(where geom32.Point) *Cursor
- func (t *Field) Delete()
- func (t *Field) FromSelectionIndex(index int) geom32.Point
- func (t *Field) HasSelectionRange() bool
- func (t *Field) Invalid() bool
- func (t *Field) Paste()
- func (t *Field) ScrollOffset() float32
- func (t *Field) SelectAll()
- func (t *Field) SelectedText() string
- func (t *Field) Selection() (start, end int)
- func (t *Field) SelectionCount() int
- func (t *Field) SetScrollOffset(offset float32)
- func (t *Field) SetSelection(start, end int)
- func (t *Field) SetSelectionTo(pos int)
- func (t *Field) SetSelectionToEnd()
- func (t *Field) SetSelectionToStart()
- func (t *Field) SetText(text string)
- func (t *Field) Text() string
- func (t *Field) ToSelectionIndex(x float32) int
- func (t *Field) Validate()
- type FillType
- type FilterMode
- type FilterQuality
- type FlexLayout
- type FlexLayoutData
- type FlowLayout
- type Font
- func (f *Font) Baseline() float32
- func (f *Font) Descriptor() FontDescriptor
- func (f *Font) Extents(str string) geom32.Size
- func (f *Font) Face() *FontFace
- func (f *Font) Glyphs(text string) []uint16
- func (f *Font) IndexForPosition(x float32, str string) int
- func (f *Font) LineHeight() float32
- func (f *Font) Metrics() FontMetrics
- func (f *Font) PositionForIndex(index int, str string) float32
- func (f *Font) ResolvedFont() *Font
- func (f *Font) Size() float32
- func (f *Font) Width(str string) float32
- type FontDescriptor
- type FontFace
- 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 FontProvider
- type FontSlant
- type FontSpacing
- type FontWeight
- type Gradient
- type Group
- type GroupPanel
- type Image
- func ArrowsHorizontalImage() *Image
- func ArrowsHorizontalVerticalImage() *Image
- func ArrowsLeftDiagonalImage() *Image
- func ArrowsRightDiagonalImage() *Image
- func ArrowsVerticalImage() *Image
- func ClosedHandImage() *Image
- func ErrorImage() *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 OpenHandImage() *Image
- func QuestionImage() *Image
- 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
- type Ink
- type InputCallbacks
- type InvertStyle
- type KeyCode
- type Label
- type Layout
- type Layoutable
- 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 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 MipMapMode
- type Modifiers
- func (m Modifiers) CapsLockDown() bool
- func (m Modifiers) CommandDown() bool
- func (m Modifiers) ControlDown() bool
- 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
- 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) 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) ChildrenForLayout() []Layoutable
- 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) Layout() Layout
- func (p *Panel) LayoutData() interface{}
- func (p *Panel) MarkForLayoutAndRedraw()
- func (p *Panel) MarkForRedraw()
- func (p *Panel) MarkRectForRedraw(rect geom32.Rect)
- 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) 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) SetSizer(sizer Sizer)
- func (p *Panel) Sizer() Sizer
- func (p *Panel) Sizes(hint geom32.Size) (min, pref, max geom32.Size)
- 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) ArcToFromTangentPt(pt1, pt2 geom32.Point, radius float32)
- func (p *Path) ArcToOval(x, y, width, height, startAngle, sweepAngle float32, forceMoveTo bool)
- func (p *Path) ArcToOvalBounds(bounds geom32.Rect, startAngle, sweepAngle float32, forceMoveTo bool)
- func (p *Path) ArcToPt(pt, radius geom32.Point, rotation float32, arcSize ArcSize, ...)
- func (p *Path) ArcToPtRelative(dPt, radius geom32.Point, rotation float32, arcSize ArcSize, ...)
- 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) CirclePt(centerPt geom32.Point, radius float32)
- func (p *Path) CirclePtWithDirection(centerPt geom32.Point, radius float32, direction Direction)
- 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) ConicToPt(ctrlPt, endPt geom32.Point, weight float32)
- func (p *Path) ConicToPtRelative(dCtrlPt, dEndPt geom32.Point, weight float32)
- func (p *Path) ConicToRelative(cpdx, cpdy, dx, dy, weight float32)
- func (p *Path) Contains(x, y float32) bool
- func (p *Path) ContainsPt(pt geom32.Point) bool
- func (p *Path) CubicTo(cp1x, cp1y, cp2x, cp2y, x, y float32)
- func (p *Path) CubicToPt(ctrl1Pt, ctrl2Pt, endPt geom32.Point)
- func (p *Path) CubicToPtRelative(dCtrl1Pt, dCtrl2Pt, dEndPt geom32.Point)
- 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) LineToPt(pt geom32.Point)
- func (p *Path) LineToPtRelative(pt geom32.Point)
- func (p *Path) LineToRelative(x, y float32)
- func (p *Path) MoveTo(x, y float32)
- func (p *Path) MoveToPt(pt geom32.Point)
- func (p *Path) MoveToPtRelative(pt geom32.Point)
- func (p *Path) MoveToRelative(x, y float32)
- func (p *Path) NewRotated(radians float32) *Path
- func (p *Path) NewRotatedByDegrees(degrees float32) *Path
- func (p *Path) NewScaled(sx, sy float32) *Path
- func (p *Path) NewScaledSize(size geom32.Size) *Path
- func (p *Path) NewTransformed(matrix *geom32.Matrix2D) *Path
- func (p *Path) NewTranslated(x, y float32) *Path
- func (p *Path) NewTranslatedPt(pt geom32.Point) *Path
- func (p *Path) Oval(x, y, width, height float32)
- func (p *Path) OvalBounds(bounds geom32.Rect)
- func (p *Path) OvalBoundsWithDirection(bounds geom32.Rect, direction Direction)
- func (p *Path) OvalWithDirection(x, y, width, height float32, direction Direction)
- func (p *Path) Path(path *Path, extend bool)
- func (p *Path) PathReverse(path *Path)
- func (p *Path) PathRotated(path *Path, radians float32, extend bool)
- func (p *Path) PathRotatedByDegrees(path *Path, degrees float32, extend bool)
- func (p *Path) PathScaled(path *Path, scale float32, extend bool)
- func (p *Path) PathScaledIndependently(path *Path, scale geom32.Point, 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) PathTranslatedPt(path *Path, offset geom32.Point, 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) QuadToPt(ctrlPt, endPt geom32.Point)
- func (p *Path) Rect(x, y, width, height float32)
- func (p *Path) RectBounds(bounds geom32.Rect)
- func (p *Path) RectBoundsWithDirection(bounds geom32.Rect, direction Direction)
- func (p *Path) RectWithDirection(x, y, width, height float32, direction Direction)
- func (p *Path) Reset()
- func (p *Path) Rewind()
- func (p *Path) Rotate(radians float32)
- func (p *Path) RotateByDegrees(degrees float32)
- func (p *Path) RoundedRect(x, y, width, height, radius float32)
- func (p *Path) RoundedRectBounds(bounds geom32.Rect, radius float32)
- func (p *Path) RoundedRectBoundsWithDirection(bounds geom32.Rect, radius float32, direction Direction)
- func (p *Path) RoundedRectBoundsXY(bounds geom32.Rect, radius geom32.Point)
- func (p *Path) RoundedRectWithDirection(x, y, width, height, radius float32, direction Direction)
- func (p *Path) RoundedRectXY(x, y, width, height, rx, ry float32)
- func (p *Path) RoundedRectXYBoundsWithDirection(bounds geom32.Rect, radius geom32.Point, direction Direction)
- func (p *Path) RoundedRectXYWithDirection(x, y, width, height, rx, ry float32, direction Direction)
- func (p *Path) Scale(sx, sy float32)
- func (p *Path) ScaleSize(size geom32.Size)
- 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)
- func (p *Path) TranslatePt(pt geom32.Point)
- 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) 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{}) *PopupMenu
- func (p *PopupMenu) Text() string
- 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 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 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 ScrollPanel
- func (s *ScrollPanel) Bar(horizontal bool) *ScrollBar
- func (s *ScrollPanel) ColumnHeader() *Panel
- func (s *ScrollPanel) Content() *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(_ Layoutable, hint geom32.Size) (min, pref, max geom32.Size)
- func (s *ScrollPanel) PerformLayout(_ Layoutable)
- func (s *ScrollPanel) Position() (h, v float32)
- func (s *ScrollPanel) RowHeader() *Panel
- func (s *ScrollPanel) SetColumnHeader(p *Panel)
- func (s *ScrollPanel) SetContent(p Paneler, behave Behavior)
- func (s *ScrollPanel) SetPosition(h, v float32)
- func (s *ScrollPanel) SetRowHeader(p *Panel)
- func (s *ScrollPanel) View() *Panel
- type Separator
- 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 StartupOption
- func AllowQuitCallback(f func() bool) StartupOption
- func NoGlobalMenuBar() StartupOption
- func OpenURLsCallback(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 Text
- type TextBuilder
- type ThemeColor
- type TileMode
- 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 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) IsValid() bool
- func (w *Window) IsVisible() bool
- func (w *Window) LocalContentRect() geom32.Rect
- func (w *Window) MarkForRedraw()
- func (w *Window) MarkRectForRedraw(rect geom32.Rect)
- 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) 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 ( // DefaultSystemFamilyName is the default system font family name and will be used as a fallback where needed. DefaultSystemFamilyName = "Roboto" // FontAwesomeFreeFamilyName is the name of the FontAwesome Free font that has been loaded automatically. FontAwesomeFreeFamilyName = "Font Awesome 5 Free" )
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 (
// MinimumScrollBarSize is the minimum width for vertical bars and height for horizontal bars.
MinimumScrollBarSize = 16
)
Variables ¶
var ( // CutAction removes the selection and places it on the clipboard. CutAction = &Action{ ID: CutItemID, Title: i18n.Text("Cut"), HotKey: KeyX, HotKeyMods: OSMenuCmdModifier(), EnabledCallback: RouteActionToFocusEnabledFunc, ExecuteCallback: RouteActionToFocusExecuteFunc, } // CopyAction copies the selection and places it on the clipboard. CopyAction = &Action{ ID: CopyItemID, Title: i18n.Text("Copy"), HotKey: KeyC, HotKeyMods: OSMenuCmdModifier(), EnabledCallback: RouteActionToFocusEnabledFunc, ExecuteCallback: RouteActionToFocusExecuteFunc, } // PasteAction pastes the contents of the clipboard, replacing the selection. PasteAction = &Action{ ID: PasteItemID, Title: i18n.Text("Paste"), HotKey: KeyV, HotKeyMods: OSMenuCmdModifier(), EnabledCallback: RouteActionToFocusEnabledFunc, ExecuteCallback: RouteActionToFocusExecuteFunc, } // DeleteAction deletes the selection. DeleteAction = &Action{ ID: DeleteItemID, Title: i18n.Text("Delete"), HotKey: KeyBackspace, EnabledCallback: RouteActionToFocusEnabledFunc, ExecuteCallback: RouteActionToFocusExecuteFunc, } // SelectAllAction selects everything in the current focus. SelectAllAction = &Action{ ID: SelectAllItemID, Title: i18n.Text("Select All"), HotKey: KeyA, HotKeyMods: 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 ( BackgroundColor = &ThemeColor{Light: RGB(238, 238, 238), Dark: RGB(50, 50, 50)} OnBackgroundColor = &ThemeColor{Light: Black, Dark: RGB(221, 221, 221)} DividerColor = &ThemeColor{Light: RGB(192, 192, 192), Dark: RGB(80, 80, 80)} ControlColor = &ThemeColor{Light: RGB(248, 248, 255), Dark: RGB(64, 64, 64)} OnControlColor = &ThemeColor{Light: Black, Dark: RGB(221, 221, 221)} ControlEdgeColor = &ThemeColor{Light: RGB(96, 96, 96), Dark: RGB(96, 96, 96)} ControlPressedColor = &ThemeColor{Light: RGB(0, 80, 136), Dark: RGB(0, 80, 136)} OnControlPressedColor = &ThemeColor{Light: White, Dark: White} ControlDisabledColor = &ThemeColor{Light: RGB(232, 232, 240), Dark: RGB(56, 56, 56)} OnControlDisabledColor = &ThemeColor{Light: RGB(184, 184, 184), Dark: RGB(128, 128, 128)} SelectionColor = &ThemeColor{Light: RGB(0, 96, 160), Dark: RGB(0, 96, 160)} OnSelectionColor = &ThemeColor{Light: White, Dark: White} InactiveSelectionColor = &ThemeColor{Light: RGB(0, 64, 148), Dark: RGB(0, 64, 148)} OnInactiveSelectionColor = &ThemeColor{Light: RGB(228, 228, 228), Dark: RGB(228, 228, 228)} ListColor = &ThemeColor{Light: RGB(235, 235, 220), Dark: RGB(42, 42, 42)} OnListColor = &ThemeColor{Light: Black, Dark: RGB(221, 221, 221)} ListAltColor = &ThemeColor{Light: White, Dark: RGB(50, 50, 50)} OnListAltColor = &ThemeColor{Light: Black, Dark: RGB(221, 221, 221)} EditableColor = &ThemeColor{Light: White, Dark: RGB(24, 24, 24)} OnEditableColor = &ThemeColor{Light: Black, Dark: RGB(221, 221, 221)} EditableErrorColor = &ThemeColor{Light: RGB(192, 64, 64), Dark: RGB(115, 37, 37)} OnEditableErrorColor = &ThemeColor{Light: White, Dark: RGB(221, 221, 221)} TooltipColor = &ThemeColor{Light: RGB(252, 252, 196), Dark: RGB(192, 192, 130)} OnTooltipColor = &ThemeColor{Light: Black, Dark: RGB(32, 32, 32)} 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(102, 102, 102), Dark: RGB(153, 153, 153)} BlackWhenDarkColor = &ThemeColor{Light: White, Dark: Black} WhiteWhenDarkColor = &ThemeColor{Light: Black, Dark: White} )
Pre-defined theme colors.
var ( // TooltipDelay holds the delay before a tooltip will be shown. TooltipDelay = 1500 * time.Millisecond // TooltipDismissal holds the delay before a tooltip will be dismissed. TooltipDismissal = 3 * time.Second )
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 = map[KeyCode]string{}/* 120 elements not displayed */
KeyCodeToName maps virtual key codes to a human-readable name.
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 DistillImageSpecFor ¶
DistillImageSpecFor distills a file path or URL string into one that likely has an image we can read, or an empty string.
func DoubleClickParameters ¶
DoubleClickParameters returns the maximum delay between clicks and the maximum pixel drift allowed to register as a double-click.
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, image *Image, imgSide Side, imgGap float32, applyDisabledImageFilter 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 *Panel)
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 ¶
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 ResolveFileURL ¶
ResolveFileURL converts bytes into a URL. On most platforms, this is just a simple string() cast. However, macOS has a file reference URL type that needs special handling to resolve properly.
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.
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. HotKey KeyCode // The key that will trigger the action. HotKeyMods Modifiers // The modifier keys that must be pressed for the hot key to be recognized. 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 ClickCallback func() Font FontProvider EdgeColor Ink PressedColor Ink OnPressedColor Ink SelectionColor Ink OnSelectionColor Ink InactiveSelectionColor Ink OnInactiveSelectionColor Ink EnabledColor Ink OnEnabledColor Ink DisabledColor Ink OnDisabledColor Ink Image *Image Text string Gap float32 CornerRadius float32 HMargin float32 VMargin float32 ImageOnlyHMargin float32 ImageOnlyVMargin float32 ClickAnimationTime time.Duration HAlign Alignment VAlign Alignment Side Side Sticky bool HideBase bool Pressed bool }
Button represents a clickable button.
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) 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 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 ¶
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) DrawLinePt ¶
DrawLinePt draws a line.
func (*Canvas) DrawPaint ¶
DrawPaint fills the clip with Paint. Any MaskFilter or PathEffect in the Paint is ignored.
func (*Canvas) DrawPointPt ¶
DrawPointPt draws a point.
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) DrawRoundedRectXY ¶
DrawRoundedRectXY draws a rounded rectangle with Paint.
func (*Canvas) DrawSimpleText ¶
DrawSimpleText draws text. This uses the default character-to-glyph mapping from the font. It does not perform typeface fallback for characters not found in the typeface. It does not perform kerning or other complex shaping. Glyphs are positioned based on their default advances. y is the baseline of the first line of text.
func (*Canvas) DrawSimpleTextPt ¶
DrawSimpleTextPt draws text. This uses the default character-to-glyph mapping from the font. It does not perform typeface fallback for characters not found in the typeface. It does not perform kerning or other complex shaping. Glyphs are positioned based on their default advances. pt.Y is the baseline of the first line of text.
func (*Canvas) DrawTextPt ¶
DrawTextPt draws text. pt.Y is the baseline of the first line of 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) RotateDegrees ¶
RotateDegrees the coordinate system.
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().
func (*Canvas) ScaleIndependently ¶
ScaleIndependently scales the coordinate system independently on each axis.
func (*Canvas) Skew ¶
Skew the coordinate system. A positive value of sx skews the drawing right as y-axis values increase; a positive value of sy skews the drawing down as x-axis values increase.
func (*Canvas) SkewPt ¶
SkewPt the coordinate system. A positive value of sx skews the drawing right as y-axis values increase; a positive value of sy skews the drawing down as x-axis values increase.
func (*Canvas) TranslatePt ¶
TranslatePt the coordinate system.
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 ClickCallback func() Font FontProvider EdgeColor Ink OnBackgroundColor Ink PressedColor Ink OnPressedColor Ink EnabledColor Ink OnEnabledColor Ink DisabledColor Ink OnDisabledColor Ink Image *Image Text string Gap float32 CornerRadius float32 ClickAnimationTime time.Duration HAlign Alignment VAlign Alignment Side Side 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 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 (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 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 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 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 ArrowsHorizontalCursor ¶
func ArrowsHorizontalCursor() *Cursor
ArrowsHorizontalCursor returns the standard horizontal arrows cursor, pointing left and right.
func ArrowsHorizontalVerticalCursor ¶
func ArrowsHorizontalVerticalCursor() *Cursor
ArrowsHorizontalVerticalCursor returns the standard horizontal and vertical arrows cursor, pointing left, right, up and down.
func ArrowsLeftDiagonalCursor ¶
func ArrowsLeftDiagonalCursor() *Cursor
ArrowsLeftDiagonalCursor returns the standard left diagonal arrows cursor, pointing northwest and southeast.
func ArrowsRightDiagonalCursor ¶
func ArrowsRightDiagonalCursor() *Cursor
ArrowsRightDiagonalCursor returns the standard right diagonal arrows cursor, pointing northeast and southwest.
func ArrowsVerticalCursor ¶
func ArrowsVerticalCursor() *Cursor
ArrowsVerticalCursor returns the standard vertical arrows cursor, pointing up and down.
func ClosedHandCursor ¶
func ClosedHandCursor() *Cursor
ClosedHandCursor returns the standard closed hand cursor.
func OpenHandCursor ¶
func OpenHandCursor() *Cursor
OpenHandCursor returns the standard open hand 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 Dialog ¶
type Dialog struct {
// contains filtered or unexported fields
}
Dialog holds information about a dialog.
func NewDialog ¶
func NewDialog(img *Image, msgPanel *Panel, 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 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. }
Display holds information about each available active display.
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 FontProvider that dynamically creates a font.
func (*DynamicFont) ResolvedFont ¶
func (d *DynamicFont) ResolvedFont() *Font
ResolvedFont implements the FontProvider interface.
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 PKM KTX ASTC DNG HEIF 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 ModifiedCallback func() ValidateCallback func() bool Font FontProvider ErrorColor Ink OnErrorColor Ink EnabledColor Ink OnEnabledColor Ink DisabledColor Ink OnDisabledColor Ink SelectionColor Ink OnSelectionColor Ink BlinkRate time.Duration Watermark string FocusedBorder Border UnfocusedBorder Border MinimumTextWidth float32 // 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 (t *Field) DefaultFocusGained()
DefaultFocusGained provides the default focus gained handling.
func (*Field) DefaultFocusLost ¶
func (t *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) ScrollOffset ¶
ScrollOffset returns the current autoscroll offset.
func (*Field) SelectAll ¶
func (t *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 (t *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 (t *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 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 ¶
func (f *FlexLayout) LayoutSizes(target Layoutable, hint geom32.Size) (min, pref, max geom32.Size)
LayoutSizes implements the Layout interface.
func (*FlexLayout) PerformLayout ¶
func (f *FlexLayout) PerformLayout(target Layoutable)
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 ¶
func (f *FlowLayout) LayoutSizes(target Layoutable, hint geom32.Size) (min, pref, max geom32.Size)
LayoutSizes implements Layout.
func (*FlowLayout) PerformLayout ¶
func (f *FlowLayout) PerformLayout(target Layoutable)
PerformLayout implements Layout.
type Font ¶
type Font struct {
// contains filtered or unexported fields
}
Font holds a realized FontFace of a specific size that can be used to render text.
func ChooseFont ¶
func ChooseFont(local, global FontProvider) *Font
ChooseFont returns the local font if it is non-nil, otherwise returns the global font.
func (*Font) Baseline ¶
Baseline returns the number of logical pixels to the bottom of characters without descenders.
func (*Font) Descriptor ¶
func (f *Font) Descriptor() FontDescriptor
Descriptor returns a FontDescriptor for this Font.
func (*Font) Extents ¶
Extents of the string rendered with this font. Note that this does not account for any embedded line endings nor tabs.
func (*Font) IndexForPosition ¶
IndexForPosition returns the rune index within the string for the specified x-coordinate, where 0 is the start of the string. Note that this does not account for any embedded line endings nor tabs.
func (*Font) LineHeight ¶
LineHeight returns the recommended line height of the font.
func (*Font) Metrics ¶
func (f *Font) Metrics() FontMetrics
Metrics returns a copy of the FontMetrics for this font.
func (*Font) PositionForIndex ¶
PositionForIndex 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 (*Font) ResolvedFont ¶
ResolvedFont implements the FontProvider interface.
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) 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 FontProvider ¶
type FontProvider interface {
ResolvedFont() *Font
}
FontProvider holds a font to draw with.
var ( SystemFont FontProvider EmphasizedSystemFont FontProvider SmallSystemFont FontProvider EmphasizedSmallSystemFont FontProvider LabelFont FontProvider FieldFont FontProvider )
Pre-defined fonts
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) Localized ¶
func (s FontSpacing) Localized() string
Localized returns the localized name.
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) Localized ¶
func (w FontWeight) Localized() string
Localized returns the localized name.
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 ArrowsHorizontalImage ¶
func ArrowsHorizontalImage() *Image
ArrowsHorizontalImage returns the standard horizontal arrows, pointing left and right.
func ArrowsHorizontalVerticalImage ¶
func ArrowsHorizontalVerticalImage() *Image
ArrowsHorizontalVerticalImage returns the standard horizontal and vertical arrows, pointing left, right, up and down.
func ArrowsLeftDiagonalImage ¶
func ArrowsLeftDiagonalImage() *Image
ArrowsLeftDiagonalImage returns the standard left diagonal arrows, pointing northwest and southeast.
func ArrowsRightDiagonalImage ¶
func ArrowsRightDiagonalImage() *Image
ArrowsRightDiagonalImage returns the standard right diagonal arrows, pointing northeast and southwest.
func ArrowsVerticalImage ¶
func ArrowsVerticalImage() *Image
ArrowsVerticalImage returns the standard vertical arrows, pointing up and down.
func ClosedHandImage ¶
func ClosedHandImage() *Image
ClosedHandImage returns the standard closed hand 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 OpenHandImage ¶
func OpenHandImage() *Image
OpenHandImage returns the standard open hand image.
func QuestionImage ¶
func QuestionImage() *Image
QuestionImage returns the standard question alert image.
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 FontProvider that references another font.
func (*IndirectFont) ResolvedFont ¶
func (i *IndirectFont) ResolvedFont() *Font
ResolvedFont implements the FontProvider interface.
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 on this window. GainedFocusCallback func() // LostFocusCallback is called when the keyboard focus is lost from this window. LostFocusCallback func() // MouseDownCallback is called when the mouse is pressed within this window. Return true to stop further handling. MouseDownCallback func(where geom32.Point, button, clickCount int, mod Modifiers) bool // MouseDragCallback is called when the mouse is dragged after being pressed within this window. Return true to stop // further handling. MouseDragCallback func(where geom32.Point, button int, mod Modifiers) bool // MouseUpCallback is called when the mouse is released after being pressed within this window. Return true to stop // further handling. MouseUpCallback func(where geom32.Point, button int, mod Modifiers) bool // MouseEnterCallback is called when the mouse enters this window. Return true to stop further handling. MouseEnterCallback func(where geom32.Point, mod Modifiers) bool // MouseMoveCallback is called when the mouse moves within this window. Return true to stop further handling. MouseMoveCallback func(where geom32.Point, mod Modifiers) bool // MouseExitCallback is called when the mouse exits this window. Return true to stop further handling. MouseExitCallback func() bool // MouseWheelCallback is called when the mouse wheel is rotated over this window. Return true to stop further // handling. MouseWheelCallback func(where, delta geom32.Point, mod Modifiers) bool // KeyDownCallback is called when a key is pressed in this window. Return true to stop further handling. KeyDownCallback func(keyCode KeyCode, mod Modifiers, repeat bool) bool // KeyUpCallback is called when a key is released in this window. Return true to stop further handling. KeyUpCallback func(keyCode KeyCode, mod Modifiers) bool // RuneTypedCallback is called when a key is typed in this window. Return true to stop further handling. RuneTypedCallback func(ch rune) bool // FileDropCallback is called when files are drag & dropped into the window. 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 Label ¶
type Label struct { Panel Font FontProvider Ink Ink Image *Image Text string Gap float32 HAlign Alignment VAlign Alignment Side Side }
Label represents non-interactive text and/or an image.
func (*Label) DefaultDraw ¶
DefaultDraw provides the default drawing.
type Layout ¶
type Layout interface { LayoutSizes(target Layoutable, hint geom32.Size) (min, pref, max geom32.Size) PerformLayout(target Layoutable) }
Layout defines methods that all layouts must provide.
type Layoutable ¶
type Layoutable interface { SetLayout(layout Layout) LayoutData() interface{} SetLayoutData(data interface{}) Sizes(hint geom32.Size) (min, pref, max geom32.Size) Border() Border FrameRect() geom32.Rect SetFrameRect(rect geom32.Rect) ChildrenForLayout() []Layoutable }
Layoutable defines the methods an object that wants to participate in layout must implement.
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 DoubleClickCallback func() NewSelectionCallback func() PressedColor Ink OnPressedColor Ink RowColor Ink OnRowColor Ink AltRowColor Ink OnAltRowColor Ink Factory CellFactory FlashAnimationTime time.Duration 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 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 // 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. If keyCode is 0, no key // accelerator will be attached to the menuItem. NewItem(id int, title string, keyCode KeyCode, keyModifiers Modifiers, 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 menuItem. 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 menuItem within its menu. Returns -1 if it is not yet attached to a menu. Index() int // IsSeparator returns true if this menuItem is a separator. IsSeparator() bool // Title returns the menuItem's title. Title() string // SetTitle sets the menuItem's title. SetTitle(title string) // SubMenu returns the menuItem's sub-menu, if any. SubMenu() Menu // CheckState returns the menuItem's current check state. CheckState() CheckState // SetCheckState sets the menuItem's check state. SetCheckState(s CheckState) }
MenuItem describes a choice that can be made from a Menu.
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 int
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 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) 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.
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) 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, suggestedAvoid 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() Tooltip *Panel NeedsLayout 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) ChildrenForLayout ¶
func (p *Panel) ChildrenForLayout() []Layoutable
ChildrenForLayout is the same as calling Children(), but returns them as layout.Layoutable objects instead.
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) 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 marks this panel for drawing at the next update.
func (*Panel) MarkRectForRedraw ¶
MarkRectForRedraw marks the rect in local coordinates within the panel for drawing at the next update.
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) 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 ScrollAreas 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) 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) 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) ArcToFromTangentPt ¶
ArcToFromTangentPt appends an arc. The arc is contained by the tangent from the current point to pt1 and the tangent from pt1 to pt2. 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) ArcToOvalBounds ¶
func (p *Path) ArcToOvalBounds(bounds geom32.Rect, startAngle, sweepAngle float32, forceMoveTo bool)
ArcToOvalBounds 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) ArcToPt ¶
func (p *Path) ArcToPt(pt, radius geom32.Point, rotation float32, arcSize ArcSize, direction Direction)
ArcToPt appends an arc. rotation is in degrees.
func (*Path) ArcToPtRelative ¶
func (p *Path) ArcToPtRelative(dPt, radius geom32.Point, rotation float32, arcSize ArcSize, direction Direction)
ArcToPtRelative appends an arc. The destination point is relative to the current point. rotation is in degrees.
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) CirclePt ¶
CirclePt 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) CirclePtWithDirection ¶
CirclePtWithDirection 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) 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) ConicToPtRelative ¶
ConicToPtRelative appends a conic curve. The control point and end point are relative to the current point.
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) ContainsPt ¶
ContainsPt returns true if the point is within the path, taking into account the FillType.
func (*Path) CubicToPtRelative ¶
CubicToPtRelative appends a cubic curve. The control point and end point are relative to the current point.
func (*Path) CubicToRelative ¶
CubicToRelative appends a cubic curve. The control point and end point are relative to the current point.
func (*Path) LineToPtRelative ¶
LineToPtRelative appends a straight line segment. The end point is 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) MoveToPtRelative ¶
MoveToPtRelative begins a new contour at the specified point, which 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) NewRotatedByDegrees ¶
NewRotatedByDegrees creates a copy of this path and then rotates it.
func (*Path) NewScaledSize ¶
NewScaledSize creates a copy of this path and then scales 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) NewTranslatedPt ¶
NewTranslatedPt 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) OvalBounds ¶
OvalBounds 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) OvalBoundsWithDirection ¶
OvalBoundsWithDirection 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) 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) PathRotatedByDegrees ¶
PathRotatedByDegrees 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 on both the horizontal and vertical axis. If extend is true, a line from the current point to the start of the added path is created.
func (*Path) PathScaledIndependently ¶
PathScaledIndependently 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) PathTranslatedPt ¶
PathTranslatedPt 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) RectBounds ¶
RectBounds 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) RectBoundsWithDirection ¶
RectBoundsWithDirection 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) 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) RotateByDegrees ¶
RotateByDegrees rotates the path.
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) RoundedRectBounds ¶
RoundedRectBounds 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) RoundedRectBoundsWithDirection ¶
func (p *Path) RoundedRectBoundsWithDirection(bounds geom32.Rect, radius float32, direction Direction)
RoundedRectBoundsWithDirection 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) RoundedRectBoundsXY ¶
RoundedRectBoundsXY 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 ¶
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) RoundedRectXY ¶
RoundedRectXY 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) RoundedRectXYBoundsWithDirection ¶
func (p *Path) RoundedRectXYBoundsWithDirection(bounds geom32.Rect, radius geom32.Point, direction Direction)
RoundedRectXYBoundsWithDirection 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) RoundedRectXYWithDirection ¶
RoundedRectXYWithDirection 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 MenuFactory MenuFactory SelectionCallback func() Font FontProvider EdgeColor Ink PressedColor Ink OnPressedColor Ink EnabledColor Ink OnEnabledColor Ink DisabledColor Ink OnDisabledColor Ink CornerRadius float32 HMargin float32 VMargin float32 Pressed bool // contains filtered or unexported fields }
PopupMenu represents a clickable button that displays a menu of choices.
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 menuItem. -1 will be returned if the menuItem 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 ProgressBar ¶
type ProgressBar struct { Panel BackgroundColor Ink FillColor Ink EdgeColor Ink TickSpeed time.Duration FullTraversalSpeed time.Duration PreferredBarHeight float32 CornerRadius float32 IndeterminateWidth float32 EdgeThickness float32 // 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 RadioButton ¶
type RadioButton struct { GroupPanel ClickCallback func() Font FontProvider EdgeColor Ink PressedColor Ink OnPressedColor Ink EnabledColor Ink OnEnabledColor Ink DisabledColor Ink OnDisabledColor Ink Image *Image Text string Gap float32 CornerRadius float32 ClickAnimationTime time.Duration HAlign Alignment VAlign Alignment Side Side 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 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 EdgeColor Ink ThumbColor Ink RolloverColor Ink 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 ScrollPanel ¶
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() *Panel
ColumnHeader returns the current column header, if any.
func (*ScrollPanel) Content ¶
func (s *ScrollPanel) Content() *Panel
Content returns the content panel.
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 view handling.
func (*ScrollPanel) LayoutSizes ¶
func (s *ScrollPanel) LayoutSizes(_ Layoutable, hint geom32.Size) (min, pref, max geom32.Size)
LayoutSizes implements the Layout interface.
func (*ScrollPanel) PerformLayout ¶
func (s *ScrollPanel) PerformLayout(_ Layoutable)
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() *Panel
RowHeader returns the current row header, if any.
func (*ScrollPanel) SetColumnHeader ¶
func (s *ScrollPanel) SetColumnHeader(p *Panel)
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 *Panel)
SetRowHeader sets the current row header. May be nil.
type Separator ¶
Separator provides a simple vertical or horizontal separator line.
func (*Separator) DefaultDraw ¶
DefaultDraw provides the default drawing.
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 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 OpenURLsCallback ¶
func OpenURLsCallback(f func(urls []string)) StartupOption
OpenURLsCallback will cause f to be called when the application is asked to open one or more URLs 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 Text ¶
type Text struct {
// contains filtered or unexported fields
}
Text holds text with formatting.
type TextBuilder ¶
type TextBuilder struct {
// contains filtered or unexported fields
}
TextBuilder provides Text construction.
func NewTextBuilder ¶
func NewTextBuilder(text string, font *Font) *TextBuilder
NewTextBuilder creates a new NewTextBuilder.
func (*TextBuilder) AllocRun ¶
func (b *TextBuilder) AllocRun(font *Font, glyphs []uint16, x, y float32)
AllocRun allocates a text run.
func (*TextBuilder) AllocRunPos ¶
func (b *TextBuilder) AllocRunPos(font *Font, glyphs []uint16, pos []geom32.Point)
AllocRunPos allocates a text run.
func (*TextBuilder) AllocRunPosH ¶
func (b *TextBuilder) AllocRunPosH(font *Font, glyphs []uint16, pos []float32, y float32)
AllocRunPosH allocates a text run.
func (*TextBuilder) Text ¶
func (b *TextBuilder) Text() *Text
Text returns a newly-created Text from the contents of this TextBuilder. If the builder is empty, this will return nil.
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 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 ImageFromSpecCallback func(filePathOrURL string, scale float32) (*Image, error) InkChangedCallback func() ClickCallback func() ValidateImageCallback func(*Image) *Image EdgeColor Ink PressedColor Ink EnabledColor Ink DisabledColor Ink ClickAnimationTime time.Duration ImageScale float32 ContentSize float32 CornerRadius float32 Mask WellMask 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 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) 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) MarkRectForRedraw ¶
MarkRectForRedraw marks the rect in local coordinates within the 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) 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
- clipboard.go
- color.go
- color_filter.go
- compound_border.go
- cursor.go
- dialog.go
- dialog_button_info.go
- display.go
- dynamic_color.go
- dynamic_font.go
- empty_border.go
- field.go
- file_dialog.go
- file_url.go
- file_url_other.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
- 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
- surface.go
- task.go
- text.go
- text_builder.go
- theme_color.go
- tooltip.go
- undo.go
- well.go
- well_dialog.go
- window.go