Documentation
¶
Overview ¶
Package widget contains various widget implementations such as buttons, checkboxes, combo boxes, lists etc. It also provides several different layout mechanisms to automatically layout widgets according to different rules.
Index ¶
- Constants
- func AppendToDeferredRenderQueue(r RenderFunc)
- func RenderDeferred(screen *ebiten.Image)
- type AnchorLayout
- type AnchorLayoutData
- type AnchorLayoutOpt
- type AnchorLayoutOptions
- type AnchorLayoutPosition
- type Button
- func (b *Button) AddFocus(direction FocusDirection, focus Focuser)
- func (b *Button) Click()
- func (b *Button) Focus(focused bool)
- func (b *Button) GetFocus(direction FocusDirection) Focuser
- func (b *Button) GetWidget() *Widget
- func (b *Button) GraphicImage() *GraphicImage
- func (b *Button) Image() *ButtonImage
- func (b *Button) IsFocused() bool
- func (b *Button) PreferredSize() (int, int)
- func (b *Button) Press()
- func (b *Button) Release()
- func (b *Button) Render(screen *ebiten.Image)
- func (b *Button) RequestRelayout()
- func (b *Button) SetGraphicImage(graphicImage *GraphicImage)
- func (b *Button) SetImage(image *ButtonImage)
- func (b *Button) SetLocation(rect img.Rectangle)
- func (b *Button) SetState(state WidgetState)
- func (b *Button) SetText(text string)
- func (b *Button) SetupInputLayer(def input.DeferredSetupInputLayerFunc)
- func (b *Button) State() WidgetState
- func (b *Button) TabOrder() int
- func (b *Button) Text() *Text
- func (b *Button) Update(updObj *UpdateObject)
- func (b *Button) Validate()
- type ButtonChangedEventArgs
- type ButtonChangedHandlerFunc
- type ButtonClickedEventArgs
- type ButtonClickedHandlerFunc
- type ButtonCursorHoverHandlerFunc
- type ButtonHoverEventArgs
- type ButtonImage
- type ButtonOpt
- type ButtonOptions
- func (o ButtonOptions) ClickedHandler(f ButtonClickedHandlerFunc) ButtonOpt
- func (o ButtonOptions) CursorEnteredHandler(f ButtonCursorHoverHandlerFunc) ButtonOpt
- func (o ButtonOptions) CursorExitedHandler(f ButtonCursorHoverHandlerFunc) ButtonOpt
- func (o ButtonOptions) CursorMovedHandler(f ButtonCursorHoverHandlerFunc) ButtonOpt
- func (o ButtonOptions) DisableDefaultKeys() ButtonOpt
- func (o ButtonOptions) Graphic(image *GraphicImage) ButtonOpt
- func (o ButtonOptions) GraphicPadding(i Insets) ButtonOpt
- func (o ButtonOptions) IgnoreTransparentPixels(ignoreTransparentPixels bool) ButtonOpt
- func (o ButtonOptions) Image(i *ButtonImage) ButtonOpt
- func (o ButtonOptions) KeepPressedOnExit() ButtonOpt
- func (o ButtonOptions) PressedHandler(f ButtonPressedHandlerFunc) ButtonOpt
- func (o ButtonOptions) ReleasedHandler(f ButtonReleasedHandlerFunc) ButtonOpt
- func (o ButtonOptions) StateChangedHandler(f ButtonChangedHandlerFunc) ButtonOpt
- func (o ButtonOptions) TabOrder(tabOrder int) ButtonOpt
- func (o ButtonOptions) Text(label string, face *text.Face, color *ButtonTextColor) ButtonOpt
- func (o ButtonOptions) TextAndImage(label string, face *text.Face, image *GraphicImage, color *ButtonTextColor) ButtonOpt
- func (o ButtonOptions) TextColor(color *ButtonTextColor) ButtonOpt
- func (o ButtonOptions) TextFace(face *text.Face) ButtonOpt
- func (o ButtonOptions) TextLabel(label string) ButtonOpt
- func (o ButtonOptions) TextPadding(p *Insets) ButtonOpt
- func (o ButtonOptions) TextPosition(h TextPosition, v TextPosition) ButtonOpt
- func (o ButtonOptions) TextProcessBBCode(enabled bool) ButtonOpt
- func (o ButtonOptions) ToggleMode() ButtonOpt
- func (o ButtonOptions) WidgetOpts(opts ...WidgetOpt) ButtonOpt
- type ButtonParams
- type ButtonPressedEventArgs
- type ButtonPressedHandlerFunc
- type ButtonReleasedEventArgs
- type ButtonReleasedHandlerFunc
- type ButtonTextColor
- type CanDropFunc
- type Caret
- type CaretOpt
- type CaretOptions
- type Checkbox
- func (c *Checkbox) AddFocus(direction FocusDirection, focus Focuser)
- func (c *Checkbox) Click()
- func (c *Checkbox) Focus(focused bool)
- func (c *Checkbox) GetFocus(direction FocusDirection) Focuser
- func (c *Checkbox) GetWidget() *Widget
- func (c *Checkbox) IsFocused() bool
- func (c *Checkbox) PreferredSize() (int, int)
- func (c *Checkbox) Render(screen *ebiten.Image)
- func (c *Checkbox) RequestRelayout()
- func (c *Checkbox) SetLocation(rect img.Rectangle)
- func (tw *Checkbox) SetState(state WidgetState)
- func (c *Checkbox) SetupInputLayer(def input.DeferredSetupInputLayerFunc)
- func (tw *Checkbox) State() WidgetState
- func (c *Checkbox) TabOrder() int
- func (tw *Checkbox) Text() *Text
- func (c *Checkbox) Update(updObj *UpdateObject)
- func (c *Checkbox) Validate()
- type CheckboxChangedEventArgs
- type CheckboxChangedHandlerFunc
- type CheckboxImage
- type CheckboxOpt
- type CheckboxOptions
- func (o CheckboxOptions) DisableDefaultKeys() CheckboxOpt
- func (o CheckboxOptions) Image(i *CheckboxImage) CheckboxOpt
- func (o CheckboxOptions) InitialState(state WidgetState) CheckboxOpt
- func (o CheckboxOptions) LabelFirst() CheckboxOpt
- func (o CheckboxOptions) Spacing(s int) CheckboxOpt
- func (o CheckboxOptions) StateChangedHandler(f CheckboxChangedHandlerFunc) CheckboxOpt
- func (o CheckboxOptions) TabOrder(tabOrder int) CheckboxOpt
- func (o CheckboxOptions) Text(labelString string, face *text.Face, color *LabelColor) CheckboxOpt
- func (o CheckboxOptions) TextColor(color *LabelColor) CheckboxOpt
- func (o CheckboxOptions) TextFace(face *text.Face) CheckboxOpt
- func (o CheckboxOptions) TextLabel(label string) CheckboxOpt
- func (o CheckboxOptions) TriState() CheckboxOpt
- func (o CheckboxOptions) WidgetOpts(opts ...WidgetOpt) CheckboxOpt
- type CheckboxParams
- type ComboButton
- func (c *ComboButton) GetWidget() *Widget
- func (c *ComboButton) Label() string
- func (c *ComboButton) PreferredSize() (int, int)
- func (c *ComboButton) Render(screen *ebiten.Image)
- func (c *ComboButton) SetLabel(l string)
- func (c *ComboButton) SetLocation(rect image.Rectangle)
- func (c *ComboButton) SetupInputLayer(def input.DeferredSetupInputLayerFunc)
- func (c *ComboButton) Update(updObj *UpdateObject)
- func (c *ComboButton) Validate()
- type ComboButtonOpt
- type ComboButtonOptions
- type Container
- func (c *Container) AddChild(children ...PreferredSizeLocateableWidget) RemoveChildFunc
- func (c *Container) Children() []PreferredSizeLocateableWidget
- func (c *Container) GetDropTargets() []HasWidget
- func (c *Container) GetFocusers() []Focuser
- func (c *Container) GetWidget() *Widget
- func (c *Container) IsValidated() bool
- func (c *Container) PreferredSize() (int, int)
- func (c *Container) RemoveChild(child PreferredSizeLocateableWidget)
- func (c *Container) RemoveChildren()
- func (c *Container) Render(screen *ebiten.Image)
- func (c *Container) ReplaceChild(remove PreferredSizeLocateableWidget, add PreferredSizeLocateableWidget)
- func (c *Container) RequestRelayout()
- func (c *Container) SetBackgroundImage(image *image.NineSlice)
- func (c *Container) SetLocation(rect img.Rectangle)
- func (c *Container) SetupInputLayer(def input.DeferredSetupInputLayerFunc)
- func (c *Container) Update(updObj *UpdateObject)
- func (c *Container) Validate()
- func (c *Container) WidgetAt(x int, y int) HasWidget
- type ContainerOpt
- type ContainerOptions
- type Containerer
- type Direction
- type DragAndDrop
- type DragAndDropAnchor
- type DragAndDropDroppedEventArgs
- type DragAndDropDroppedHandlerFunc
- type DragAndDropOpt
- type DragAndDropOptions
- func (o DragAndDropOptions) ContentsCreater(c DragContentsCreater) DragAndDropOpt
- func (o DragAndDropOptions) ContentsOriginHorizontal(contentsOriginHorizontal DragAndDropAnchor) DragAndDropOpt
- func (o DragAndDropOptions) ContentsOriginVertical(contentsOriginVertical DragAndDropAnchor) DragAndDropOpt
- func (o DragAndDropOptions) DisableDrag() DragAndDropOpt
- func (o DragAndDropOptions) MinDragStartDistance(d int) DragAndDropOpt
- func (o DragAndDropOptions) Offset(off image.Point) DragAndDropOpt
- type DragContentsCreater
- type DragContentsEnder
- type DragContentsUpdater
- type DropFunc
- type Dropper
- type FlipBook
- func (f *FlipBook) GetDropTargets() []HasWidget
- func (f *FlipBook) GetFocusers() []Focuser
- func (f *FlipBook) GetWidget() *Widget
- func (f *FlipBook) PreferredSize() (int, int)
- func (f *FlipBook) Render(screen *ebiten.Image)
- func (f *FlipBook) RequestRelayout()
- func (f *FlipBook) SetLocation(rect img.Rectangle)
- func (f *FlipBook) SetPage(page PreferredSizeLocateableWidget)
- func (f *FlipBook) SetupInputLayer(def input.DeferredSetupInputLayerFunc)
- func (f *FlipBook) Update(updObj *UpdateObject)
- func (f *FlipBook) Validate()
- func (f *FlipBook) WidgetAt(x int, y int) HasWidget
- type FlipBookOpt
- type FlipBookOptions
- type FocusDirection
- type Focuser
- type Graphic
- type GraphicImage
- type GraphicOpt
- type GraphicOptions
- func (o GraphicOptions) GIF(gif *gif.GIF) GraphicOpt
- func (o GraphicOptions) Image(i *ebiten.Image) GraphicOpt
- func (o GraphicOptions) ImageNineSlice(i *image.NineSlice) GraphicOpt
- func (o GraphicOptions) Images(i *GraphicImage) GraphicOpt
- func (o GraphicOptions) WidgetOpts(opts ...WidgetOpt) GraphicOpt
- type GridLayout
- type GridLayoutData
- type GridLayoutOpt
- type GridLayoutOptions
- func (o GridLayoutOptions) Columns(c int) GridLayoutOpt
- func (o GridLayoutOptions) DefaultStretch(c bool, r bool) GridLayoutOpt
- func (o GridLayoutOptions) Padding(i *Insets) GridLayoutOpt
- func (o GridLayoutOptions) Spacing(c int, r int) GridLayoutOpt
- func (o GridLayoutOptions) Stretch(c []bool, r []bool) GridLayoutOpt
- type GridLayoutPosition
- type HasWidget
- type Insets
- type Label
- type LabelColor
- type LabelOpt
- type LabelOptions
- func (o LabelOptions) LabelColor(color *LabelColor) LabelOpt
- func (o LabelOptions) LabelFace(face *text.Face) LabelOpt
- func (o LabelOptions) LabelPadding(padding *Insets) LabelOpt
- func (o LabelOptions) LabelText(label string) LabelOpt
- func (o LabelOptions) Text(label string, face *text.Face, color *LabelColor) LabelOpt
- func (o LabelOptions) TextOpts(opts ...TextOpt) LabelOpt
- type LabelOrder
- type LabelParams
- type Layouter
- type LinkEventArgs
- type LinkHandlerFunc
- type List
- func (l *List) AddEntry(entry any)
- func (l *List) AddFocus(direction FocusDirection, focus Focuser)
- func (l *List) Entries() []any
- func (l *List) Focus(focused bool)
- func (l *List) FocusNext()
- func (l *List) FocusPrevious()
- func (l *List) GetFocus(direction FocusDirection) Focuser
- func (l *List) GetWidget() *Widget
- func (l *List) IsFocused() bool
- func (l *List) PreferredSize() (int, int)
- func (l *List) RemoveEntry(entry any)
- func (l *List) Render(screen *ebiten.Image)
- func (l *List) RequestRelayout()
- func (l *List) SelectFocused()
- func (l *List) SelectedEntry() any
- func (l *List) SetEntries(newEntries []any)
- func (l *List) SetLocation(rect img.Rectangle)
- func (l *List) SetSelectedEntry(entry any)
- func (l *List) SetupInputLayer(def input.DeferredSetupInputLayerFunc)
- func (l *List) TabOrder() int
- func (l *List) Update(updObj *UpdateObject)
- func (l *List) UpdateEntry(entry any)
- func (l *List) Validate()
- type ListComboButton
- func (l *ListComboButton) AddFocus(direction FocusDirection, focus Focuser)
- func (l *ListComboButton) ContentVisible() bool
- func (l *ListComboButton) Focus(focused bool)
- func (l *ListComboButton) FocusNext()
- func (l *ListComboButton) FocusPrevious()
- func (l *ListComboButton) GetFocus(direction FocusDirection) Focuser
- func (l *ListComboButton) GetWidget() *Widget
- func (l *ListComboButton) IsFocused() bool
- func (l *ListComboButton) Label() string
- func (l *ListComboButton) PreferredSize() (int, int)
- func (l *ListComboButton) Render(screen *ebiten.Image)
- func (l *ListComboButton) SelectFocused()
- func (l *ListComboButton) SelectedEntry() interface{}
- func (l *ListComboButton) SetContentVisible(v bool)
- func (l *ListComboButton) SetLocation(rect image.Rectangle)
- func (l *ListComboButton) SetSelectedEntry(e interface{})
- func (l *ListComboButton) SetupInputLayer(def input.DeferredSetupInputLayerFunc)
- func (l *ListComboButton) TabOrder() int
- func (l *ListComboButton) Update(updObj *UpdateObject)
- func (l *ListComboButton) Validate()
- type ListComboButtonEntrySelectedEventArgs
- type ListComboButtonEntrySelectedHandlerFunc
- type ListComboButtonOpt
- type ListComboButtonOptions
- func (o ListComboButtonOptions) ButtonParams(buttonParams *ButtonParams) ListComboButtonOpt
- func (o ListComboButtonOptions) DisableDefaultKeys(val bool) ListComboButtonOpt
- func (o ListComboButtonOptions) Entries(e []any) ListComboButtonOpt
- func (o ListComboButtonOptions) EntryLabelFunc(button SelectComboButtonEntryLabelFunc, list ListEntryLabelFunc) ListComboButtonOpt
- func (o ListComboButtonOptions) EntrySelectedHandler(f ListComboButtonEntrySelectedHandlerFunc) ListComboButtonOpt
- func (o ListComboButtonOptions) InitialEntry(e any) ListComboButtonOpt
- func (o ListComboButtonOptions) ListParams(listParams *ListParams) ListComboButtonOpt
- func (o ListComboButtonOptions) MaxContentHeight(h int) ListComboButtonOpt
- func (o ListComboButtonOptions) TabOrder(tabOrder int) ListComboButtonOpt
- func (o ListComboButtonOptions) Text(face *text.Face, image *GraphicImage, color *ButtonTextColor) ListComboButtonOpt
- func (o ListComboButtonOptions) WidgetOpts(opts ...WidgetOpt) ListComboButtonOpt
- type ListComboButtonParams
- type ListEntryColor
- type ListEntryLabelFunc
- type ListEntrySelectedEventArgs
- type ListEntrySelectedHandlerFunc
- type ListEntrySortFunc
- type ListOpt
- type ListOptions
- func (o ListOptions) AllowReselect() ListOpt
- func (o ListOptions) ContainerOpts(opts ...ContainerOpt) ListOpt
- func (o ListOptions) ControlWidgetSpacing(s int) ListOpt
- func (o ListOptions) DisableDefaultKeys(val bool) ListOpt
- func (o ListOptions) Entries(e []any) ListOpt
- func (o ListOptions) EntryColor(c *ListEntryColor) ListOpt
- func (o ListOptions) EntryFontFace(f *text.Face) ListOpt
- func (o ListOptions) EntryLabelFunc(f ListEntryLabelFunc) ListOpt
- func (o ListOptions) EntrySelectedHandler(f ListEntrySelectedHandlerFunc) ListOpt
- func (o ListOptions) EntrySortFunc(f ListEntrySortFunc) ListOpt
- func (o ListOptions) EntryTextPadding(i *Insets) ListOpt
- func (o ListOptions) EntryTextPosition(h TextPosition, v TextPosition) ListOpt
- func (o ListOptions) HideHorizontalSlider() ListOpt
- func (o ListOptions) HideVerticalSlider() ListOpt
- func (o ListOptions) ScrollContainerImage(image *ScrollContainerImage) ListOpt
- func (o ListOptions) ScrollContainerPadding(padding *Insets) ListOpt
- func (o ListOptions) SelectFocus() ListOpt
- func (o ListOptions) SelectPressed() ListOpt
- func (o ListOptions) SliderParams(sliderParams *SliderParams) ListOpt
- func (o ListOptions) TabOrder(tabOrder int) ListOpt
- type ListParams
- type Locateable
- type Locater
- type MultiOnce
- type Panel
- type PanelParams
- type PreferredSizeLocateableWidget
- type PreferredSizer
- type ProgressBar
- func (s *ProgressBar) GetCurrent() int
- func (s *ProgressBar) GetWidget() *Widget
- func (s *ProgressBar) PreferredSize() (int, int)
- func (s *ProgressBar) Render(screen *ebiten.Image)
- func (s *ProgressBar) SetCurrent(value int) bool
- func (s *ProgressBar) SetLocation(rect img.Rectangle)
- func (s *ProgressBar) Update(updObj *UpdateObject)
- func (pb *ProgressBar) Validate()
- type ProgressBarImage
- type ProgressBarOpt
- type ProgressBarOptions
- func (o ProgressBarOptions) Direction(d Direction) ProgressBarOpt
- func (o ProgressBarOptions) FillImage(fill *ProgressBarImage) ProgressBarOpt
- func (o ProgressBarOptions) Images(track *ProgressBarImage, fill *ProgressBarImage) ProgressBarOpt
- func (o ProgressBarOptions) Inverted(inverted bool) ProgressBarOpt
- func (o ProgressBarOptions) TrackImage(track *ProgressBarImage) ProgressBarOpt
- func (o ProgressBarOptions) TrackPadding(i *Insets) ProgressBarOpt
- func (o ProgressBarOptions) Values(min int, max int, current int) ProgressBarOpt
- func (o ProgressBarOptions) WidgetOpts(opts ...WidgetOpt) ProgressBarOpt
- type ProgressBarParams
- type RadioGroup
- type RadioGroupChangedEventArgs
- type RadioGroupChangedHandlerFunc
- type RadioGroupElement
- type RadioGroupOpt
- type RadioGroupOptions
- type Relayoutable
- type RemoveChildFunc
- type RemoveWindowFunc
- type RenderFunc
- type Renderer
- type RowLayout
- type RowLayoutData
- type RowLayoutOpt
- type RowLayoutOptions
- type RowLayoutPosition
- type ScrollContainer
- func (s *ScrollContainer) ContentRect() img.Rectangle
- func (s *ScrollContainer) GetDropTargets() []HasWidget
- func (s *ScrollContainer) GetFocusers() []Focuser
- func (s *ScrollContainer) GetWidget() *Widget
- func (s *ScrollContainer) PreferredSize() (int, int)
- func (s *ScrollContainer) Render(screen *ebiten.Image)
- func (s *ScrollContainer) SetLocation(rect img.Rectangle)
- func (s *ScrollContainer) SetupInputLayer(def input.DeferredSetupInputLayerFunc)
- func (s *ScrollContainer) Update(updObj *UpdateObject)
- func (s *ScrollContainer) Validate()
- func (s *ScrollContainer) ViewRect() img.Rectangle
- type ScrollContainerImage
- type ScrollContainerOpt
- type ScrollContainerOptions
- func (o ScrollContainerOptions) Content(c PreferredSizeLocateableWidget) ScrollContainerOpt
- func (o ScrollContainerOptions) Image(i *ScrollContainerImage) ScrollContainerOpt
- func (o ScrollContainerOptions) Padding(p *Insets) ScrollContainerOpt
- func (o ScrollContainerOptions) StretchContentWidth() ScrollContainerOpt
- func (o ScrollContainerOptions) WidgetOpts(opts ...WidgetOpt) ScrollContainerOpt
- type ScrollMode
- type SelectComboButton
- func (s *SelectComboButton) ContentVisible() bool
- func (s *SelectComboButton) GetWidget() *Widget
- func (s *SelectComboButton) Label() string
- func (s *SelectComboButton) PreferredSize() (int, int)
- func (s *SelectComboButton) Render(screen *ebiten.Image)
- func (s *SelectComboButton) SelectedEntry() interface{}
- func (s *SelectComboButton) SetContentVisible(v bool)
- func (s *SelectComboButton) SetLabel(l string)
- func (s *SelectComboButton) SetLocation(rect image.Rectangle)
- func (s *SelectComboButton) SetSelectedEntry(e interface{})
- func (s *SelectComboButton) SetupInputLayer(def input.DeferredSetupInputLayerFunc)
- func (s *SelectComboButton) Update(updObj *UpdateObject)
- func (s *SelectComboButton) Validate()
- type SelectComboButtonEntryLabelFunc
- type SelectComboButtonEntrySelectedEventArgs
- type SelectComboButtonEntrySelectedHandlerFunc
- type SelectComboButtonOpt
- type SelectComboButtonOptions
- func (o SelectComboButtonOptions) ComboButtonOpts(opts ...ComboButtonOpt) SelectComboButtonOpt
- func (o SelectComboButtonOptions) EntryLabelFunc(f SelectComboButtonEntryLabelFunc) SelectComboButtonOpt
- func (o SelectComboButtonOptions) EntrySelectedHandler(f SelectComboButtonEntrySelectedHandlerFunc) SelectComboButtonOpt
- type Slider
- func (s *Slider) AddFocus(direction FocusDirection, focus Focuser)
- func (s *Slider) Focus(focused bool)
- func (s *Slider) GetFocus(direction FocusDirection) Focuser
- func (s *Slider) GetWidget() *Widget
- func (s *Slider) IsFocused() bool
- func (s *Slider) PreferredSize() (int, int)
- func (s *Slider) Render(screen *ebiten.Image)
- func (s *Slider) SetLocation(rect img.Rectangle)
- func (s *Slider) SetupInputLayer(def input.DeferredSetupInputLayerFunc)
- func (s *Slider) TabOrder() int
- func (s *Slider) Update(updObj *UpdateObject)
- func (s *Slider) Validate()
- type SliderChangedEventArgs
- type SliderChangedHandlerFunc
- type SliderOpt
- type SliderOptions
- func (o SliderOptions) ChangedHandler(f SliderChangedHandlerFunc) SliderOpt
- func (o SliderOptions) Direction(d Direction) SliderOptdeprecated
- func (o SliderOptions) DisableDefaultKeys(val bool) SliderOpt
- func (o SliderOptions) FixedHandleSize(s int) SliderOpt
- func (o SliderOptions) HandleImage(handle *ButtonImage) SliderOpt
- func (o SliderOptions) Images(track *SliderTrackImage, handle *ButtonImage) SliderOpt
- func (o SliderOptions) InitialCurrent(value int) SliderOpt
- func (o SliderOptions) MinHandleSize(s int) SliderOpt
- func (o SliderOptions) MinMax(minValue int, maxValue int) SliderOpt
- func (so SliderOptions) Orientation(o Direction) SliderOpt
- func (o SliderOptions) PageSizeFunc(f SliderPageSizeFunc) SliderOpt
- func (o SliderOptions) TabOrder(tabOrder int) SliderOpt
- func (o SliderOptions) TrackImage(track *SliderTrackImage) SliderOpt
- func (o SliderOptions) TrackOffset(i int) SliderOpt
- func (o SliderOptions) TrackPadding(i *Insets) SliderOpt
- func (o SliderOptions) WidgetOpts(opts ...WidgetOpt) SliderOpt
- type SliderPageSizeFunc
- type SliderParams
- type SliderTrackImage
- type StackedLayout
- type StackedLayoutData
- type StackedLayoutOpt
- type StackedLayoutOptions
- type TabBook
- func (t *TabBook) GetDropTargets() []HasWidget
- func (t *TabBook) GetTabButton(tab *TabBookTab) *Button
- func (t *TabBook) GetWidget() *Widget
- func (t *TabBook) PreferredSize() (int, int)
- func (t *TabBook) Render(screen *ebiten.Image)
- func (t *TabBook) RequestRelayout()
- func (t *TabBook) SetLocation(rect image.Rectangle)
- func (t *TabBook) SetTab(tab *TabBookTab)
- func (t *TabBook) SetupInputLayer(def input.DeferredSetupInputLayerFunc)
- func (t *TabBook) Tab() *TabBookTab
- func (t *TabBook) Update(updObj *UpdateObject)
- func (t *TabBook) Validate()
- type TabBookOpt
- type TabBookOptions
- func (o TabBookOptions) ContainerOpts(opts ...ContainerOpt) TabBookOpt
- func (o TabBookOptions) ContentPadding(contentPadding *Insets) TabBookOpt
- func (o TabBookOptions) ContentSpacing(s int) TabBookOpt
- func (o TabBookOptions) InitialTab(tab *TabBookTab) TabBookOpt
- func (o TabBookOptions) TabButtonImage(buttonImages *ButtonImage) TabBookOpt
- func (o TabBookOptions) TabButtonMinSize(minSize *image.Point) TabBookOpt
- func (o TabBookOptions) TabButtonSpacing(s int) TabBookOpt
- func (o TabBookOptions) TabButtonText(face *text.Face, color *ButtonTextColor) TabBookOpt
- func (o TabBookOptions) TabButtonTextPadding(textPadding *Insets) TabBookOpt
- func (o TabBookOptions) TabSelectedHandler(f TabBookTabSelectedHandlerFunc) TabBookOpt
- func (o TabBookOptions) Tabs(tabs ...*TabBookTab) TabBookOpt
- type TabBookParams
- type TabBookTab
- type TabBookTabOpt
- type TabBookTabOptions
- type TabBookTabSelectedEventArgs
- type TabBookTabSelectedHandlerFunc
- type TabParams
- type Text
- func (t *Text) GetWidget() *Widget
- func (t *Text) PreferredSize() (int, int)
- func (t *Text) Render(screen *ebiten.Image)
- func (t *Text) SetColor(color color.Color)
- func (t *Text) SetFace(face *text.Face)
- func (t *Text) SetLocation(rect image.Rectangle)
- func (t *Text) SetPadding(padding *Insets)
- func (t *Text) SetPosition(position *TextPositioning)
- func (t *Text) Update(updObj *UpdateObject)
- func (t *Text) Validate()
- type TextArea
- func (l *TextArea) AppendText(value string)
- func (l *TextArea) GetFocusers() []Focuser
- func (l *TextArea) GetText() string
- func (l *TextArea) GetWidget() *Widget
- func (l *TextArea) PreferredSize() (int, int)
- func (l *TextArea) PrependText(value string)
- func (l *TextArea) Render(screen *ebiten.Image)
- func (l *TextArea) RequestRelayout()
- func (l *TextArea) SetLocation(rect img.Rectangle)
- func (l *TextArea) SetText(value string)
- func (l *TextArea) SetupInputLayer(def input.DeferredSetupInputLayerFunc)
- func (l *TextArea) Update(updObj *UpdateObject)
- func (t *TextArea) Validate()
- type TextAreaEntrySelectedEventArgs
- type TextAreaEntrySelectedHandlerFunc
- type TextAreaOpt
- type TextAreaOptions
- func (o TextAreaOptions) ContainerOpts(opts ...ContainerOpt) TextAreaOpt
- func (o TextAreaOptions) ControlWidgetSpacing(s int) TextAreaOpt
- func (o TextAreaOptions) FontColor(color color.Color) TextAreaOpt
- func (o TextAreaOptions) FontFace(f *text.Face) TextAreaOpt
- func (o TextAreaOptions) HorizontalScrollMode(scrollMode ScrollMode) TextAreaOpt
- func (o TextAreaOptions) LinkClickedEvent(linkClickedFunc LinkHandlerFunc) TextAreaOpt
- func (o TextAreaOptions) LinkColor(linkColor *TextLinkColor) TextAreaOpt
- func (o TextAreaOptions) LinkCursorEnteredEvent(linkCursorEnteredFunc LinkHandlerFunc) TextAreaOpt
- func (o TextAreaOptions) LinkCursorExitedEvent(linkCursorExitedFunc LinkHandlerFunc) TextAreaOpt
- func (o TextAreaOptions) ProcessBBCode(processBBCode bool) TextAreaOpt
- func (o TextAreaOptions) ScrollContainerImage(image *ScrollContainerImage) TextAreaOpt
- func (o TextAreaOptions) ScrollContainerPadding(padding *Insets) TextAreaOpt
- func (o TextAreaOptions) ShowHorizontalScrollbar() TextAreaOpt
- func (o TextAreaOptions) ShowVerticalScrollbar() TextAreaOpt
- func (o TextAreaOptions) SliderParams(sliderParams *SliderParams) TextAreaOpt
- func (o TextAreaOptions) StripBBCode(stripBBCode bool) TextAreaOpt
- func (o TextAreaOptions) Text(initialText string) TextAreaOpt
- func (o TextAreaOptions) TextPadding(i Insets) TextAreaOpt
- func (o TextAreaOptions) TextPosition(textPosition TextPositioning) TextAreaOpt
- func (o TextAreaOptions) VerticalScrollMode(scrollMode ScrollMode) TextAreaOpt
- type TextAreaParams
- type TextInput
- func (t *TextInput) AddFocus(direction FocusDirection, focus Focuser)
- func (t *TextInput) Backspace()
- func (t *TextInput) CursorMoveEnd()
- func (t *TextInput) CursorMoveLeft()
- func (t *TextInput) CursorMoveRight()
- func (t *TextInput) CursorMoveStart()
- func (t *TextInput) Delete()
- func (t *TextInput) DeleteSelectedText()
- func (t *TextInput) DeselectText()
- func (t *TextInput) Focus(focused bool)
- func (t *TextInput) GetFocus(direction FocusDirection) Focuser
- func (t *TextInput) GetText() string
- func (t *TextInput) GetWidget() *Widget
- func (t *TextInput) Insert(c string)
- func (t *TextInput) IsFocused() bool
- func (t *TextInput) PreferredSize() (int, int)
- func (t *TextInput) Render(screen *ebiten.Image)
- func (t *TextInput) SelectAll()
- func (t *TextInput) SelectedText() string
- func (t *TextInput) SetLocation(rect img.Rectangle)
- func (t *TextInput) SetText(text string)
- func (t *TextInput) Submit()
- func (t *TextInput) TabOrder() int
- func (t *TextInput) Update(updObj *UpdateObject)
- func (t *TextInput) Validate()
- type TextInputChangedEventArgs
- type TextInputChangedHandlerFunc
- type TextInputColor
- type TextInputImage
- type TextInputOpt
- type TextInputOptions
- func (o TextInputOptions) AllowDuplicateSubmit(allowDuplicateSubmit bool) TextInputOpt
- func (o TextInputOptions) CaretWidth(caretWidth int) TextInputOpt
- func (o TextInputOptions) ChangedHandler(f TextInputChangedHandlerFunc) TextInputOpt
- func (o TextInputOptions) ClearOnSubmit(clearOnSubmit bool) TextInputOpt
- func (o TextInputOptions) Color(c *TextInputColor) TextInputOpt
- func (o TextInputOptions) Face(f *text.Face) TextInputOpt
- func (o TextInputOptions) IgnoreEmptySubmit(ignoreEmptySubmit bool) TextInputOpt
- func (o TextInputOptions) Image(i *TextInputImage) TextInputOpt
- func (o TextInputOptions) MobileInputMode(mobileInputMode mobile.InputMode) TextInputOpt
- func (o TextInputOptions) Padding(i *Insets) TextInputOpt
- func (o TextInputOptions) Placeholder(s string) TextInputOpt
- func (o TextInputOptions) RepeatInterval(i time.Duration) TextInputOpt
- func (o TextInputOptions) ScrollSensitivity(scrollSensitivity int) TextInputOpt
- func (o TextInputOptions) Secure(b bool) TextInputOpt
- func (o TextInputOptions) SubmitHandler(f TextInputChangedHandlerFunc) TextInputOpt
- func (o TextInputOptions) SubmitOnEnter(submitOnEnter bool) TextInputOpt
- func (o TextInputOptions) TabOrder(to int) TextInputOpt
- func (o TextInputOptions) Validation(f TextInputValidationFunc) TextInputOpt
- func (o TextInputOptions) WidgetOpts(opts ...WidgetOpt) TextInputOpt
- type TextInputParams
- type TextInputValidationFunc
- type TextLinkColor
- type TextOpt
- type TextOptions
- func (o TextOptions) LinkClickedHandler(f LinkHandlerFunc) TextOpt
- func (o TextOptions) LinkColor(linkColor *TextLinkColor) TextOpt
- func (o TextOptions) LinkCursorEnteredHandler(f LinkHandlerFunc) TextOpt
- func (o TextOptions) LinkCursorExitedHandler(f LinkHandlerFunc) TextOpt
- func (o TextOptions) MaxWidth(maxWidth float64) TextOpt
- func (o TextOptions) Padding(padding *Insets) TextOpt
- func (o TextOptions) Position(h TextPosition, v TextPosition) TextOpt
- func (o TextOptions) ProcessBBCode(processBBCode bool) TextOpt
- func (o TextOptions) StripBBCode(stripBBCode bool) TextOpt
- func (o TextOptions) Text(label string, face *text.Face, color color.Color) TextOpt
- func (o TextOptions) TextColor(color color.Color) TextOpt
- func (o TextOptions) TextFace(face *text.Face) TextOpt
- func (o TextOptions) TextLabel(label string) TextOpt
- func (o TextOptions) WidgetOpts(opts ...WidgetOpt) TextOpt
- type TextParams
- type TextPosition
- type TextPositioning
- type Theme
- type ToolTip
- type ToolTipAnchor
- type ToolTipDirection
- type ToolTipOpt
- type ToolTipOptions
- func (o ToolTipOptions) AnchorOriginHorizontal(anchorOriginHorizontal ToolTipAnchor) ToolTipOpt
- func (o ToolTipOptions) AnchorOriginVertical(anchorOriginVertical ToolTipAnchor) ToolTipOpt
- func (o ToolTipOptions) Content(c Containerer) ToolTipOpt
- func (o ToolTipOptions) ContentOriginHorizontal(contentOriginHorizontal ToolTipAnchor) ToolTipOpt
- func (o ToolTipOptions) ContentOriginVertical(contentOriginVertical ToolTipAnchor) ToolTipOpt
- func (o ToolTipOptions) Delay(d time.Duration) ToolTipOpt
- func (o ToolTipOptions) KeepOnHover(b bool) ToolTipOpt
- func (o ToolTipOptions) Offset(off image.Point) ToolTipOpt
- func (o ToolTipOptions) Position(position ToolTipPosition) ToolTipOpt
- func (o ToolTipOptions) ToolTipUpdater(toolTipUpdater ToolTipUpdater) ToolTipOpt
- type ToolTipPosition
- type ToolTipUpdater
- type UpdateFunc
- type UpdateObject
- type Updater
- type Visibility
- type Widget
- func (w *Widget) EffectiveInputLayer() *input.Layer
- func (w *Widget) ElevateToNewInputLayer(l *input.Layer)
- func (widget *Widget) FireContextMenuEvent(w *Widget, l image.Point)
- func (widget *Widget) FireDragAndDropEvent(w *Window, show bool, dnd *DragAndDrop)
- func (widget *Widget) FireFocusEvent(w Focuser, focused bool, location image.Point)
- func (widget *Widget) FireToolTipEvent(w *Window, show bool)
- func (widget *Widget) GetTheme() *Theme
- func (w *Widget) GetVisibility() Visibility
- func (widget *Widget) In(x, y int) bool
- func (widget *Widget) IsVisible() bool
- func (w *Widget) Parent() *Widget
- func (w *Widget) Render(screen *ebiten.Image)
- func (w *Widget) SetLocation(rect image.Rectangle)
- func (widget *Widget) SetTheme(theme *Theme)
- func (w *Widget) SetVisibility(v Visibility)
- func (w *Widget) Update(updObj *UpdateObject)
- type WidgetContextMenuEventArgs
- type WidgetCursorEnterEventArgs
- type WidgetCursorEnterHandlerFunc
- type WidgetCursorExitEventArgs
- type WidgetCursorExitHandlerFunc
- type WidgetCursorMoveEventArgs
- type WidgetCursorMoveHandlerFunc
- type WidgetDragAndDropEventArgs
- type WidgetFocusEventArgs
- type WidgetMouseButtonClickedEventArgs
- type WidgetMouseButtonClickedHandlerFunc
- type WidgetMouseButtonLongPressedEventArgs
- type WidgetMouseButtonLongPressedHandlerFunc
- type WidgetMouseButtonPressedEventArgs
- type WidgetMouseButtonPressedHandlerFunc
- type WidgetMouseButtonReleasedEventArgs
- type WidgetMouseButtonReleasedHandlerFunc
- type WidgetOpt
- type WidgetOptions
- func (o WidgetOptions) CanDrop(candropFunc CanDropFunc) WidgetOpt
- func (o WidgetOptions) ContextMenu(contextMenu *Container) WidgetOpt
- func (o WidgetOptions) ContextMenuCloseMode(contextMenuCloseMode WindowCloseMode) WidgetOpt
- func (o WidgetOptions) CursorEnterHandler(f WidgetCursorEnterHandlerFunc) WidgetOpt
- func (o WidgetOptions) CursorExitHandler(f WidgetCursorExitHandlerFunc) WidgetOpt
- func (o WidgetOptions) CursorHovered(cursorHovered string) WidgetOpt
- func (o WidgetOptions) CursorMoveHandler(f WidgetCursorMoveHandlerFunc) WidgetOpt
- func (o WidgetOptions) CursorPressed(cursorPressed string) WidgetOpt
- func (o WidgetOptions) CustomData(cd any) WidgetOpt
- func (o WidgetOptions) Dropped(dropFunc DropFunc) WidgetOpt
- func (o WidgetOptions) ElevateLayer(elevate bool) WidgetOpt
- func (o WidgetOptions) EnableDragAndDrop(d *DragAndDrop) WidgetOpt
- func (o WidgetOptions) LayoutData(ld interface{}) WidgetOpt
- func (o WidgetOptions) LongPressDuration(seconds float64) WidgetOpt
- func (o WidgetOptions) MinSize(minWidth int, minHeight int) WidgetOpt
- func (o WidgetOptions) MouseButtonClickedHandler(f WidgetMouseButtonClickedHandlerFunc) WidgetOpt
- func (o WidgetOptions) MouseButtonLongPressedHandler(f WidgetMouseButtonLongPressedHandlerFunc) WidgetOpt
- func (o WidgetOptions) MouseButtonPressedHandler(f WidgetMouseButtonPressedHandlerFunc) WidgetOpt
- func (o WidgetOptions) MouseButtonReleasedHandler(f WidgetMouseButtonReleasedHandlerFunc) WidgetOpt
- func (o WidgetOptions) OnUpdate(updateFunc UpdateFunc) WidgetOpt
- func (o WidgetOptions) ScrolledHandler(f WidgetScrolledHandlerFunc) WidgetOpt
- func (o WidgetOptions) ToolTip(toolTips ...*ToolTip) WidgetOpt
- func (o WidgetOptions) TrackHover(trackHover bool) WidgetOpt
- type WidgetScrolledEventArgs
- type WidgetScrolledHandlerFunc
- type WidgetState
- type WidgetToolTipEventArgs
- type Window
- func (w *Window) Close()
- func (w *Window) GetCloseFunction() RemoveWindowFunc
- func (w *Window) GetContainer() Containerer
- func (w *Window) Render(screen *ebiten.Image)
- func (w *Window) RequestRelayout()
- func (w *Window) SetCloseFunction(removeWindowFunc RemoveWindowFunc)
- func (w *Window) SetLocation(rect image.Rectangle)
- func (w *Window) SetupInputLayer(def input.DeferredSetupInputLayerFunc)
- func (w *Window) Update(updObj *UpdateObject)
- func (w *Window) Validate()
- type WindowChangedEventArgs
- type WindowChangedHandlerFunc
- type WindowCloseMode
- type WindowClosedEventArgs
- type WindowClosedHandlerFunc
- type WindowOpt
- type WindowOptions
- func (o WindowOptions) BlockLower(blockLower bool) WindowOpt
- func (o WindowOptions) CloseMode(mode WindowCloseMode) WindowOpt
- func (o WindowOptions) ClosedHandler(f WindowClosedHandlerFunc) WindowOpt
- func (o WindowOptions) Contents(c Containerer) WindowOpt
- func (o WindowOptions) DisableRelayering(disableRelayering bool) WindowOpt
- func (o WindowOptions) Draggable() WindowOpt
- func (o WindowOptions) DrawLayer(layer int) WindowOpt
- func (o WindowOptions) Dynamic() WindowOpt
- func (o WindowOptions) Location(rect image.Rectangle) WindowOpt
- func (o WindowOptions) MaxSize(width int, height int) WindowOpt
- func (o WindowOptions) MinSize(width int, height int) WindowOpt
- func (o WindowOptions) Modal() WindowOpt
- func (o WindowOptions) MoveHandler(f WindowChangedHandlerFunc) WindowOpt
- func (o WindowOptions) ResizeHandler(f WindowChangedHandlerFunc) WindowOpt
- func (o WindowOptions) Resizeable() WindowOpt
- func (o WindowOptions) TitleBar(tb Containerer, height int) WindowOpt
Constants ¶
const ( // AnchorLayoutPositionStart is the anchoring position for "left" (in the horizontal direction) or "top" (in the vertical direction.) AnchorLayoutPositionStart = AnchorLayoutPosition(iota) // AnchorLayoutPositionCenter is the center anchoring position. AnchorLayoutPositionCenter // AnchorLayoutPositionEnd is the anchoring position for "right" (in the horizontal direction) or "bottom" (in the vertical direction.) AnchorLayoutPositionEnd )
const ( // GridLayoutPositionStart is the anchoring position for "left" (in the horizontal direction) or "top" (in the vertical direction.) GridLayoutPositionStart = GridLayoutPosition(iota) // GridLayoutPositionStart is the center anchoring position. GridLayoutPositionCenter // GridLayoutPositionStart is the anchoring position for "right" (in the horizontal direction) or "bottom" (in the vertical direction.) GridLayoutPositionEnd )
const ( DirectionHorizontal = Direction(iota) DirectionVertical )
const ( WidgetUnchecked = WidgetState(iota) WidgetChecked WidgetGreyed )
const ( // RowLayoutPositionStart is the anchoring position for "left" (in the horizontal direction) or "top" (in the vertical direction.) RowLayoutPositionStart = RowLayoutPosition(iota) // RowLayoutPositionCenter is the center anchoring position. RowLayoutPositionCenter // RowLayoutPositionEnd is the anchoring position for "right" (in the horizontal direction) or "bottom" (in the vertical direction.) RowLayoutPositionEnd )
const ( TextPositionStart = TextPosition(iota) TextPositionCenter TextPositionEnd )
const COLOR_TAG = "color"
const LINK_TAG = "link"
Variables ¶
This section is empty.
Functions ¶
func AppendToDeferredRenderQueue ¶ added in v0.6.0
func AppendToDeferredRenderQueue(r RenderFunc)
func RenderDeferred ¶ added in v0.6.0
RenderWithDeferred renders r to screen. This function should not be called directly.
Types ¶
type AnchorLayout ¶
type AnchorLayout struct {
// contains filtered or unexported fields
}
AnchorLayout layouts widgets anchored to either a corner or edge of a rectangle, optionally stretching it in one or both directions.
AnchorLayout will layout all widgets in the container to the specified locations regardless of overlap. The widgets in the container will be drawn in the order they were added to the container.
Widget.LayoutData of widgets being layouted by AnchorLayout need to be of type AnchorLayoutData.
func NewAnchorLayout ¶
func NewAnchorLayout(opts ...AnchorLayoutOpt) *AnchorLayout
NewAnchorLayout constructs a new AnchorLayout, configured by opts.
func (*AnchorLayout) Layout ¶
func (a *AnchorLayout) Layout(widgets []PreferredSizeLocateableWidget, rect image.Rectangle)
Layout implements Layouter.
func (*AnchorLayout) PreferredSize ¶
func (a *AnchorLayout) PreferredSize(widgets []PreferredSizeLocateableWidget) (int, int)
PreferredSize implements Layouter.
type AnchorLayoutData ¶
type AnchorLayoutData struct {
// HorizontalPosition specifies the horizontal anchoring position.
HorizontalPosition AnchorLayoutPosition
// VerticalPosition specifies the vertical anchoring position.
VerticalPosition AnchorLayoutPosition
// StretchHorizontal specifies whether to stretch in the horizontal direction.
StretchHorizontal bool
// StretchVertical specifies whether to stretch in the vertical direction.
StretchVertical bool
// Sets the padding for the child.
Padding *Insets
}
AnchorLayoutData specifies layout settings for a widget.
type AnchorLayoutOpt ¶
type AnchorLayoutOpt func(a *AnchorLayout)
AnchorLayoutOpt is a function that configures a.
type AnchorLayoutOptions ¶
type AnchorLayoutOptions struct {
}
var AnchorLayoutOpts AnchorLayoutOptions
AnchorLayoutOpts contains functions that configure an AnchorLayout.
func (AnchorLayoutOptions) Padding ¶
func (o AnchorLayoutOptions) Padding(i *Insets) AnchorLayoutOpt
Padding configures an anchor layout to use padding i. This affects all children.
type AnchorLayoutPosition ¶
type AnchorLayoutPosition int
AnchorLayoutPosition is the type used to specify an anchoring position.
type Button ¶
type Button struct {
IgnoreTransparentPixels bool
KeepPressedOnExit bool
ToggleMode bool
// Allows the user to disable space bar and enter automatically triggering a focused button.
DisableDefaultKeys bool
PressedEvent *event.Event
ReleasedEvent *event.Event
ClickedEvent *event.Event
CursorEnteredEvent *event.Event
CursorMovedEvent *event.Event
CursorExitedEvent *event.Event
StateChangedEvent *event.Event
// contains filtered or unexported fields
}
func (*Button) AddFocus ¶ added in v0.5.7
func (b *Button) AddFocus(direction FocusDirection, focus Focuser)
func (*Button) GetFocus ¶ added in v0.5.7
func (b *Button) GetFocus(direction FocusDirection) Focuser
func (*Button) GraphicImage ¶
func (b *Button) GraphicImage() *GraphicImage
This returns the currently defined GraphicImage object. This may be nil. Any changes to this reference will be reflected by the button but may be overwritten if the button is re-validated.
func (*Button) Image ¶
func (b *Button) Image() *ButtonImage
This returns the currently defined Image object. This may be nil. Any changes to this reference will be reflected by the button but may be overwritten if the button is re-validated.
func (*Button) PreferredSize ¶
func (*Button) Press ¶ added in v0.6.1
func (b *Button) Press()
Press presses the button emulating a Mouse Left click.
func (*Button) Release ¶ added in v0.6.1
func (b *Button) Release()
Release releases the button emulating a Mouse Left release.
func (*Button) RequestRelayout ¶
func (b *Button) RequestRelayout()
func (*Button) SetGraphicImage ¶ added in v0.7.2
func (b *Button) SetGraphicImage(graphicImage *GraphicImage)
Set the GraphicImage for this button.
func (*Button) SetImage ¶ added in v0.7.2
func (b *Button) SetImage(image *ButtonImage)
Set the GraphicImage for this button.
func (*Button) SetLocation ¶
func (*Button) SetState ¶
func (b *Button) SetState(state WidgetState)
func (*Button) SetupInputLayer ¶
func (b *Button) SetupInputLayer(def input.DeferredSetupInputLayerFunc)
func (*Button) State ¶
func (b *Button) State() WidgetState
func (*Button) Update ¶ added in v0.6.0
func (b *Button) Update(updObj *UpdateObject)
type ButtonChangedEventArgs ¶
type ButtonChangedEventArgs struct {
Button *Button
State WidgetState
OffsetX int
OffsetY int
}
type ButtonChangedHandlerFunc ¶
type ButtonChangedHandlerFunc func(args *ButtonChangedEventArgs)
type ButtonClickedEventArgs ¶
type ButtonClickedHandlerFunc ¶
type ButtonClickedHandlerFunc func(args *ButtonClickedEventArgs)
type ButtonCursorHoverHandlerFunc ¶
type ButtonCursorHoverHandlerFunc func(args *ButtonHoverEventArgs)
type ButtonHoverEventArgs ¶
type ButtonImage ¶
type ButtonOptions ¶
type ButtonOptions struct {
}
var ButtonOpts ButtonOptions
func (ButtonOptions) ClickedHandler ¶
func (o ButtonOptions) ClickedHandler(f ButtonClickedHandlerFunc) ButtonOpt
func (ButtonOptions) CursorEnteredHandler ¶
func (o ButtonOptions) CursorEnteredHandler(f ButtonCursorHoverHandlerFunc) ButtonOpt
func (ButtonOptions) CursorExitedHandler ¶
func (o ButtonOptions) CursorExitedHandler(f ButtonCursorHoverHandlerFunc) ButtonOpt
func (ButtonOptions) CursorMovedHandler ¶ added in v0.5.7
func (o ButtonOptions) CursorMovedHandler(f ButtonCursorHoverHandlerFunc) ButtonOpt
func (ButtonOptions) DisableDefaultKeys ¶ added in v0.5.7
func (o ButtonOptions) DisableDefaultKeys() ButtonOpt
This option will disable enter and space from submitting a focused button.
func (ButtonOptions) Graphic ¶
func (o ButtonOptions) Graphic(image *GraphicImage) ButtonOpt
func (ButtonOptions) GraphicPadding ¶
func (o ButtonOptions) GraphicPadding(i Insets) ButtonOpt
func (ButtonOptions) IgnoreTransparentPixels ¶ added in v0.5.8
func (o ButtonOptions) IgnoreTransparentPixels(ignoreTransparentPixels bool) ButtonOpt
IgnoreTransparentPixels disables mouse events like cursor entered, moved and exited if the mouse pointer is over a pixel that is transparent (alpha = 0). The source of pixels is Image.Idle. This options is especially useful, if your button does not have a rectangular shape.
func (ButtonOptions) Image ¶
func (o ButtonOptions) Image(i *ButtonImage) ButtonOpt
func (ButtonOptions) KeepPressedOnExit ¶
func (o ButtonOptions) KeepPressedOnExit() ButtonOpt
func (ButtonOptions) PressedHandler ¶
func (o ButtonOptions) PressedHandler(f ButtonPressedHandlerFunc) ButtonOpt
func (ButtonOptions) ReleasedHandler ¶
func (o ButtonOptions) ReleasedHandler(f ButtonReleasedHandlerFunc) ButtonOpt
func (ButtonOptions) StateChangedHandler ¶
func (o ButtonOptions) StateChangedHandler(f ButtonChangedHandlerFunc) ButtonOpt
func (ButtonOptions) TabOrder ¶ added in v0.3.0
func (o ButtonOptions) TabOrder(tabOrder int) ButtonOpt
func (ButtonOptions) Text ¶
func (o ButtonOptions) Text(label string, face *text.Face, color *ButtonTextColor) ButtonOpt
Text combines three options: TextLabel, TextFace and TextColor. It can be used for the inline configurations of Text object while separate functions are useful for a multi-step configuration.
func (ButtonOptions) TextAndImage ¶
func (o ButtonOptions) TextAndImage(label string, face *text.Face, image *GraphicImage, color *ButtonTextColor) ButtonOpt
TODO: add parameter for image position (start/end).
func (ButtonOptions) TextColor ¶ added in v0.5.7
func (o ButtonOptions) TextColor(color *ButtonTextColor) ButtonOpt
func (ButtonOptions) TextFace ¶ added in v0.5.7
func (o ButtonOptions) TextFace(face *text.Face) ButtonOpt
func (ButtonOptions) TextLabel ¶ added in v0.5.7
func (o ButtonOptions) TextLabel(label string) ButtonOpt
func (ButtonOptions) TextPadding ¶
func (o ButtonOptions) TextPadding(p *Insets) ButtonOpt
func (ButtonOptions) TextPosition ¶ added in v0.5.5
func (o ButtonOptions) TextPosition(h TextPosition, v TextPosition) ButtonOpt
TextPosition sets the horizontal and vertical position of the text within the button. Default is TextPositionCenter for both.
func (ButtonOptions) TextProcessBBCode ¶ added in v0.5.7
func (o ButtonOptions) TextProcessBBCode(enabled bool) ButtonOpt
func (ButtonOptions) ToggleMode ¶
func (o ButtonOptions) ToggleMode() ButtonOpt
func (ButtonOptions) WidgetOpts ¶
func (o ButtonOptions) WidgetOpts(opts ...WidgetOpt) ButtonOpt
type ButtonParams ¶ added in v0.7.0
type ButtonParams struct {
Image *ButtonImage
GraphicImage *GraphicImage
TextColor *ButtonTextColor
TextPosition *TextPositioning
TextPadding *Insets
TextFace *text.Face
GraphicPadding *Insets
MinSize *img.Point
}
type ButtonPressedEventArgs ¶
type ButtonPressedHandlerFunc ¶
type ButtonPressedHandlerFunc func(args *ButtonPressedEventArgs)
type ButtonReleasedEventArgs ¶
type ButtonReleasedHandlerFunc ¶
type ButtonReleasedHandlerFunc func(args *ButtonReleasedEventArgs)
type ButtonTextColor ¶
type CanDropFunc ¶ added in v0.4.0
type CanDropFunc func(args *DragAndDropDroppedEventArgs) bool
type Caret ¶
type Caret struct {
Width int
Height int
Color color.Color
// contains filtered or unexported fields
}
func (*Caret) PreferredSize ¶
func (*Caret) ResetBlinking ¶
func (c *Caret) ResetBlinking()
func (*Caret) SetLocation ¶
func (*Caret) Update ¶ added in v0.6.0
func (c *Caret) Update(updObj *UpdateObject)
type Checkbox ¶
type Checkbox struct {
StateChangedEvent *event.Event
// Allows the user to disable space bar and enter automatically triggering a focused checkbox.
DisableDefaultKeys bool
// contains filtered or unexported fields
}
func NewCheckbox ¶
func NewCheckbox(opts ...CheckboxOpt) *Checkbox
func (*Checkbox) AddFocus ¶ added in v0.5.7
func (c *Checkbox) AddFocus(direction FocusDirection, focus Focuser)
func (*Checkbox) GetFocus ¶ added in v0.5.7
func (c *Checkbox) GetFocus(direction FocusDirection) Focuser
func (*Checkbox) PreferredSize ¶
func (*Checkbox) RequestRelayout ¶ added in v0.7.0
func (c *Checkbox) RequestRelayout()
func (*Checkbox) SetLocation ¶
func (*Checkbox) SetState ¶
func (tw *Checkbox) SetState(state WidgetState)
This function will allow you to update the checkbox's current state.
func (*Checkbox) SetupInputLayer ¶
func (c *Checkbox) SetupInputLayer(def input.DeferredSetupInputLayerFunc)
func (*Checkbox) State ¶
func (tw *Checkbox) State() WidgetState
This function will return the current state the checkbox is in.
func (*Checkbox) Text ¶ added in v0.7.0
This function will return the internal Text object if this checkbox has a label, otherwise nil.
func (*Checkbox) Update ¶ added in v0.6.0
func (c *Checkbox) Update(updObj *UpdateObject)
type CheckboxChangedEventArgs ¶
type CheckboxChangedEventArgs struct {
Active *Checkbox
State WidgetState
}
type CheckboxChangedHandlerFunc ¶
type CheckboxChangedHandlerFunc func(args *CheckboxChangedEventArgs)
type CheckboxImage ¶ added in v0.7.0
type CheckboxImage struct {
Unchecked *image.NineSlice
UncheckedHovered *image.NineSlice
UncheckedDisabled *image.NineSlice
Checked *image.NineSlice
CheckedHovered *image.NineSlice
CheckedDisabled *image.NineSlice
Greyed *image.NineSlice
GreyedHovered *image.NineSlice
GreyedDisabled *image.NineSlice
}
type CheckboxOpt ¶
type CheckboxOpt func(c *Checkbox)
type CheckboxOptions ¶
type CheckboxOptions struct {
}
var CheckboxOpts CheckboxOptions
func (CheckboxOptions) DisableDefaultKeys ¶ added in v0.7.0
func (o CheckboxOptions) DisableDefaultKeys() CheckboxOpt
This option will disable enter and space from submitting a focused checkbox.
func (CheckboxOptions) Image ¶
func (o CheckboxOptions) Image(i *CheckboxImage) CheckboxOpt
This option defines the images to show for the checkbox. i.Checked and i.Unchecked are required.
func (CheckboxOptions) InitialState ¶ added in v0.5.8
func (o CheckboxOptions) InitialState(state WidgetState) CheckboxOpt
This option sets the initial state for the checkbox.
func (CheckboxOptions) LabelFirst ¶ added in v0.7.0
func (o CheckboxOptions) LabelFirst() CheckboxOpt
This option indicates that the label should be before the checkbox.
func (CheckboxOptions) Spacing ¶ added in v0.7.0
func (o CheckboxOptions) Spacing(s int) CheckboxOpt
This option defines how far the checkbox and label should be spaced horizontally if there is a label.
func (CheckboxOptions) StateChangedHandler ¶
func (o CheckboxOptions) StateChangedHandler(f CheckboxChangedHandlerFunc) CheckboxOpt
This option allows you to specify a callback to be called when the checkbox state is changed.
func (CheckboxOptions) TabOrder ¶ added in v0.3.0
func (o CheckboxOptions) TabOrder(tabOrder int) CheckboxOpt
func (CheckboxOptions) Text ¶ added in v0.7.0
func (o CheckboxOptions) Text(labelString string, face *text.Face, color *LabelColor) CheckboxOpt
This option allows you to specify a label to be shown before or after the checkbox.
func (CheckboxOptions) TextColor ¶ added in v0.7.0
func (o CheckboxOptions) TextColor(color *LabelColor) CheckboxOpt
func (CheckboxOptions) TextFace ¶ added in v0.7.0
func (o CheckboxOptions) TextFace(face *text.Face) CheckboxOpt
func (CheckboxOptions) TextLabel ¶ added in v0.7.0
func (o CheckboxOptions) TextLabel(label string) CheckboxOpt
func (CheckboxOptions) TriState ¶
func (o CheckboxOptions) TriState() CheckboxOpt
This option indicates this checkbox should have 3 states. If this option is specified a Greyed image is required.
func (CheckboxOptions) WidgetOpts ¶ added in v0.7.0
func (o CheckboxOptions) WidgetOpts(opts ...WidgetOpt) CheckboxOpt
type CheckboxParams ¶ added in v0.7.0
type CheckboxParams struct {
Image *CheckboxImage
Label *LabelParams
}
type ComboButton ¶
type ComboButton struct {
ContentVisible bool
// contains filtered or unexported fields
}
func NewComboButton ¶
func NewComboButton(opts ...ComboButtonOpt) *ComboButton
func (*ComboButton) GetWidget ¶
func (c *ComboButton) GetWidget() *Widget
func (*ComboButton) Label ¶
func (c *ComboButton) Label() string
func (*ComboButton) PreferredSize ¶
func (c *ComboButton) PreferredSize() (int, int)
func (*ComboButton) Render ¶
func (c *ComboButton) Render(screen *ebiten.Image)
func (*ComboButton) SetLabel ¶
func (c *ComboButton) SetLabel(l string)
func (*ComboButton) SetLocation ¶
func (c *ComboButton) SetLocation(rect image.Rectangle)
func (*ComboButton) SetupInputLayer ¶
func (c *ComboButton) SetupInputLayer(def input.DeferredSetupInputLayerFunc)
func (*ComboButton) Update ¶ added in v0.6.0
func (c *ComboButton) Update(updObj *UpdateObject)
func (*ComboButton) Validate ¶ added in v0.7.0
func (c *ComboButton) Validate()
type ComboButtonOpt ¶
type ComboButtonOpt func(c *ComboButton)
type ComboButtonOptions ¶
type ComboButtonOptions struct {
}
var ComboButtonOpts ComboButtonOptions
func (ComboButtonOptions) ButtonOpts ¶
func (o ComboButtonOptions) ButtonOpts(opts ...ButtonOpt) ComboButtonOpt
func (ComboButtonOptions) Content ¶
func (o ComboButtonOptions) Content(c HasWidget) ComboButtonOpt
func (ComboButtonOptions) MaxContentHeight ¶
func (o ComboButtonOptions) MaxContentHeight(h int) ComboButtonOpt
type Container ¶
type Container struct {
AutoDisableChildren bool
// contains filtered or unexported fields
}
func NewContainer ¶
func NewContainer(opts ...ContainerOpt) *Container
func (*Container) AddChild ¶
func (c *Container) AddChild(children ...PreferredSizeLocateableWidget) RemoveChildFunc
func (*Container) Children ¶ added in v0.3.0
func (c *Container) Children() []PreferredSizeLocateableWidget
func (*Container) GetDropTargets ¶ added in v0.4.0
func (*Container) GetFocusers ¶ added in v0.3.0
func (*Container) IsValidated ¶ added in v0.7.1
func (*Container) PreferredSize ¶
func (*Container) RemoveChild ¶
func (c *Container) RemoveChild(child PreferredSizeLocateableWidget)
func (*Container) RemoveChildren ¶
func (c *Container) RemoveChildren()
func (*Container) ReplaceChild ¶ added in v0.7.2
func (c *Container) ReplaceChild(remove PreferredSizeLocateableWidget, add PreferredSizeLocateableWidget)
func (*Container) RequestRelayout ¶
func (c *Container) RequestRelayout()
func (*Container) SetBackgroundImage ¶ added in v0.7.0
func (*Container) SetLocation ¶
func (*Container) SetupInputLayer ¶
func (c *Container) SetupInputLayer(def input.DeferredSetupInputLayerFunc)
func (*Container) Update ¶ added in v0.6.0
func (c *Container) Update(updObj *UpdateObject)
type ContainerOpt ¶
type ContainerOpt func(c *Container)
type ContainerOptions ¶
type ContainerOptions struct {
}
var ContainerOpts ContainerOptions
func (ContainerOptions) AutoDisableChildren ¶
func (o ContainerOptions) AutoDisableChildren() ContainerOpt
func (ContainerOptions) BackgroundImage ¶
func (o ContainerOptions) BackgroundImage(i *image.NineSlice) ContainerOpt
This will set the background image to the provided NineSlice. If this is set then we will automatically track that the UI has been hovered over for this container Use widget.WidgetOpts.TrackHover(false) to turn this off if desired.
func (ContainerOptions) Layout ¶
func (o ContainerOptions) Layout(layout Layouter) ContainerOpt
func (ContainerOptions) WidgetOpts ¶
func (o ContainerOptions) WidgetOpts(opts ...WidgetOpt) ContainerOpt
type Containerer ¶ added in v0.7.0
type Containerer interface {
Updater
Renderer
Dropper
Relayoutable
input.Layerer
PreferredSizeLocateableWidget
GetFocusers() []Focuser
AddChild(children ...PreferredSizeLocateableWidget) RemoveChildFunc
RemoveChild(child PreferredSizeLocateableWidget)
RemoveChildren()
Children() []PreferredSizeLocateableWidget
IsValidated() bool
}
type DragAndDrop ¶
type DragAndDrop struct {
ContentsOriginVertical DragAndDropAnchor
ContentsOriginHorizontal DragAndDropAnchor
Offset image.Point
AvailableDropTargets []HasWidget
// contains filtered or unexported fields
}
func NewDragAndDrop ¶
func NewDragAndDrop(opts ...DragAndDropOpt) *DragAndDrop
func (*DragAndDrop) SetupInputLayer ¶
func (d *DragAndDrop) SetupInputLayer(def input.DeferredSetupInputLayerFunc)
func (*DragAndDrop) StartDrag ¶ added in v0.4.0
func (d *DragAndDrop) StartDrag()
To avoid conflicting with dragging, if you trigger it on left click you should put the trigger in the button released event.
func (*DragAndDrop) StopDrag ¶ added in v0.4.0
func (d *DragAndDrop) StopDrag()
func (*DragAndDrop) Update ¶ added in v0.6.0
func (d *DragAndDrop) Update(parent HasWidget)
func (*DragAndDrop) Validate ¶ added in v0.7.0
func (d *DragAndDrop) Validate()
type DragAndDropAnchor ¶ added in v0.4.0
type DragAndDropAnchor int
const ( // Anchor at the start of the element. DND_ANCHOR_START DragAndDropAnchor = iota // Anchor in the middle of the element. DND_ANCHOR_MIDDLE // Anchor at the end of the element. DND_ANCHOR_END )
type DragAndDropDroppedHandlerFunc ¶
type DragAndDropDroppedHandlerFunc func(args *DragAndDropDroppedEventArgs)
type DragAndDropOpt ¶
type DragAndDropOpt func(d *DragAndDrop)
type DragAndDropOptions ¶
type DragAndDropOptions struct {
}
var DragAndDropOpts DragAndDropOptions
func (DragAndDropOptions) ContentsCreater ¶
func (o DragAndDropOptions) ContentsCreater(c DragContentsCreater) DragAndDropOpt
func (DragAndDropOptions) ContentsOriginHorizontal ¶ added in v0.4.0
func (o DragAndDropOptions) ContentsOriginHorizontal(contentsOriginHorizontal DragAndDropAnchor) DragAndDropOpt
The horizontal position of the anchor on the tooltip.
Optional - Defaults to DND_ANCHOR_MIDDLE
func (DragAndDropOptions) ContentsOriginVertical ¶ added in v0.4.0
func (o DragAndDropOptions) ContentsOriginVertical(contentsOriginVertical DragAndDropAnchor) DragAndDropOpt
The vertical position of the anchor on the tooltip.
Optional - Defaults to DND_ANCHOR_MIDDLE
func (DragAndDropOptions) DisableDrag ¶ added in v0.4.0
func (o DragAndDropOptions) DisableDrag() DragAndDropOpt
Disable Drag to start Drag and Drop. You may use the "StartDrag()" method on this object or the to begin the drag operation.
Expected use-case: click to pick up, click to drop.
func (DragAndDropOptions) MinDragStartDistance ¶
func (o DragAndDropOptions) MinDragStartDistance(d int) DragAndDropOpt
The minimum distance in pixels a user must drag their cursor to display the dragged element.
Optional - Defaults to 15 pixels
func (DragAndDropOptions) Offset ¶ added in v0.4.0
func (o DragAndDropOptions) Offset(off image.Point) DragAndDropOpt
The X/Y offsets from the Tooltip anchor point.
type DragContentsCreater ¶
type DragContentsEnder ¶ added in v0.4.3
type DragContentsUpdater ¶
type DropFunc ¶ added in v0.4.0
type DropFunc func(args *DragAndDropDroppedEventArgs)
type FlipBook ¶
type FlipBook struct {
// contains filtered or unexported fields
}
A FlipBook is a container that always renders exactly one child widget: the current page. The current page will be embedded in a AnchorLayout.
func NewFlipBook ¶
func NewFlipBook(opts ...FlipBookOpt) *FlipBook
NewFlipBook constructs a new FlipBook configured with opts.
func (*FlipBook) GetDropTargets ¶ added in v0.4.0
func (*FlipBook) GetFocusers ¶ added in v0.3.0
func (*FlipBook) PreferredSize ¶
PreferredSize implements PreferredSizer.
func (*FlipBook) RequestRelayout ¶
func (f *FlipBook) RequestRelayout()
RequestRelayout implements Relayoutable.
func (*FlipBook) SetLocation ¶
SetLocation implements Locateable.
func (*FlipBook) SetPage ¶
func (f *FlipBook) SetPage(page PreferredSizeLocateableWidget)
SetPage sets the current page to be rendered to page. The previous page will no longer be rendered.
Note that when switching to a new page, it may be necessary to re-layout parent containers if the pages are of different sizes.
func (*FlipBook) SetupInputLayer ¶
func (f *FlipBook) SetupInputLayer(def input.DeferredSetupInputLayerFunc)
SetupInputLayer implements InputLayerer.
func (*FlipBook) Update ¶ added in v0.6.0
func (f *FlipBook) Update(updObj *UpdateObject)
type FlipBookOptions ¶
type FlipBookOptions struct {
}
var FlipBookOpts FlipBookOptions
FlipBookOpts contains functions that configure a FlipBook.
func (FlipBookOptions) ContainerOpts ¶
func (o FlipBookOptions) ContainerOpts(opts ...ContainerOpt) FlipBookOpt
WithContainerOpts configures a FlipBook with opts.
func (FlipBookOptions) Padding ¶
func (o FlipBookOptions) Padding(i *Insets) FlipBookOpt
WithPadding configures a FlipBook with padding i.
type FocusDirection ¶ added in v0.5.7
type FocusDirection int
const ( FOCUS_NEXT FocusDirection = iota FOCUS_PREVIOUS FOCUS_NORTH FOCUS_NORTHEAST FOCUS_EAST FOCUS_SOUTHEAST FOCUS_SOUTH FOCUS_SOUTHWEST FOCUS_WEST FOCUS_NORTHWEST )
type Focuser ¶
type Focuser interface {
HasWidget
Focus(focused bool)
IsFocused() bool
TabOrder() int
GetFocus(direction FocusDirection) Focuser
AddFocus(direction FocusDirection, focus Focuser)
}
type Graphic ¶
type Graphic struct {
Image *ebiten.Image
ImageNineSlice *image.NineSlice
// contains filtered or unexported fields
}
func NewGraphic ¶
func NewGraphic(opts ...GraphicOpt) *Graphic
func (*Graphic) PreferredSize ¶
func (*Graphic) SetLocation ¶
func (*Graphic) Update ¶ added in v0.6.0
func (g *Graphic) Update(updObj *UpdateObject)
type GraphicImage ¶ added in v0.6.1
type GraphicOpt ¶
type GraphicOpt func(g *Graphic)
type GraphicOptions ¶
type GraphicOptions struct {
}
var GraphicOpts GraphicOptions
func (GraphicOptions) GIF ¶ added in v0.6.1
func (o GraphicOptions) GIF(gif *gif.GIF) GraphicOpt
func (GraphicOptions) Image ¶
func (o GraphicOptions) Image(i *ebiten.Image) GraphicOpt
func (GraphicOptions) ImageNineSlice ¶
func (o GraphicOptions) ImageNineSlice(i *image.NineSlice) GraphicOpt
func (GraphicOptions) Images ¶ added in v0.6.1
func (o GraphicOptions) Images(i *GraphicImage) GraphicOpt
func (GraphicOptions) WidgetOpts ¶
func (o GraphicOptions) WidgetOpts(opts ...WidgetOpt) GraphicOpt
type GridLayout ¶
type GridLayout struct {
// contains filtered or unexported fields
}
GridLayout layouts widgets in a grid fashion, with columns or rows optionally being stretched.
Widget.LayoutData of widgets being layouted by GridLayout need to be of type GridLayoutData.
func NewGridLayout ¶
func NewGridLayout(opts ...GridLayoutOpt) *GridLayout
NewGridLayout constructs a new GridLayout, configured by opts.
func (*GridLayout) Layout ¶
func (g *GridLayout) Layout(widgets []PreferredSizeLocateableWidget, rect image.Rectangle)
Layout implements Layouter.
func (*GridLayout) PreferredSize ¶
func (g *GridLayout) PreferredSize(widgets []PreferredSizeLocateableWidget) (int, int)
PreferredSize implements Layouter.
type GridLayoutData ¶
type GridLayoutData struct {
// MaxWidth specifies the maximum width.
MaxWidth int
// MaxHeight specifies the maximum height..
MaxHeight int
// HorizontalPosition specifies the horizontal anchoring position inside the grid cell.
HorizontalPosition GridLayoutPosition
// VerticalPosition specifies the vertical anchoring position inside the grid cell.
VerticalPosition GridLayoutPosition
}
GridLayoutData specifies layout settings for a widget.
type GridLayoutOpt ¶
type GridLayoutOpt func(g *GridLayout)
GridLayoutOpt is a function that configures g.
type GridLayoutOptions ¶
type GridLayoutOptions struct {
}
var GridLayoutOpts GridLayoutOptions
GridLayoutOpts contains functions that configure a GridLayout.
func (GridLayoutOptions) Columns ¶
func (o GridLayoutOptions) Columns(c int) GridLayoutOpt
Columns configures a grid layout to use c columns.
func (GridLayoutOptions) DefaultStretch ¶ added in v0.6.1
func (o GridLayoutOptions) DefaultStretch(c bool, r bool) GridLayoutOpt
DefaultStretch will set the stretch value to the columns/rows that are extra not defined on the main Stretch.
func (GridLayoutOptions) Padding ¶
func (o GridLayoutOptions) Padding(i *Insets) GridLayoutOpt
Padding configures a grid layout to use padding i.
func (GridLayoutOptions) Spacing ¶
func (o GridLayoutOptions) Spacing(c int, r int) GridLayoutOpt
Spacing configures a grid layout to separate columns by spacing c and rows by spacing r.
func (GridLayoutOptions) Stretch ¶
func (o GridLayoutOptions) Stretch(c []bool, r []bool) GridLayoutOpt
Stretch configures a grid layout to stretch columns according to c and rows according to r. The number of elements of c and r must correspond with the number of columns and rows in the layout.
type GridLayoutPosition ¶
type GridLayoutPosition int
GridLayoutPosition is the type used to specify an anchoring position.
type HasWidget ¶
type HasWidget interface {
GetWidget() *Widget
}
HasWidget must be implemented by concrete widget types to get their Widget.
type Insets ¶
func NewInsetsSimple ¶
type Label ¶
type Label struct {
Label string
// contains filtered or unexported fields
}
func (*Label) PreferredSize ¶
func (*Label) SetLocation ¶
func (*Label) Update ¶ added in v0.6.0
func (l *Label) Update(updObj *UpdateObject)
type LabelOptions ¶
type LabelOptions struct {
}
var LabelOpts LabelOptions
func (LabelOptions) LabelColor ¶ added in v0.7.0
func (o LabelOptions) LabelColor(color *LabelColor) LabelOpt
Set the label font colors.
func (LabelOptions) LabelFace ¶ added in v0.7.0
func (o LabelOptions) LabelFace(face *text.Face) LabelOpt
Set the label font.
func (LabelOptions) LabelPadding ¶ added in v0.7.0
func (o LabelOptions) LabelPadding(padding *Insets) LabelOpt
Set the label padding.
func (LabelOptions) LabelText ¶ added in v0.7.0
func (o LabelOptions) LabelText(label string) LabelOpt
Set the label text.
func (LabelOptions) Text ¶
func (o LabelOptions) Text(label string, face *text.Face, color *LabelColor) LabelOpt
Set the label text, font, and font colors.
func (LabelOptions) TextOpts ¶
func (o LabelOptions) TextOpts(opts ...TextOpt) LabelOpt
type LabelOrder ¶ added in v0.4.1
type LabelOrder int
const ( CHECKBOX_FIRST LabelOrder = iota LABEL_FIRST )
type LabelParams ¶ added in v0.7.0
type LabelParams struct {
Face *text.Face
Color *LabelColor
Padding *Insets
}
type Layouter ¶
type Layouter interface {
PreferredSize(widgets []PreferredSizeLocateableWidget) (int, int)
Layout(widgets []PreferredSizeLocateableWidget, rect image.Rectangle)
}
type LinkEventArgs ¶ added in v0.7.0
type LinkHandlerFunc ¶ added in v0.7.0
type LinkHandlerFunc func(args *LinkEventArgs)
type List ¶
func (*List) AddEntry ¶ added in v0.5.5
Add a new entry to the end of the list Note: Duplicates will not be added.
func (*List) AddFocus ¶ added in v0.5.7
func (l *List) AddFocus(direction FocusDirection, focus Focuser)
func (*List) FocusPrevious ¶ added in v0.5.7
func (l *List) FocusPrevious()
func (*List) GetFocus ¶ added in v0.5.7
func (l *List) GetFocus(direction FocusDirection) Focuser
func (*List) PreferredSize ¶
func (*List) RemoveEntry ¶ added in v0.5.5
Remove the passed in entry from the list if it exists.
func (*List) RequestRelayout ¶
func (l *List) RequestRelayout()
func (*List) SelectFocused ¶ added in v0.5.7
func (l *List) SelectFocused()
func (*List) SelectedEntry ¶
Return the currently selected entry in the list.
func (*List) SetEntries ¶ added in v0.5.5
Updates the entries in the list. Note: Duplicates will be removed.
func (*List) SetLocation ¶
func (*List) SetSelectedEntry ¶
Set the Selected Entry to e if it is found.
func (*List) SetupInputLayer ¶
func (l *List) SetupInputLayer(def input.DeferredSetupInputLayerFunc)
func (*List) Update ¶ added in v0.6.0
func (l *List) Update(updObj *UpdateObject)
func (*List) UpdateEntry ¶ added in v0.7.3
UpdateEntry recreates the button for the passed in entry if it exists.
type ListComboButton ¶
type ListComboButton struct {
EntrySelectedEvent *event.Event
// contains filtered or unexported fields
}
func NewListComboButton ¶
func NewListComboButton(opts ...ListComboButtonOpt) *ListComboButton
func (*ListComboButton) AddFocus ¶ added in v0.5.7
func (l *ListComboButton) AddFocus(direction FocusDirection, focus Focuser)
func (*ListComboButton) ContentVisible ¶
func (l *ListComboButton) ContentVisible() bool
func (*ListComboButton) Focus ¶ added in v0.3.0
func (l *ListComboButton) Focus(focused bool)
func (*ListComboButton) FocusNext ¶ added in v0.5.7
func (l *ListComboButton) FocusNext()
func (*ListComboButton) FocusPrevious ¶ added in v0.5.7
func (l *ListComboButton) FocusPrevious()
func (*ListComboButton) GetFocus ¶ added in v0.5.7
func (l *ListComboButton) GetFocus(direction FocusDirection) Focuser
func (*ListComboButton) GetWidget ¶
func (l *ListComboButton) GetWidget() *Widget
func (*ListComboButton) IsFocused ¶ added in v0.5.3
func (l *ListComboButton) IsFocused() bool
func (*ListComboButton) Label ¶
func (l *ListComboButton) Label() string
func (*ListComboButton) PreferredSize ¶
func (l *ListComboButton) PreferredSize() (int, int)
func (*ListComboButton) Render ¶
func (l *ListComboButton) Render(screen *ebiten.Image)
func (*ListComboButton) SelectFocused ¶ added in v0.5.7
func (l *ListComboButton) SelectFocused()
func (*ListComboButton) SelectedEntry ¶
func (l *ListComboButton) SelectedEntry() interface{}
func (*ListComboButton) SetContentVisible ¶
func (l *ListComboButton) SetContentVisible(v bool)
func (*ListComboButton) SetLocation ¶
func (l *ListComboButton) SetLocation(rect image.Rectangle)
func (*ListComboButton) SetSelectedEntry ¶
func (l *ListComboButton) SetSelectedEntry(e interface{})
func (*ListComboButton) SetupInputLayer ¶
func (l *ListComboButton) SetupInputLayer(def input.DeferredSetupInputLayerFunc)
func (*ListComboButton) TabOrder ¶ added in v0.3.0
func (l *ListComboButton) TabOrder() int
func (*ListComboButton) Update ¶ added in v0.6.0
func (l *ListComboButton) Update(updObj *UpdateObject)
func (*ListComboButton) Validate ¶ added in v0.7.0
func (l *ListComboButton) Validate()
type ListComboButtonEntrySelectedEventArgs ¶
type ListComboButtonEntrySelectedEventArgs struct {
Button *ListComboButton
Entry interface{}
PreviousEntry interface{}
}
type ListComboButtonEntrySelectedHandlerFunc ¶
type ListComboButtonEntrySelectedHandlerFunc func(args *ListComboButtonEntrySelectedEventArgs)
type ListComboButtonOpt ¶
type ListComboButtonOpt func(l *ListComboButton)
type ListComboButtonOptions ¶
type ListComboButtonOptions struct {
}
var ListComboButtonOpts ListComboButtonOptions
func (ListComboButtonOptions) ButtonParams ¶ added in v0.7.0
func (o ListComboButtonOptions) ButtonParams(buttonParams *ButtonParams) ListComboButtonOpt
func (ListComboButtonOptions) DisableDefaultKeys ¶ added in v0.3.3
func (o ListComboButtonOptions) DisableDefaultKeys(val bool) ListComboButtonOpt
func (ListComboButtonOptions) Entries ¶ added in v0.7.0
func (o ListComboButtonOptions) Entries(e []any) ListComboButtonOpt
func (ListComboButtonOptions) EntryLabelFunc ¶
func (o ListComboButtonOptions) EntryLabelFunc(button SelectComboButtonEntryLabelFunc, list ListEntryLabelFunc) ListComboButtonOpt
func (ListComboButtonOptions) EntrySelectedHandler ¶
func (o ListComboButtonOptions) EntrySelectedHandler(f ListComboButtonEntrySelectedHandlerFunc) ListComboButtonOpt
func (ListComboButtonOptions) InitialEntry ¶ added in v0.7.0
func (o ListComboButtonOptions) InitialEntry(e any) ListComboButtonOpt
func (ListComboButtonOptions) ListParams ¶ added in v0.7.0
func (o ListComboButtonOptions) ListParams(listParams *ListParams) ListComboButtonOpt
func (ListComboButtonOptions) MaxContentHeight ¶ added in v0.7.0
func (o ListComboButtonOptions) MaxContentHeight(h int) ListComboButtonOpt
func (ListComboButtonOptions) TabOrder ¶ added in v0.3.0
func (o ListComboButtonOptions) TabOrder(tabOrder int) ListComboButtonOpt
func (ListComboButtonOptions) Text ¶
func (o ListComboButtonOptions) Text(face *text.Face, image *GraphicImage, color *ButtonTextColor) ListComboButtonOpt
func (ListComboButtonOptions) WidgetOpts ¶ added in v0.7.0
func (o ListComboButtonOptions) WidgetOpts(opts ...WidgetOpt) ListComboButtonOpt
type ListComboButtonParams ¶ added in v0.7.0
type ListComboButtonParams struct {
List *ListParams
Button *ButtonParams
DisableDefaultKeys *bool
MaxContentHeight *int
}
type ListEntryColor ¶
type ListEntryColor struct {
Unselected color.Color
Selected color.Color
DisabledUnselected color.Color
DisabledSelected color.Color
SelectingBackground color.Color
SelectedBackground color.Color
FocusedBackground color.Color
SelectingFocusedBackground color.Color
SelectedFocusedBackground color.Color
DisabledSelectedBackground color.Color
}
type ListEntryLabelFunc ¶
type ListEntrySelectedHandlerFunc ¶
type ListEntrySelectedHandlerFunc func(args *ListEntrySelectedEventArgs)
type ListEntrySortFunc ¶ added in v0.7.3
type ListOptions ¶
type ListOptions struct {
}
var ListOpts ListOptions
func (ListOptions) AllowReselect ¶
func (o ListOptions) AllowReselect() ListOpt
func (ListOptions) ContainerOpts ¶
func (o ListOptions) ContainerOpts(opts ...ContainerOpt) ListOpt
func (ListOptions) ControlWidgetSpacing ¶
func (o ListOptions) ControlWidgetSpacing(s int) ListOpt
func (ListOptions) DisableDefaultKeys ¶ added in v0.3.3
func (o ListOptions) DisableDefaultKeys(val bool) ListOpt
func (ListOptions) Entries ¶
func (o ListOptions) Entries(e []any) ListOpt
func (ListOptions) EntryColor ¶
func (o ListOptions) EntryColor(c *ListEntryColor) ListOpt
func (ListOptions) EntryFontFace ¶
func (o ListOptions) EntryFontFace(f *text.Face) ListOpt
func (ListOptions) EntryLabelFunc ¶
func (o ListOptions) EntryLabelFunc(f ListEntryLabelFunc) ListOpt
func (ListOptions) EntrySelectedHandler ¶
func (o ListOptions) EntrySelectedHandler(f ListEntrySelectedHandlerFunc) ListOpt
func (ListOptions) EntrySortFunc ¶ added in v0.7.3
func (o ListOptions) EntrySortFunc(f ListEntrySortFunc) ListOpt
func (ListOptions) EntryTextPadding ¶
func (o ListOptions) EntryTextPadding(i *Insets) ListOpt
func (ListOptions) EntryTextPosition ¶ added in v0.5.5
func (o ListOptions) EntryTextPosition(h TextPosition, v TextPosition) ListOpt
EntryTextPosition sets the position of the text for entries. Defaults to both TextPositionCenter.
func (ListOptions) HideHorizontalSlider ¶
func (o ListOptions) HideHorizontalSlider() ListOpt
func (ListOptions) HideVerticalSlider ¶
func (o ListOptions) HideVerticalSlider() ListOpt
func (ListOptions) ScrollContainerImage ¶ added in v0.7.0
func (o ListOptions) ScrollContainerImage(image *ScrollContainerImage) ListOpt
Specify the images for the scroll container.
func (ListOptions) ScrollContainerPadding ¶ added in v0.7.0
func (o ListOptions) ScrollContainerPadding(padding *Insets) ListOpt
Specify the padding for the scroll container.
func (ListOptions) SelectFocus ¶ added in v0.5.6
func (o ListOptions) SelectFocus() ListOpt
SelectFocus automatically selects each focused entry.
func (ListOptions) SelectPressed ¶ added in v0.6.1
func (o ListOptions) SelectPressed() ListOpt
SelectPressed selects entries when pressing instead of releasing (the default).
func (ListOptions) SliderParams ¶ added in v0.7.0
func (o ListOptions) SliderParams(sliderParams *SliderParams) ListOpt
Specify the options for the scroll bars.
func (ListOptions) TabOrder ¶ added in v0.3.0
func (o ListOptions) TabOrder(tabOrder int) ListOpt
type ListParams ¶ added in v0.7.0
type ListParams struct {
EntryFace *text.Face
EntryColor *ListEntryColor
EntryTextPadding *Insets
EntryTextHorizontalPosition *TextPosition
EntryTextVerticalPosition *TextPosition
ControlWidgetSpacing *int
MinSize *img.Point
AllowReselect *bool
SelectFocus *bool
SelectPressed *bool
DisableDefaultKeys *bool
Slider *SliderParams
ScrollContainerImage *ScrollContainerImage
ScrollContainerPadding *Insets
// contains filtered or unexported fields
}
type Locateable ¶
type MultiOnce ¶
type MultiOnce struct {
// contains filtered or unexported fields
}
MultiOnce works like sync.Once, but can execute any number of functions.
type Panel ¶ added in v0.7.0
type Panel struct {
Container
}
func NewPanel ¶ added in v0.7.0
func NewPanel(opts ...ContainerOpt) *Panel
type PanelParams ¶ added in v0.7.0
type PreferredSizeLocateableWidget ¶
type PreferredSizeLocateableWidget interface {
HasWidget
PreferredSizer
Locateable
Validate()
}
type PreferredSizer ¶
PreferredSizer may be implemented by concrete widget types that can report a preferred size.
type ProgressBar ¶
func NewProgressBar ¶
func NewProgressBar(opts ...ProgressBarOpt) *ProgressBar
func (*ProgressBar) GetCurrent ¶
func (s *ProgressBar) GetCurrent() int
func (*ProgressBar) GetWidget ¶
func (s *ProgressBar) GetWidget() *Widget
func (*ProgressBar) PreferredSize ¶
func (s *ProgressBar) PreferredSize() (int, int)
func (*ProgressBar) Render ¶
func (s *ProgressBar) Render(screen *ebiten.Image)
func (*ProgressBar) SetCurrent ¶
func (s *ProgressBar) SetCurrent(value int) bool
func (*ProgressBar) SetLocation ¶
func (s *ProgressBar) SetLocation(rect img.Rectangle)
func (*ProgressBar) Update ¶ added in v0.6.0
func (s *ProgressBar) Update(updObj *UpdateObject)
func (*ProgressBar) Validate ¶ added in v0.7.0
func (pb *ProgressBar) Validate()
type ProgressBarImage ¶
type ProgressBarOpt ¶
type ProgressBarOpt func(s *ProgressBar)
type ProgressBarOptions ¶
type ProgressBarOptions struct {
}
var ProgressBarOpts ProgressBarOptions
func (ProgressBarOptions) Direction ¶ added in v0.5.5
func (o ProgressBarOptions) Direction(d Direction) ProgressBarOpt
Direction sets the direction of the progress bar. The default is horizontal.
func (ProgressBarOptions) FillImage ¶ added in v0.7.0
func (o ProgressBarOptions) FillImage(fill *ProgressBarImage) ProgressBarOpt
func (ProgressBarOptions) Images ¶
func (o ProgressBarOptions) Images(track *ProgressBarImage, fill *ProgressBarImage) ProgressBarOpt
func (ProgressBarOptions) Inverted ¶ added in v0.5.5
func (o ProgressBarOptions) Inverted(inverted bool) ProgressBarOpt
Inverted sets whether the progress bar is inverted. The default is false, which means from left to right or top to bottom.
func (ProgressBarOptions) TrackImage ¶ added in v0.7.0
func (o ProgressBarOptions) TrackImage(track *ProgressBarImage) ProgressBarOpt
func (ProgressBarOptions) TrackPadding ¶
func (o ProgressBarOptions) TrackPadding(i *Insets) ProgressBarOpt
func (ProgressBarOptions) Values ¶
func (o ProgressBarOptions) Values(min int, max int, current int) ProgressBarOpt
func (ProgressBarOptions) WidgetOpts ¶
func (o ProgressBarOptions) WidgetOpts(opts ...WidgetOpt) ProgressBarOpt
type ProgressBarParams ¶ added in v0.7.0
type ProgressBarParams struct {
TrackImage *ProgressBarImage
FillImage *ProgressBarImage
TrackPadding *Insets
}
type RadioGroup ¶
func NewRadioGroup ¶
func NewRadioGroup(opts ...RadioGroupOpt) *RadioGroup
func (*RadioGroup) Active ¶
func (r *RadioGroup) Active() RadioGroupElement
func (*RadioGroup) SetActive ¶
func (r *RadioGroup) SetActive(a RadioGroupElement)
type RadioGroupChangedEventArgs ¶
type RadioGroupChangedEventArgs struct {
Active RadioGroupElement
}
type RadioGroupChangedHandlerFunc ¶
type RadioGroupChangedHandlerFunc func(args *RadioGroupChangedEventArgs)
type RadioGroupElement ¶
type RadioGroupElement interface {
SetState(state WidgetState)
// contains filtered or unexported methods
}
type RadioGroupOpt ¶
type RadioGroupOpt func(r *RadioGroup)
type RadioGroupOptions ¶
type RadioGroupOptions struct {
}
var RadioGroupOpts RadioGroupOptions
func (RadioGroupOptions) ChangedHandler ¶
func (o RadioGroupOptions) ChangedHandler(f RadioGroupChangedHandlerFunc) RadioGroupOpt
func (RadioGroupOptions) Elements ¶
func (o RadioGroupOptions) Elements(e ...RadioGroupElement) RadioGroupOpt
func (RadioGroupOptions) InitialElement ¶ added in v0.5.5
func (o RadioGroupOptions) InitialElement(e RadioGroupElement) RadioGroupOpt
This function allows you to select which element should be selected initialially. Otherwise it will select the first element in the Elements array.
type Relayoutable ¶
type Relayoutable interface {
RequestRelayout()
}
type RemoveChildFunc ¶
type RemoveChildFunc func()
type RemoveWindowFunc ¶
type RemoveWindowFunc func()
type RenderFunc ¶
type Renderer ¶
Renderer may be implemented by concrete widget types that can render onto the screen.
type RowLayout ¶
type RowLayout struct {
// contains filtered or unexported fields
}
RowLayout layouts widgets in either a single row or a single column, optionally stretching them in the other direction.
Widget.LayoutData of widgets being layouted by RowLayout need to be of type RowLayoutData.
func NewRowLayout ¶
func NewRowLayout(opts ...RowLayoutOpt) *RowLayout
NewRowLayout constructs a new RowLayout, configured by opts.
func (*RowLayout) Layout ¶
func (r *RowLayout) Layout(widgets []PreferredSizeLocateableWidget, rect image.Rectangle)
Layout implements Layouter.
func (*RowLayout) PreferredSize ¶
func (r *RowLayout) PreferredSize(widgets []PreferredSizeLocateableWidget) (int, int)
PreferredSize implements Layouter.
type RowLayoutData ¶
type RowLayoutData struct {
// Position specifies the anchoring position for the direction that is not the primary direction of the layout.
Position RowLayoutPosition
// Stretch specifies whether to stretch in the direction that is not the primary direction of the layout.
Stretch bool
// MaxWidth specifies the maximum width.
MaxWidth int
// MaxHeight specifies the maximum height.
MaxHeight int
}
RowLayoutData specifies layout settings for a widget.
type RowLayoutOpt ¶
type RowLayoutOpt func(r *RowLayout)
RowLayoutOpt is a function that configures r.
type RowLayoutOptions ¶
type RowLayoutOptions struct {
}
var RowLayoutOpts RowLayoutOptions
RowLayoutOpts contains functions that configure a RowLayout.
func (RowLayoutOptions) Direction ¶
func (o RowLayoutOptions) Direction(d Direction) RowLayoutOpt
Direction configures a row layout to layout widgets in the primary direction d. This will also switch the meaning of any widget's RowLayoutData.Position and RowLayoutData.Stretch to the other direction.
func (RowLayoutOptions) Padding ¶
func (o RowLayoutOptions) Padding(i *Insets) RowLayoutOpt
Padding configures a row layout to use padding i.
func (RowLayoutOptions) Spacing ¶
func (o RowLayoutOptions) Spacing(s int) RowLayoutOpt
Spacing configures a row layout to separate widgets by spacing s.
type RowLayoutPosition ¶
type RowLayoutPosition int
RowLayoutPosition is the type used to specify an anchoring position.
type ScrollContainer ¶
type ScrollContainer struct {
ScrollLeft float64
ScrollTop float64
// contains filtered or unexported fields
}
func NewScrollContainer ¶
func NewScrollContainer(opts ...ScrollContainerOpt) *ScrollContainer
func (*ScrollContainer) ContentRect ¶
func (s *ScrollContainer) ContentRect() img.Rectangle
func (*ScrollContainer) GetDropTargets ¶ added in v0.4.0
func (s *ScrollContainer) GetDropTargets() []HasWidget
func (*ScrollContainer) GetFocusers ¶ added in v0.3.0
func (s *ScrollContainer) GetFocusers() []Focuser
func (*ScrollContainer) GetWidget ¶
func (s *ScrollContainer) GetWidget() *Widget
func (*ScrollContainer) PreferredSize ¶
func (s *ScrollContainer) PreferredSize() (int, int)
func (*ScrollContainer) Render ¶
func (s *ScrollContainer) Render(screen *ebiten.Image)
func (*ScrollContainer) SetLocation ¶
func (s *ScrollContainer) SetLocation(rect img.Rectangle)
func (*ScrollContainer) SetupInputLayer ¶
func (s *ScrollContainer) SetupInputLayer(def input.DeferredSetupInputLayerFunc)
func (*ScrollContainer) Update ¶ added in v0.6.0
func (s *ScrollContainer) Update(updObj *UpdateObject)
func (*ScrollContainer) Validate ¶ added in v0.7.0
func (s *ScrollContainer) Validate()
func (*ScrollContainer) ViewRect ¶ added in v0.5.6
func (s *ScrollContainer) ViewRect() img.Rectangle
type ScrollContainerImage ¶
type ScrollContainerOpt ¶
type ScrollContainerOpt func(s *ScrollContainer)
type ScrollContainerOptions ¶
type ScrollContainerOptions struct {
}
var ScrollContainerOpts ScrollContainerOptions
func (ScrollContainerOptions) Content ¶
func (o ScrollContainerOptions) Content(c PreferredSizeLocateableWidget) ScrollContainerOpt
func (ScrollContainerOptions) Image ¶
func (o ScrollContainerOptions) Image(i *ScrollContainerImage) ScrollContainerOpt
func (ScrollContainerOptions) Padding ¶
func (o ScrollContainerOptions) Padding(p *Insets) ScrollContainerOpt
func (ScrollContainerOptions) StretchContentWidth ¶
func (o ScrollContainerOptions) StretchContentWidth() ScrollContainerOpt
func (ScrollContainerOptions) WidgetOpts ¶
func (o ScrollContainerOptions) WidgetOpts(opts ...WidgetOpt) ScrollContainerOpt
type ScrollMode ¶ added in v0.2.7
type ScrollMode int
const ( // Default. Scrolling is not automatically handled. None ScrollMode = iota // The TextArea is automatically scrolled to the beginning on change. ScrollBeginning // The TextArea is automatically scrolled to the end on change. ScrollEnd // The TextArea will initially position the text at the end of the scroll area. PositionAtEnd )
type SelectComboButton ¶
type SelectComboButton struct {
EntrySelectedEvent *event.Event
// contains filtered or unexported fields
}
func NewSelectComboButton ¶
func NewSelectComboButton(opts ...SelectComboButtonOpt) *SelectComboButton
func (*SelectComboButton) ContentVisible ¶
func (s *SelectComboButton) ContentVisible() bool
func (*SelectComboButton) GetWidget ¶
func (s *SelectComboButton) GetWidget() *Widget
func (*SelectComboButton) Label ¶
func (s *SelectComboButton) Label() string
func (*SelectComboButton) PreferredSize ¶
func (s *SelectComboButton) PreferredSize() (int, int)
func (*SelectComboButton) Render ¶
func (s *SelectComboButton) Render(screen *ebiten.Image)
func (*SelectComboButton) SelectedEntry ¶
func (s *SelectComboButton) SelectedEntry() interface{}
func (*SelectComboButton) SetContentVisible ¶
func (s *SelectComboButton) SetContentVisible(v bool)
func (*SelectComboButton) SetLabel ¶
func (s *SelectComboButton) SetLabel(l string)
func (*SelectComboButton) SetLocation ¶
func (s *SelectComboButton) SetLocation(rect image.Rectangle)
func (*SelectComboButton) SetSelectedEntry ¶
func (s *SelectComboButton) SetSelectedEntry(e interface{})
func (*SelectComboButton) SetupInputLayer ¶
func (s *SelectComboButton) SetupInputLayer(def input.DeferredSetupInputLayerFunc)
func (*SelectComboButton) Update ¶ added in v0.6.0
func (s *SelectComboButton) Update(updObj *UpdateObject)
func (*SelectComboButton) Validate ¶ added in v0.7.0
func (s *SelectComboButton) Validate()
type SelectComboButtonEntryLabelFunc ¶
type SelectComboButtonEntryLabelFunc func(e interface{}) string
type SelectComboButtonEntrySelectedEventArgs ¶
type SelectComboButtonEntrySelectedEventArgs struct {
Button *SelectComboButton
Entry interface{}
PreviousEntry interface{}
}
type SelectComboButtonEntrySelectedHandlerFunc ¶
type SelectComboButtonEntrySelectedHandlerFunc func(args *SelectComboButtonEntrySelectedEventArgs)
type SelectComboButtonOpt ¶
type SelectComboButtonOpt func(s *SelectComboButton)
type SelectComboButtonOptions ¶
type SelectComboButtonOptions struct {
}
var SelectComboButtonOpts SelectComboButtonOptions
func (SelectComboButtonOptions) ComboButtonOpts ¶
func (o SelectComboButtonOptions) ComboButtonOpts(opts ...ComboButtonOpt) SelectComboButtonOpt
func (SelectComboButtonOptions) EntryLabelFunc ¶
func (o SelectComboButtonOptions) EntryLabelFunc(f SelectComboButtonEntryLabelFunc) SelectComboButtonOpt
func (SelectComboButtonOptions) EntrySelectedHandler ¶
func (o SelectComboButtonOptions) EntrySelectedHandler(f SelectComboButtonEntrySelectedHandlerFunc) SelectComboButtonOpt
type Slider ¶
type Slider struct {
Min int
Max int
Current int
DrawTrackDisabled bool
ChangedEvent *event.Event
// contains filtered or unexported fields
}
func (*Slider) AddFocus ¶ added in v0.5.7
func (s *Slider) AddFocus(direction FocusDirection, focus Focuser)
func (*Slider) GetFocus ¶ added in v0.5.7
func (s *Slider) GetFocus(direction FocusDirection) Focuser
func (*Slider) PreferredSize ¶
func (*Slider) SetLocation ¶
func (*Slider) SetupInputLayer ¶
func (s *Slider) SetupInputLayer(def input.DeferredSetupInputLayerFunc)
func (*Slider) Update ¶ added in v0.6.0
func (s *Slider) Update(updObj *UpdateObject)
type SliderChangedEventArgs ¶
type SliderChangedHandlerFunc ¶
type SliderChangedHandlerFunc func(args *SliderChangedEventArgs)
type SliderOptions ¶
type SliderOptions struct {
}
var SliderOpts SliderOptions
func (SliderOptions) ChangedHandler ¶
func (o SliderOptions) ChangedHandler(f SliderChangedHandlerFunc) SliderOpt
func (SliderOptions) Direction
deprecated
func (o SliderOptions) Direction(d Direction) SliderOpt
Deprecated: Use Orientation(o *Direction) instead.
func (SliderOptions) DisableDefaultKeys ¶ added in v0.3.3
func (o SliderOptions) DisableDefaultKeys(val bool) SliderOpt
func (SliderOptions) FixedHandleSize ¶
func (o SliderOptions) FixedHandleSize(s int) SliderOpt
func (SliderOptions) HandleImage ¶ added in v0.5.7
func (o SliderOptions) HandleImage(handle *ButtonImage) SliderOpt
This sets the handle images (required).
func (SliderOptions) Images ¶
func (o SliderOptions) Images(track *SliderTrackImage, handle *ButtonImage) SliderOpt
This sets the track images (not required) and the handle images (required).
func (SliderOptions) InitialCurrent ¶ added in v0.6.1
func (o SliderOptions) InitialCurrent(value int) SliderOpt
func (SliderOptions) MinHandleSize ¶
func (o SliderOptions) MinHandleSize(s int) SliderOpt
func (SliderOptions) Orientation ¶ added in v0.7.0
func (so SliderOptions) Orientation(o Direction) SliderOpt
func (SliderOptions) PageSizeFunc ¶
func (o SliderOptions) PageSizeFunc(f SliderPageSizeFunc) SliderOpt
func (SliderOptions) TabOrder ¶ added in v0.3.0
func (o SliderOptions) TabOrder(tabOrder int) SliderOpt
func (SliderOptions) TrackImage ¶ added in v0.5.7
func (o SliderOptions) TrackImage(track *SliderTrackImage) SliderOpt
This sets the track images (not required).
func (SliderOptions) TrackOffset ¶
func (o SliderOptions) TrackOffset(i int) SliderOpt
func (SliderOptions) TrackPadding ¶
func (o SliderOptions) TrackPadding(i *Insets) SliderOpt
func (SliderOptions) WidgetOpts ¶
func (o SliderOptions) WidgetOpts(opts ...WidgetOpt) SliderOpt
type SliderPageSizeFunc ¶
type SliderPageSizeFunc func() int
type SliderParams ¶ added in v0.7.0
type SliderParams struct {
Orientation *Direction
TrackImage *SliderTrackImage
TrackPadding *Insets
MinHandleSize *int
FixedHandleSize *int
TrackOffset *int
HandleImage *ButtonImage
PageSizeFunc SliderPageSizeFunc
}
type SliderTrackImage ¶
type StackedLayout ¶ added in v0.2.4
type StackedLayout struct {
// contains filtered or unexported fields
}
StackedLayout lays out multiple widgets stacked on top of each other in the order they are added as children Each child will have the dimensions equal to the max size of all the StackedLayout's children
Note: Events will propogate to each layer. e.g. if you have overlapping buttons, a click event over both will trigger both events.
Widget.LayoutData of widgets being layed out by StackedLayout should be left empty.
func NewStackedLayout ¶ added in v0.2.4
func NewStackedLayout(opts ...StackedLayoutOpt) *StackedLayout
NewStackedLayout constructs a new StackedLayout, configured by opts.
func (*StackedLayout) Layout ¶ added in v0.2.4
func (a *StackedLayout) Layout(widgets []PreferredSizeLocateableWidget, rect image.Rectangle)
Layout implements Layouter.
func (*StackedLayout) PreferredSize ¶ added in v0.2.4
func (a *StackedLayout) PreferredSize(widgets []PreferredSizeLocateableWidget) (int, int)
PreferredSize implements Layouter.
type StackedLayoutData ¶ added in v0.2.4
type StackedLayoutData struct {
}
StackedLayoutData specifies layout settings for a widget.
type StackedLayoutOpt ¶ added in v0.2.4
type StackedLayoutOpt func(a *StackedLayout)
StackedLayoutOpt is a function that configures a.
type StackedLayoutOptions ¶ added in v0.2.4
type StackedLayoutOptions struct {
}
var StackedLayoutOpts StackedLayoutOptions
StackedLayoutOpts contains functions that configure an StackedLayout.
func (StackedLayoutOptions) Padding ¶ added in v0.2.4
func (o StackedLayoutOptions) Padding(i *Insets) StackedLayoutOpt
Padding configures an Stacked layout to use padding i.
type TabBook ¶
func NewTabBook ¶
func NewTabBook(opts ...TabBookOpt) *TabBook
func (*TabBook) GetDropTargets ¶ added in v0.4.3
func (*TabBook) GetTabButton ¶ added in v0.5.7
func (t *TabBook) GetTabButton(tab *TabBookTab) *Button
Return the button associated with the provided TabBookTab if not exists else nil.
func (*TabBook) PreferredSize ¶
func (*TabBook) RequestRelayout ¶
func (t *TabBook) RequestRelayout()
func (*TabBook) SetLocation ¶
func (*TabBook) SetTab ¶
func (t *TabBook) SetTab(tab *TabBookTab)
Set the current tab for the tab book.
Note: This method should only be called after the ui is running. To set the initial tab please use the TabBookOptions.InitialTab method during tabbook creation.
func (*TabBook) SetupInputLayer ¶
func (t *TabBook) SetupInputLayer(def input.DeferredSetupInputLayerFunc)
func (*TabBook) Update ¶ added in v0.6.0
func (t *TabBook) Update(updObj *UpdateObject)
type TabBookOpt ¶
type TabBookOpt func(t *TabBook)
type TabBookOptions ¶
type TabBookOptions struct {
}
var TabBookOpts TabBookOptions
func (TabBookOptions) ContainerOpts ¶
func (o TabBookOptions) ContainerOpts(opts ...ContainerOpt) TabBookOpt
func (TabBookOptions) ContentPadding ¶ added in v0.7.0
func (o TabBookOptions) ContentPadding(contentPadding *Insets) TabBookOpt
func (TabBookOptions) ContentSpacing ¶ added in v0.7.0
func (o TabBookOptions) ContentSpacing(s int) TabBookOpt
func (TabBookOptions) InitialTab ¶ added in v0.5.5
func (o TabBookOptions) InitialTab(tab *TabBookTab) TabBookOpt
func (TabBookOptions) TabButtonImage ¶
func (o TabBookOptions) TabButtonImage(buttonImages *ButtonImage) TabBookOpt
func (TabBookOptions) TabButtonMinSize ¶ added in v0.7.0
func (o TabBookOptions) TabButtonMinSize(minSize *image.Point) TabBookOpt
func (TabBookOptions) TabButtonSpacing ¶
func (o TabBookOptions) TabButtonSpacing(s int) TabBookOpt
func (TabBookOptions) TabButtonText ¶
func (o TabBookOptions) TabButtonText(face *text.Face, color *ButtonTextColor) TabBookOpt
func (TabBookOptions) TabButtonTextPadding ¶ added in v0.7.0
func (o TabBookOptions) TabButtonTextPadding(textPadding *Insets) TabBookOpt
func (TabBookOptions) TabSelectedHandler ¶
func (o TabBookOptions) TabSelectedHandler(f TabBookTabSelectedHandlerFunc) TabBookOpt
func (TabBookOptions) Tabs ¶
func (o TabBookOptions) Tabs(tabs ...*TabBookTab) TabBookOpt
type TabBookParams ¶ added in v0.7.0
type TabBookParams struct {
TabButton *ButtonParams
TabSpacing *int
ContentSpacing *int
ContentPadding *Insets
}
type TabBookTab ¶
func NewTabBookTab ¶
func NewTabBookTab(opts ...TabBookTabOpt) *TabBookTab
func (*TabBookTab) Validate ¶ added in v0.7.0
func (t *TabBookTab) Validate()
type TabBookTabOpt ¶ added in v0.7.2
type TabBookTabOpt func(o *TabBookTab)
type TabBookTabOptions ¶ added in v0.7.2
type TabBookTabOptions struct {
}
var TabBookTabOpts TabBookTabOptions
func (*TabBookTabOptions) ContainerOpts ¶ added in v0.7.2
func (o *TabBookTabOptions) ContainerOpts(opts ...ContainerOpt) TabBookTabOpt
func (*TabBookTabOptions) Image ¶ added in v0.7.2
func (o *TabBookTabOptions) Image(img *GraphicImage) TabBookTabOpt
func (*TabBookTabOptions) Label ¶ added in v0.7.2
func (o *TabBookTabOptions) Label(label string) TabBookTabOpt
type TabBookTabSelectedEventArgs ¶
type TabBookTabSelectedEventArgs struct {
TabBook *TabBook
Tab *TabBookTab
PreviousTab *TabBookTab
}
type TabBookTabSelectedHandlerFunc ¶
type TabBookTabSelectedHandlerFunc func(args *TabBookTabSelectedEventArgs)
type Text ¶
type Text struct {
Label string
MaxWidth float64
ProcessBBCode bool
StripBBCode bool
LinkClickedEvent *event.Event
LinkCursorEnteredEvent *event.Event
LinkCursorExitedEvent *event.Event
// contains filtered or unexported fields
}
func (*Text) PreferredSize ¶
func (*Text) SetLocation ¶
func (*Text) SetPadding ¶ added in v0.7.0
func (*Text) SetPosition ¶ added in v0.7.0
func (t *Text) SetPosition(position *TextPositioning)
func (*Text) Update ¶ added in v0.6.0
func (t *Text) Update(updObj *UpdateObject)
type TextArea ¶
type TextArea struct {
// contains filtered or unexported fields
}
func NewTextArea ¶
func NewTextArea(opts ...TextAreaOpt) *TextArea
func (*TextArea) AppendText ¶
func (*TextArea) GetFocusers ¶ added in v0.3.0
func (*TextArea) PreferredSize ¶
func (*TextArea) PrependText ¶
func (*TextArea) RequestRelayout ¶
func (l *TextArea) RequestRelayout()
func (*TextArea) SetLocation ¶
func (*TextArea) SetupInputLayer ¶
func (l *TextArea) SetupInputLayer(def input.DeferredSetupInputLayerFunc)
func (*TextArea) Update ¶ added in v0.6.0
func (l *TextArea) Update(updObj *UpdateObject)
type TextAreaEntrySelectedEventArgs ¶
type TextAreaEntrySelectedEventArgs struct {
TextArea *TextArea
Entry interface{}
PreviousEntry interface{}
}
type TextAreaEntrySelectedHandlerFunc ¶
type TextAreaEntrySelectedHandlerFunc func(args *TextAreaEntrySelectedEventArgs)
type TextAreaOpt ¶
type TextAreaOpt func(l *TextArea)
type TextAreaOptions ¶
type TextAreaOptions struct {
}
var TextAreaOpts TextAreaOptions
func (TextAreaOptions) ContainerOpts ¶
func (o TextAreaOptions) ContainerOpts(opts ...ContainerOpt) TextAreaOpt
Specify the Container options for the text area.
func (TextAreaOptions) ControlWidgetSpacing ¶
func (o TextAreaOptions) ControlWidgetSpacing(s int) TextAreaOpt
Specify spacing between the text container and scrollbars.
func (TextAreaOptions) FontColor ¶
func (o TextAreaOptions) FontColor(color color.Color) TextAreaOpt
Set the default color for the text area.
func (TextAreaOptions) FontFace ¶
func (o TextAreaOptions) FontFace(f *text.Face) TextAreaOpt
Set the font face for this text area.
func (TextAreaOptions) HorizontalScrollMode ¶ added in v0.2.7
func (o TextAreaOptions) HorizontalScrollMode(scrollMode ScrollMode) TextAreaOpt
Set how horizontal scrolling should be handled.
func (TextAreaOptions) LinkClickedEvent ¶ added in v0.7.0
func (o TextAreaOptions) LinkClickedEvent(linkClickedFunc LinkHandlerFunc) TextAreaOpt
Defines the handler to be called when a BBCode defined link is clicked.
Note: this is only used if ProcessBBCode is true.
func (TextAreaOptions) LinkColor ¶ added in v0.7.0
func (o TextAreaOptions) LinkColor(linkColor *TextLinkColor) TextAreaOpt
This option sets the idle and hover color for text that is wrapped in a [link][/link] bbcode.
Note: this is only used if ProcessBBCode is true.
func (TextAreaOptions) LinkCursorEnteredEvent ¶ added in v0.7.0
func (o TextAreaOptions) LinkCursorEnteredEvent(linkCursorEnteredFunc LinkHandlerFunc) TextAreaOpt
Defines the handler to be called when the cursor enters a BBCode defined link.
Note: this is only used if ProcessBBCode is true.
func (TextAreaOptions) LinkCursorExitedEvent ¶ added in v0.7.0
func (o TextAreaOptions) LinkCursorExitedEvent(linkCursorExitedFunc LinkHandlerFunc) TextAreaOpt
Defines the handler to be called when the cursor enters a BBCode defined link.
Note: this is only used if ProcessBBCode is true.
func (TextAreaOptions) ProcessBBCode ¶ added in v0.2.7
func (o TextAreaOptions) ProcessBBCode(processBBCode bool) TextAreaOpt
This option tells the textarea object to process BBCodes.
Currently the system supports the following BBCodes:
- color - [color=#FFFFFF] text [/color] - defines a color code for the enclosed text
- link - [link=id arg1:value1 ... argX:valueX] text [/link] - defines a clickable section of text, that will trigger a callback.
func (TextAreaOptions) ScrollContainerImage ¶ added in v0.7.0
func (o TextAreaOptions) ScrollContainerImage(image *ScrollContainerImage) TextAreaOpt
Specify the images for the scroll container.
func (TextAreaOptions) ScrollContainerPadding ¶ added in v0.7.0
func (o TextAreaOptions) ScrollContainerPadding(padding *Insets) TextAreaOpt
Specify the padding for the scroll container.
func (TextAreaOptions) ShowHorizontalScrollbar ¶ added in v0.2.7
func (o TextAreaOptions) ShowHorizontalScrollbar() TextAreaOpt
Show the horizontal scrollbar.
func (TextAreaOptions) ShowVerticalScrollbar ¶ added in v0.2.7
func (o TextAreaOptions) ShowVerticalScrollbar() TextAreaOpt
Show the vertical scrollbar.
func (TextAreaOptions) SliderParams ¶ added in v0.7.0
func (o TextAreaOptions) SliderParams(sliderParams *SliderParams) TextAreaOpt
Specify the options for the scroll bars.
func (TextAreaOptions) StripBBCode ¶ added in v0.7.0
func (o TextAreaOptions) StripBBCode(stripBBCode bool) TextAreaOpt
Set whether or not the text area should automatically strip out BBCodes from being displayed.
func (TextAreaOptions) Text ¶
func (o TextAreaOptions) Text(initialText string) TextAreaOpt
Set the initial Text for the text area.
func (TextAreaOptions) TextPadding ¶
func (o TextAreaOptions) TextPadding(i Insets) TextAreaOpt
Set how far from the edges of the textarea the text should be set.
func (TextAreaOptions) TextPosition ¶ added in v0.7.0
func (o TextAreaOptions) TextPosition(textPosition TextPositioning) TextAreaOpt
Set the positioning of the text within the text area
func (TextAreaOptions) VerticalScrollMode ¶ added in v0.2.7
func (o TextAreaOptions) VerticalScrollMode(scrollMode ScrollMode) TextAreaOpt
Set how vertical scrolling should be handled.
type TextAreaParams ¶ added in v0.7.0
type TextAreaParams struct {
Face *text.Face
ForegroundColor color.Color
TextPadding *Insets
TextPosition *TextPositioning
ControlWidgetSpacing *int
StripBBCode *bool
LinkColor *TextLinkColor
Slider *SliderParams
ScrollContainerImage *ScrollContainerImage
ScrollContainerPadding *Insets
}
type TextInput ¶
type TextInput struct {
ChangedEvent *event.Event
SubmitEvent *event.Event
// contains filtered or unexported fields
}
func NewTextInput ¶
func NewTextInput(opts ...TextInputOpt) *TextInput
func (*TextInput) AddFocus ¶ added in v0.5.7
func (t *TextInput) AddFocus(direction FocusDirection, focus Focuser)
func (*TextInput) CursorMoveEnd ¶ added in v0.5.4
func (t *TextInput) CursorMoveEnd()
func (*TextInput) CursorMoveLeft ¶ added in v0.5.4
func (t *TextInput) CursorMoveLeft()
func (*TextInput) CursorMoveRight ¶ added in v0.5.4
func (t *TextInput) CursorMoveRight()
func (*TextInput) CursorMoveStart ¶ added in v0.5.4
func (t *TextInput) CursorMoveStart()
func (*TextInput) DeleteSelectedText ¶ added in v0.6.2
func (t *TextInput) DeleteSelectedText()
func (*TextInput) DeselectText ¶ added in v0.6.2
func (t *TextInput) DeselectText()
func (*TextInput) GetFocus ¶ added in v0.5.7
func (t *TextInput) GetFocus(direction FocusDirection) Focuser
func (*TextInput) PreferredSize ¶
func (*TextInput) SelectedText ¶ added in v0.6.2
func (*TextInput) SetLocation ¶
func (*TextInput) Update ¶ added in v0.6.0
func (t *TextInput) Update(updObj *UpdateObject)
type TextInputChangedHandlerFunc ¶
type TextInputChangedHandlerFunc func(args *TextInputChangedEventArgs)
type TextInputColor ¶
type TextInputImage ¶
type TextInputOpt ¶
type TextInputOpt func(t *TextInput)
type TextInputOptions ¶
type TextInputOptions struct {
}
var TextInputOpts TextInputOptions
func (TextInputOptions) AllowDuplicateSubmit ¶ added in v0.2.1
func (o TextInputOptions) AllowDuplicateSubmit(allowDuplicateSubmit bool) TextInputOpt
func (TextInputOptions) CaretWidth ¶ added in v0.7.0
func (o TextInputOptions) CaretWidth(caretWidth int) TextInputOpt
func (TextInputOptions) ChangedHandler ¶
func (o TextInputOptions) ChangedHandler(f TextInputChangedHandlerFunc) TextInputOpt
func (TextInputOptions) ClearOnSubmit ¶ added in v0.2.1
func (o TextInputOptions) ClearOnSubmit(clearOnSubmit bool) TextInputOpt
func (TextInputOptions) Color ¶
func (o TextInputOptions) Color(c *TextInputColor) TextInputOpt
func (TextInputOptions) Face ¶
func (o TextInputOptions) Face(f *text.Face) TextInputOpt
func (TextInputOptions) IgnoreEmptySubmit ¶ added in v0.2.1
func (o TextInputOptions) IgnoreEmptySubmit(ignoreEmptySubmit bool) TextInputOpt
func (TextInputOptions) Image ¶
func (o TextInputOptions) Image(i *TextInputImage) TextInputOpt
func (TextInputOptions) MobileInputMode ¶ added in v0.5.5
func (o TextInputOptions) MobileInputMode(mobileInputMode mobile.InputMode) TextInputOpt
Sets the keyboard type to use when viewed on a mobile browser.
https://css-tricks.com/everything-you-ever-wanted-to-know-about-inputmode
func (TextInputOptions) Padding ¶
func (o TextInputOptions) Padding(i *Insets) TextInputOpt
func (TextInputOptions) Placeholder ¶
func (o TextInputOptions) Placeholder(s string) TextInputOpt
func (TextInputOptions) RepeatInterval ¶
func (o TextInputOptions) RepeatInterval(i time.Duration) TextInputOpt
func (TextInputOptions) ScrollSensitivity ¶ added in v0.6.2
func (o TextInputOptions) ScrollSensitivity(scrollSensitivity int) TextInputOpt
Sets how many pixels from the edge the cursor must be dragged prior to it scrolling in that direction.
Default: 15.
func (TextInputOptions) Secure ¶
func (o TextInputOptions) Secure(b bool) TextInputOpt
func (TextInputOptions) SubmitHandler ¶ added in v0.2.1
func (o TextInputOptions) SubmitHandler(f TextInputChangedHandlerFunc) TextInputOpt
func (TextInputOptions) SubmitOnEnter ¶ added in v0.6.1
func (o TextInputOptions) SubmitOnEnter(submitOnEnter bool) TextInputOpt
Sets if the input will submit when pressing enter or not.
func (TextInputOptions) TabOrder ¶ added in v0.3.0
func (o TextInputOptions) TabOrder(to int) TextInputOpt
func (TextInputOptions) Validation ¶
func (o TextInputOptions) Validation(f TextInputValidationFunc) TextInputOpt
func (TextInputOptions) WidgetOpts ¶
func (o TextInputOptions) WidgetOpts(opts ...WidgetOpt) TextInputOpt
type TextInputParams ¶ added in v0.7.0
type TextInputParams struct {
Image *TextInputImage
Color *TextInputColor
Padding *Insets
Face *text.Face
RepeatDelay *time.Duration
RepeatInterval *time.Duration
Secure *bool
ClearOnSubmit *bool
IgnoreEmptySubmit *bool
AllowDuplicateSubmit *bool
SubmitOnEnter *bool
ScrollSensitivity *int
CaretWidth *int
}
type TextInputValidationFunc ¶
type TextLinkColor ¶ added in v0.7.0
type TextOptions ¶
type TextOptions struct {
}
var TextOpts TextOptions
func (TextOptions) LinkClickedHandler ¶ added in v0.7.0
func (o TextOptions) LinkClickedHandler(f LinkHandlerFunc) TextOpt
Defines the handler to be called when a BBCode defined link is clicked.
Note: this is only used if ProcessBBCode is true.
func (TextOptions) LinkColor ¶ added in v0.7.0
func (o TextOptions) LinkColor(linkColor *TextLinkColor) TextOpt
This option sets the idle and hover color for text that is wrapped in a [link][/link] bbcode.
Note: this is only used if ProcessBBCode is true.
func (TextOptions) LinkCursorEnteredHandler ¶ added in v0.7.0
func (o TextOptions) LinkCursorEnteredHandler(f LinkHandlerFunc) TextOpt
Defines the handler to be called when the cursor enters a BBCode defined link.
Note: this is only used if ProcessBBCode is true.
func (TextOptions) LinkCursorExitedHandler ¶ added in v0.7.0
func (o TextOptions) LinkCursorExitedHandler(f LinkHandlerFunc) TextOpt
Defines the handler to be called when the cursor enters a BBCode defined link.
Note: this is only used if ProcessBBCode is true.
func (TextOptions) MaxWidth ¶ added in v0.5.4
func (o TextOptions) MaxWidth(maxWidth float64) TextOpt
MaxWidth sets the max width the text will allow before wrapping to the next line.
func (TextOptions) Padding ¶ added in v0.7.0
func (o TextOptions) Padding(padding *Insets) TextOpt
func (TextOptions) Position ¶
func (o TextOptions) Position(h TextPosition, v TextPosition) TextOpt
func (TextOptions) ProcessBBCode ¶ added in v0.2.7
func (o TextOptions) ProcessBBCode(processBBCode bool) TextOpt
This option tells the text object to process BBCodes.
Currently the system supports the following BBCodes:
- color - [color=#FFFFFF] text [/color] - defines a color code for the enclosed text
- link - [link=id arg1:value1 ... argX:valueX] text [/link] - defines a clickable section of text, that will trigger a callback.
func (TextOptions) StripBBCode ¶ added in v0.7.0
func (o TextOptions) StripBBCode(stripBBCode bool) TextOpt
Set whether or not the text area should automatically strip out BBCodes from being displayed.
func (TextOptions) Text ¶
Text combines three options: TextLabel, TextFace and TextColor. It can be used for the inline configurations of Text object while separate functions are useful for a multi-step configuration.
func (TextOptions) TextColor ¶ added in v0.5.6
func (o TextOptions) TextColor(color color.Color) TextOpt
func (TextOptions) TextFace ¶ added in v0.5.6
func (o TextOptions) TextFace(face *text.Face) TextOpt
func (TextOptions) TextLabel ¶ added in v0.5.6
func (o TextOptions) TextLabel(label string) TextOpt
func (TextOptions) WidgetOpts ¶
func (o TextOptions) WidgetOpts(opts ...WidgetOpt) TextOpt
type TextParams ¶ added in v0.7.0
type TextParams struct {
Face *text.Face
Color color.Color
Padding *Insets
LinkColor *TextLinkColor
Position *TextPositioning
}
type TextPosition ¶
type TextPosition int
type TextPositioning ¶ added in v0.7.0
type TextPositioning struct {
VTextPosition TextPosition
HTextPosition TextPosition
}
type Theme ¶ added in v0.7.0
type Theme struct {
DefaultFace *text.Face
DefaultTextColor color.Color
ButtonTheme *ButtonParams
PanelTheme *PanelParams
LabelTheme *LabelParams
TextTheme *TextParams
CheckboxTheme *CheckboxParams
ProgressBarTheme *ProgressBarParams
SliderTheme *SliderParams
TabbookTheme *TabBookParams
TabTheme *TabParams
TextInputTheme *TextInputParams
TextAreaTheme *TextAreaParams
ListTheme *ListParams
ListComboButtonTheme *ListComboButtonParams
}
type ToolTip ¶
type ToolTip struct {
Position ToolTipPosition
// WidgetOriginVertical was renamed to AnchorOriginVertical to make the it more generic and reuse it for TOOLTIP_POS_SCREEN
AnchorOriginVertical ToolTipAnchor
// WidgetOriginHorizontal was renamed to AnchorOriginHorizontal to make the it more generic and reuse it for TOOLTIP_POS_SCREEN
AnchorOriginHorizontal ToolTipAnchor
ContentOriginVertical ToolTipAnchor
ContentOriginHorizontal ToolTipAnchor
Delay time.Duration
Offset image.Point
KeepOnHover bool
ToolTipUpdater ToolTipUpdater
// contains filtered or unexported fields
}
func NewTextToolTip ¶
func NewTextToolTip(label string, face *text.Face, color color.Color, background *e_image.NineSlice) *ToolTip
Create a new Text Tooltip with the following defaults:
- ProcessBBCode = true
- Padding = Top/Bottom: 5px Left/Right: 10px
- Delay = 800ms
- Offset = 0, 20
- ContentOriginHorizontal = TOOLTIP_ANCHOR_END
- ContentOriginVertical = TOOLTIP_ANCHOR_START
func NewToolTip ¶
func NewToolTip(opts ...ToolTipOpt) *ToolTip
Create a new Tooltip. This method allows you to specify every aspect of the displayed tooltip's content.
type ToolTipAnchor ¶ added in v0.3.0
type ToolTipAnchor int
const ( // Anchor at the start of the element. TOOLTIP_ANCHOR_START ToolTipAnchor = iota // Anchor in the middle of the element. TOOLTIP_ANCHOR_MIDDLE // Anchor at the end of the element. TOOLTIP_ANCHOR_END )
type ToolTipDirection ¶ added in v0.3.0
type ToolTipDirection int
type ToolTipOpt ¶
type ToolTipOpt func(t *ToolTip)
type ToolTipOptions ¶
type ToolTipOptions struct {
}
var ToolTipOpts ToolTipOptions
func (ToolTipOptions) AnchorOriginHorizontal ¶ added in v0.6.1
func (o ToolTipOptions) AnchorOriginHorizontal(anchorOriginHorizontal ToolTipAnchor) ToolTipOpt
The horizontal position of the anchor on the widget. Only used when Postion = WIDGET.
func (ToolTipOptions) AnchorOriginVertical ¶ added in v0.6.1
func (o ToolTipOptions) AnchorOriginVertical(anchorOriginVertical ToolTipAnchor) ToolTipOpt
The vertical position of the anchor on the widget. Only used when Postion = WIDGET.
func (ToolTipOptions) Content ¶ added in v0.3.0
func (o ToolTipOptions) Content(c Containerer) ToolTipOpt
The container to be displayed.
func (ToolTipOptions) ContentOriginHorizontal ¶ added in v0.3.0
func (o ToolTipOptions) ContentOriginHorizontal(contentOriginHorizontal ToolTipAnchor) ToolTipOpt
The horizontal position of the anchor on the tooltip.
func (ToolTipOptions) ContentOriginVertical ¶ added in v0.3.0
func (o ToolTipOptions) ContentOriginVertical(contentOriginVertical ToolTipAnchor) ToolTipOpt
The vertical position of the anchor on the tooltip.
func (ToolTipOptions) Delay ¶
func (o ToolTipOptions) Delay(d time.Duration) ToolTipOpt
How long to wait before displaying the tooltip.
func (ToolTipOptions) KeepOnHover ¶ added in v0.7.2
func (o ToolTipOptions) KeepOnHover(b bool) ToolTipOpt
KeepOnHover will make it so if the user cursor is on the ToolTip it'll not be hidden as it does by default
func (ToolTipOptions) Offset ¶
func (o ToolTipOptions) Offset(off image.Point) ToolTipOpt
The X/Y offsets from the Tooltip anchor point.
func (ToolTipOptions) Position ¶ added in v0.3.0
func (o ToolTipOptions) Position(position ToolTipPosition) ToolTipOpt
Where to display the tooltip.
func (ToolTipOptions) ToolTipUpdater ¶ added in v0.3.0
func (o ToolTipOptions) ToolTipUpdater(toolTipUpdater ToolTipUpdater) ToolTipOpt
A method that is called every draw call that the tooltip is visible. This allows you to hook into the draw loop to update the tooltip if necessary.
type ToolTipPosition ¶ added in v0.3.0
type ToolTipPosition int
const ( // The tooltip will follow the cursor around while visible. TOOLTIP_POS_CURSOR_FOLLOW ToolTipPosition = iota // The tooltip will stick to where the cursor was when the tooltip was made visible. TOOLTIP_POS_CURSOR_STICKY // The tooltip will display based on the Widget and Content anchor settings. // It defaults to opening right aligned and directly under the widget. TOOLTIP_POS_WIDGET // The tooltip will display based on x/y (offset is required) TOOLTIP_POS_ABSOLUTE // The tooltip will display based on the Widget and Content anchor settings. // It defaults to opening right aligned and directly under the x: 0, y: 0. TOOLTIP_POS_SCREEN )
type ToolTipUpdater ¶ added in v0.3.0
type ToolTipUpdater func(Containerer)
type UpdateFunc ¶ added in v0.7.0
type UpdateFunc func(w HasWidget)
type UpdateObject ¶ added in v0.7.0
type Updater ¶ added in v0.6.0
type Updater interface {
// Update updates the widget state based on input.
Update(updObj *UpdateObject)
}
Updater may be implemented by concrete widget types that should be updated.
type Visibility ¶ added in v0.5.5
type Visibility int
const ( Visibility_Show Visibility = iota Visibility_Hide_Blocking // Hide widget, but take up space Visibility_Hide // Hide widget, but don't take up space )
type Widget ¶
type Widget struct {
// Rect specifies the widget's position on screen. It is usually not set directly, but a Layouter is
// used to set the position in relation to other widgets or the space available.
Rect image.Rectangle
// LayoutData specifies additional optional data for a Layouter that is used to layout this widget's
// parent container. The exact type depends on the layout being used, for example, GridLayout requires
// GridLayoutData to be used.
LayoutData interface{}
// The minimum width for this Widget
MinWidth int
// The minimum height for this Widget
MinHeight int
// Disabled specifies whether the widget is disabled, whatever that means. Disabled widgets should
// usually render in some sort of "greyed out" visual state, and not react to user input.
//
// Not reacting to user input depends on the actual implementation. For example, List will not allow
// entry selection via clicking, but the scrollbars will still be usable. The reasoning is that from
// the user's perspective, scrolling does not change state, but only the display of that state.
Disabled bool
// CursorEnterEvent fires an event with *WidgetCursorEnterEventArgs when the cursor enters the widget's Rect.
CursorEnterEvent *event.Event
// CursorMoveEvent fires an event with *WidgetCursorMoveEventArgs when the cursor moves within the widget's Rect.
CursorMoveEvent *event.Event
// CursorExitEvent fires an event with *WidgetCursorExitEventArgs when the cursor exits the widget's Rect.
CursorExitEvent *event.Event
// MouseButtonPressedEvent fires an event with *WidgetMouseButtonPressedEventArgs when a mouse button is pressed
// while the cursor is inside the widget's Rect.
MouseButtonPressedEvent *event.Event
// MouseButtonPressedEvent fires an event with *WidgetMouseButtonPressedEventArgs when a mouse button is pressed
// while the cursor is inside the widget's Rect.
MouseButtonLongPressedEvent *event.Event
// MouseButtonReleasedEvent fires an event with *WidgetMouseButtonReleasedEventArgs when a mouse button is released
// while the cursor is inside the widget's Rect.
MouseButtonReleasedEvent *event.Event
// MouseButtonClickedEvent fires an event with *WidgetMouseButtonClickedEventArgs when a mouse button is pressed and released
// while the cursor is inside the widget's Rect.
MouseButtonClickedEvent *event.Event
// ScrolledEvent fires an event with *WidgetScrolledEventArgs when the mouse wheel is scrolled while
// the cursor is inside the widget's Rect.
ScrolledEvent *event.Event
FocusEvent *event.Event
ContextMenuEvent *event.Event
ToolTipEvent *event.Event
DragAndDropEvent *event.Event
OnUpdate UpdateFunc
// Custom Data is a field to allow users to attach data to any widget
CustomData any
// This allows for non-focusable widgets (Containers) to report hover.
TrackHover bool
// This determines if the widget should use it's own layer.
// The new layer will be added in the order that the widget is added to the render tree.
// This means the last widiget added where this value is true will have the highest input layer.
ElevateLayer bool
ContextMenu *Container
ContextMenuWindow *Window
ContextMenuCloseMode WindowCloseMode
ToolTips []*ToolTip
DragAndDrop *DragAndDrop
CursorHovered string
CursorPressed string
// contains filtered or unexported fields
}
A Widget is an abstraction of a user interface widget, such as a button. Actual widget implementations "have" a Widget in their internal structure.
func (*Widget) EffectiveInputLayer ¶
EffectiveInputLayer returns w's effective input layer. If w does not have an input layer, or if the input layer is no longer valid, it returns w's parent widget's effective input layer. If w does not have a parent widget, it returns input.DefaultLayer.
func (*Widget) ElevateToNewInputLayer ¶
ElevateToNewInputLayer adds l to the top of the input layer stack, then sets w's input layer to l.
func (*Widget) FireContextMenuEvent ¶ added in v0.2.10
func (*Widget) FireDragAndDropEvent ¶ added in v0.4.0
func (widget *Widget) FireDragAndDropEvent(w *Window, show bool, dnd *DragAndDrop)
func (*Widget) FireFocusEvent ¶ added in v0.3.0
func (*Widget) FireToolTipEvent ¶ added in v0.3.0
func (*Widget) GetVisibility ¶ added in v0.7.3
func (w *Widget) GetVisibility() Visibility
GetVisibility changes the visibility of the Widget
func (*Widget) In ¶ added in v0.6.1
In checks if the x and y are inside of the widget even if they have a mask.
func (*Widget) IsVisible ¶ added in v0.6.1
IsVisible will check if this particular widget is visible by checking Visibility of it and all the parents it has, as if one of the parents is not visible this widget will not be visible even if it has Visibility_Show.
func (*Widget) SetLocation ¶
SetLocation sets w's position to rect. This is usually not called directly, but by a layout.
func (*Widget) SetVisibility ¶ added in v0.7.3
func (w *Widget) SetVisibility(v Visibility)
SetVisibility changes the visibility of the Widget
func (*Widget) Update ¶ added in v0.6.0
func (w *Widget) Update(updObj *UpdateObject)
type WidgetContextMenuEventArgs ¶ added in v0.2.10
type WidgetCursorEnterEventArgs ¶
type WidgetCursorEnterEventArgs struct {
Widget *Widget
// OffsetX is the x offset relative to the widget's Rect.
OffsetX int
// OffsetY is the y offset relative to the widget's Rect.
OffsetY int
}
WidgetCursorEnterEventArgs are the arguments for cursor enter events.
type WidgetCursorEnterHandlerFunc ¶
type WidgetCursorEnterHandlerFunc func(args *WidgetCursorEnterEventArgs) //nolint:golint
WidgetCursorEnterHandlerFunc is a function that handles cursor enter events.
type WidgetCursorExitEventArgs ¶
type WidgetCursorExitEventArgs struct {
Widget *Widget
// OffsetX is the x offset relative to the widget's Rect.
OffsetX int
// OffsetY is the y offset relative to the widget's Rect.
OffsetY int
}
WidgetCursorExitEventArgs are the arguments for cursor exit events.
type WidgetCursorExitHandlerFunc ¶
type WidgetCursorExitHandlerFunc func(args *WidgetCursorExitEventArgs) //nolint:golint
WidgetCursorExitHandlerFunc is a function that handles cursor exit events.
type WidgetCursorMoveEventArgs ¶ added in v0.5.7
type WidgetCursorMoveEventArgs struct {
Widget *Widget
// OffsetX is the x offset relative to the widget's Rect.
OffsetX int
// OffsetY is the y offset relative to the widget's Rect.
OffsetY int
// DiffX is the x change to the old mouse cursor position.
DiffX int
// DiffY is the y change to the old mouse cursor position.
DiffY int
}
WidgetCursorMoveEventArgs are the arguments for cursor move events.
type WidgetCursorMoveHandlerFunc ¶ added in v0.5.7
type WidgetCursorMoveHandlerFunc func(args *WidgetCursorMoveEventArgs) //nolint:golint
WidgetCursorMoveHandlerFunc is a function that handles cursor move events.
type WidgetDragAndDropEventArgs ¶ added in v0.4.0
type WidgetDragAndDropEventArgs struct {
Window *Window
Show bool
DnD *DragAndDrop
}
type WidgetFocusEventArgs ¶
type WidgetMouseButtonClickedEventArgs ¶ added in v0.7.0
type WidgetMouseButtonClickedEventArgs struct {
Widget *Widget
Button ebiten.MouseButton
// OffsetX is the x offset relative to the widget's Rect.
OffsetX int
// OffsetY is the y offset relative to the widget's Rect.
OffsetY int
}
WidgetMouseButtonClickedEventArgs are the arguments for mouse button press events.
type WidgetMouseButtonClickedHandlerFunc ¶ added in v0.7.0
type WidgetMouseButtonClickedHandlerFunc func(args *WidgetMouseButtonClickedEventArgs) //nolint:golint
WidgetMouseButtonClickedHandlerFunc is a function that handles mouse button click events.
type WidgetMouseButtonLongPressedEventArgs ¶ added in v0.7.0
type WidgetMouseButtonLongPressedEventArgs struct {
Widget *Widget
Button ebiten.MouseButton
// OffsetX is the x offset relative to the widget's Rect.
OffsetX int
// OffsetY is the y offset relative to the widget's Rect.
OffsetY int
}
WidgetMouseButtonPressedEventArgs are the arguments for mouse button press events.
type WidgetMouseButtonLongPressedHandlerFunc ¶ added in v0.7.0
type WidgetMouseButtonLongPressedHandlerFunc func(args *WidgetMouseButtonLongPressedEventArgs) //nolint:golint
WidgetMouseButtonLongPressedHandlerFunc is a function that handles mouse button long press events (500ms).
type WidgetMouseButtonPressedEventArgs ¶
type WidgetMouseButtonPressedEventArgs struct {
Widget *Widget
Button ebiten.MouseButton
// OffsetX is the x offset relative to the widget's Rect.
OffsetX int
// OffsetY is the y offset relative to the widget's Rect.
OffsetY int
}
WidgetMouseButtonPressedEventArgs are the arguments for mouse button press events.
type WidgetMouseButtonPressedHandlerFunc ¶
type WidgetMouseButtonPressedHandlerFunc func(args *WidgetMouseButtonPressedEventArgs) //nolint:golint
WidgetMouseButtonPressedHandlerFunc is a function that handles mouse button press events.
type WidgetMouseButtonReleasedEventArgs ¶
type WidgetMouseButtonReleasedEventArgs struct {
Widget *Widget
Button ebiten.MouseButton
// Inside specifies whether the button has been released inside the widget's Rect.
Inside bool
// OffsetX is the x offset relative to the widget's Rect.
OffsetX int
// OffsetY is the y offset relative to the widget's Rect.
OffsetY int
}
WidgetMouseButtonReleasedEventArgs are the arguments for mouse button release events.
type WidgetMouseButtonReleasedHandlerFunc ¶
type WidgetMouseButtonReleasedHandlerFunc func(args *WidgetMouseButtonReleasedEventArgs) //nolint:golint
WidgetMouseButtonReleasedHandlerFunc is a function that handles mouse button release events.
type WidgetOpt ¶
type WidgetOpt func(w *Widget) //nolint:golint
WidgetOpt is a function that configures w.
type WidgetOptions ¶
type WidgetOptions struct {
}
var WidgetOpts WidgetOptions
WidgetOpts contains functions that configure a Widget.
func (WidgetOptions) CanDrop ¶ added in v0.4.0
func (o WidgetOptions) CanDrop(candropFunc CanDropFunc) WidgetOpt
This sets the widget as a target of a Drag and Drop action
The Drop function must return true if it accepts this drop and false if it does not accept the drop.
func (WidgetOptions) ContextMenu ¶ added in v0.2.10
func (o WidgetOptions) ContextMenu(contextMenu *Container) WidgetOpt
func (WidgetOptions) ContextMenuCloseMode ¶ added in v0.2.10
func (o WidgetOptions) ContextMenuCloseMode(contextMenuCloseMode WindowCloseMode) WidgetOpt
func (WidgetOptions) CursorEnterHandler ¶
func (o WidgetOptions) CursorEnterHandler(f WidgetCursorEnterHandlerFunc) WidgetOpt
CursorEnterHandler configures a Widget with cursor enter event handler f.
func (WidgetOptions) CursorExitHandler ¶
func (o WidgetOptions) CursorExitHandler(f WidgetCursorExitHandlerFunc) WidgetOpt
CursorExitHandler configures a Widget with cursor exit event handler f.
func (WidgetOptions) CursorHovered ¶ added in v0.5.0
func (o WidgetOptions) CursorHovered(cursorHovered string) WidgetOpt
func (WidgetOptions) CursorMoveHandler ¶ added in v0.5.7
func (o WidgetOptions) CursorMoveHandler(f WidgetCursorMoveHandlerFunc) WidgetOpt
CursorMoveHandler configures a Widget with cursor move event handler f.
func (WidgetOptions) CursorPressed ¶ added in v0.5.0
func (o WidgetOptions) CursorPressed(cursorPressed string) WidgetOpt
func (WidgetOptions) CustomData ¶
func (o WidgetOptions) CustomData(cd any) WidgetOpt
CustomData configures a Widget with custom data cd.
func (WidgetOptions) Dropped ¶ added in v0.4.0
func (o WidgetOptions) Dropped(dropFunc DropFunc) WidgetOpt
This is the function that is run if an item is dropped on this widget.
func (WidgetOptions) ElevateLayer ¶ added in v0.7.0
func (o WidgetOptions) ElevateLayer(elevate bool) WidgetOpt
This tells the system to create a new input layer for this focusable widget. The new layer will be added in the order that the widget is added to the render tree. This means the last widiget added where this value is true will have the highest input layer.
func (WidgetOptions) EnableDragAndDrop ¶ added in v0.4.0
func (o WidgetOptions) EnableDragAndDrop(d *DragAndDrop) WidgetOpt
This sets the source of a Drag and Drop action.
func (WidgetOptions) LayoutData ¶
func (o WidgetOptions) LayoutData(ld interface{}) WidgetOpt
LayoutData configures a Widget with layout data ld.
func (WidgetOptions) LongPressDuration ¶ added in v0.7.0
func (o WidgetOptions) LongPressDuration(seconds float64) WidgetOpt
This specifies how long in seconds a Long Press is. Must be greater than 0.
func (WidgetOptions) MinSize ¶
func (o WidgetOptions) MinSize(minWidth int, minHeight int) WidgetOpt
func (WidgetOptions) MouseButtonClickedHandler ¶ added in v0.7.0
func (o WidgetOptions) MouseButtonClickedHandler(f WidgetMouseButtonClickedHandlerFunc) WidgetOpt
MouseButtonClickedHandler configures a Widget with mouse button release event handler f.
func (WidgetOptions) MouseButtonLongPressedHandler ¶ added in v0.7.0
func (o WidgetOptions) MouseButtonLongPressedHandler(f WidgetMouseButtonLongPressedHandlerFunc) WidgetOpt
MouseButtonLongPressedHandler configures a Widget with mouse button long press event handler f. Triggered after holding down left or right mouse button 500ms.
func (WidgetOptions) MouseButtonPressedHandler ¶
func (o WidgetOptions) MouseButtonPressedHandler(f WidgetMouseButtonPressedHandlerFunc) WidgetOpt
MouseButtonPressedHandler configures a Widget with mouse button press event handler f.
func (WidgetOptions) MouseButtonReleasedHandler ¶
func (o WidgetOptions) MouseButtonReleasedHandler(f WidgetMouseButtonReleasedHandlerFunc) WidgetOpt
MouseButtonReleasedHandler configures a Widget with mouse button release event handler f.
func (WidgetOptions) OnUpdate ¶ added in v0.7.0
func (o WidgetOptions) OnUpdate(updateFunc UpdateFunc) WidgetOpt
This specifies a function to be called each update loop for this widget.
func (WidgetOptions) ScrolledHandler ¶
func (o WidgetOptions) ScrolledHandler(f WidgetScrolledHandlerFunc) WidgetOpt
ScrolledHandler configures a Widget with mouse wheel scroll event handler f.
func (WidgetOptions) ToolTip ¶ added in v0.3.0
func (o WidgetOptions) ToolTip(toolTips ...*ToolTip) WidgetOpt
func (WidgetOptions) TrackHover ¶ added in v0.5.8
func (o WidgetOptions) TrackHover(trackHover bool) WidgetOpt
This allows for non-focusable widgets (Containers) to report hover.
type WidgetScrolledEventArgs ¶
WidgetScrolledEventArgs are the arguments for mouse wheel scroll events.
type WidgetScrolledHandlerFunc ¶
type WidgetScrolledHandlerFunc func(args *WidgetScrolledEventArgs) //nolint:golint
WidgetScrolledHandlerFunc is a function that handles mouse wheel scroll events.
type WidgetState ¶
type WidgetState int
func (WidgetState) Advance ¶
func (s WidgetState) Advance(triState bool) WidgetState
type WidgetToolTipEventArgs ¶ added in v0.3.0
type Window ¶
type Window struct {
ResizeEvent *event.Event
MoveEvent *event.Event
ClosedEvent *event.Event
Modal bool
Contents Containerer
TitleBar Containerer
Draggable bool
Resizeable bool
MinSize *image.Point
MaxSize *image.Point
Dynamic bool
DrawLayer int
// Used to indicate this window should close if other windows close.
Ephemeral bool
// INTERNAL USE ONLY: Used to indicate that this window is the currently focused window.
FocusedWindow bool
// Sets whether the window should move to the top of the draw order when clicked
// Default: false.
DisableRelayering bool
// contains filtered or unexported fields
}
func (*Window) GetCloseFunction ¶ added in v0.5.6
func (w *Window) GetCloseFunction() RemoveWindowFunc
Typically used internally.
func (*Window) GetContainer ¶ added in v0.2.10
func (w *Window) GetContainer() Containerer
Typically used internally.
Returns the root container that holds the provided titlebar and contents.
func (*Window) SetCloseFunction ¶
func (w *Window) SetCloseFunction(removeWindowFunc RemoveWindowFunc)
Typically used internally.
func (*Window) SetLocation ¶
This method will set the size and location of this window. This method will account for specified MinSize and MaxSize values.
func (*Window) SetupInputLayer ¶
func (w *Window) SetupInputLayer(def input.DeferredSetupInputLayerFunc)
Typically used internally.
func (*Window) Update ¶ added in v0.6.0
func (w *Window) Update(updObj *UpdateObject)
type WindowChangedEventArgs ¶ added in v0.2.3
type WindowChangedHandlerFunc ¶ added in v0.2.3
type WindowChangedHandlerFunc func(args *WindowChangedEventArgs)
type WindowCloseMode ¶ added in v0.2.10
type WindowCloseMode int
const ( // The window will not automatically close. NONE WindowCloseMode = iota // The window will close when you click anywhere. CLICK // The window will close when you click outside the window. CLICK_OUT )
type WindowClosedEventArgs ¶ added in v0.5.7
type WindowClosedEventArgs struct {
Window *Window
}
type WindowClosedHandlerFunc ¶ added in v0.5.7
type WindowClosedHandlerFunc func(args *WindowClosedEventArgs)
type WindowOptions ¶
type WindowOptions struct {
}
var WindowOpts WindowOptions
func (WindowOptions) BlockLower ¶ added in v0.6.1
func (o WindowOptions) BlockLower(blockLower bool) WindowOpt
Sets whether the window should block input beneath the window or not. Default: true.
func (WindowOptions) CloseMode ¶ added in v0.2.10
func (o WindowOptions) CloseMode(mode WindowCloseMode) WindowOpt
Set the way this window should close.
func (WindowOptions) ClosedHandler ¶ added in v0.5.7
func (o WindowOptions) ClosedHandler(f WindowClosedHandlerFunc) WindowOpt
This handler is triggered when window is closed. The window can be closed by either calling Window.Close or by invoking an [UI.AddWindow] returned close function.
This handler is called after the window is closed. The provided Window object is still accessible, but the window is already removed from UI.
func (WindowOptions) Contents ¶
func (o WindowOptions) Contents(c Containerer) WindowOpt
This is the container with the body of this window.
func (WindowOptions) DisableRelayering ¶ added in v0.6.1
func (o WindowOptions) DisableRelayering(disableRelayering bool) WindowOpt
Sets whether the window should move to the top of the draw order when clicked Default: false.
func (WindowOptions) Draggable ¶ added in v0.2.3
func (o WindowOptions) Draggable() WindowOpt
Sets the window to be draggable. The handle for this is the titleBar. If you haven't provided a titleBar this option is ignored.
func (WindowOptions) DrawLayer ¶ added in v0.3.2
func (o WindowOptions) DrawLayer(layer int) WindowOpt
This option sets order the window will be drawn
- < 0 will have the window drawn before the container
- >= 0 will have the window drawn after the container
func (WindowOptions) Dynamic ¶ added in v0.7.3
func (o WindowOptions) Dynamic() WindowOpt
Dynamic will check to change the default size of the Window if the content sizes goes over or below the current one Will not work with Resizeable
func (WindowOptions) Location ¶ added in v0.2.7
func (o WindowOptions) Location(rect image.Rectangle) WindowOpt
This option sets the size and location of the window. This method will account for specified MinSize and MaxSize values.
func (WindowOptions) MaxSize ¶ added in v0.2.3
func (o WindowOptions) MaxSize(width int, height int) WindowOpt
Set the maximum size that the window can be resized to.
func (WindowOptions) MinSize ¶ added in v0.2.3
func (o WindowOptions) MinSize(width int, height int) WindowOpt
Sets the minimum size that the window can be reszied to.
func (WindowOptions) Modal ¶
func (o WindowOptions) Modal() WindowOpt
Sets the window to be modal. Blocking UI interactions on anything else.
func (WindowOptions) MoveHandler ¶ added in v0.2.3
func (o WindowOptions) MoveHandler(f WindowChangedHandlerFunc) WindowOpt
This handler is triggered when a move event is completed.
func (WindowOptions) ResizeHandler ¶ added in v0.2.3
func (o WindowOptions) ResizeHandler(f WindowChangedHandlerFunc) WindowOpt
This handler is triggered when a resize event is completed.
func (WindowOptions) Resizeable ¶ added in v0.2.3
func (o WindowOptions) Resizeable() WindowOpt
Sets the window to be resizeable.
func (WindowOptions) TitleBar ¶ added in v0.2.3
func (o WindowOptions) TitleBar(tb Containerer, height int) WindowOpt
Sets the container for the TitleBar and its fixed height.
Source Files
¶
- anchorlayout.go
- button.go
- caret.go
- checkbox.go
- combobutton.go
- container.go
- dnd.go
- doc.go
- flipbook.go
- graphic.go
- gridlayout.go
- label.go
- layout.go
- list.go
- listcombobutton.go
- multionce.go
- panel.go
- progressbar.go
- radiogroup.go
- rowlayout.go
- scrollcontainer.go
- selectcombobutton.go
- slider.go
- stackedlayout.go
- tabbook.go
- tabbooktab.go
- text.go
- textarea.go
- textinput.go
- theme.go
- tooltip.go
- widget.go
- window.go