Documentation ¶
Index ¶
- func NewFileWindow(f *File, ms DialogStyle, onClose func(err error, clicked int), ...)
- func NewWindow(w layout.Widget, onClose func(error), options ...app.Option) *app.Window
- type Anim
- type Background
- type Bar
- type BarElement
- type BarIcon
- type BarNode
- type BarNodeKind
- type BarStyle
- type Button
- type ButtonBool
- type ButtonStyle
- type ButtonText
- type ButtonTextStyle
- type Buttons
- type ButtonsBool
- func (b *ButtonsBool) Clicked() int
- func (b *ButtonsBool) ClickedN(n int) int
- func (b *ButtonsBool) Hovered() int
- func (b *ButtonsBool) Layout(gtx layout.Context, l Widgets, el layout.ListElement) layout.Dimensions
- func (b *ButtonsBool) Resize(n int, style ButtonStyle)
- func (b *ButtonsBool) Select(idx int)
- func (b *ButtonsBool) Selected() int
- func (b *ButtonsBool) Unselect(idx int)
- type CheckBoxState
- type Checkbox
- type CheckboxStyle
- type CheckboxTri
- type ColorEditor
- type ColorEditorStyle
- type Dialog
- type DialogButtonType
- type DialogStyle
- type Enum
- type Error
- type ErrorStyle
- type File
- type FileStyle
- type Grid
- type Icon
- type IconStyle
- type Input
- type InputInt
- type InputIntOnSubmit
- type InputIntStyle
- type InputOnSubmit
- type InputRangeInt
- type InputStyle
- type InputText
- type InputTextStyle
- type Menu
- type MenuElement
- type MenuNode
- type MenuStyle
- type Modal
- type ModalStyle
- type Palette
- type Pan
- type Popup
- type Resize
- type ResizeCorner
- type ResizeCorner2
- type ResizeCornerStyle
- type ResizeCorners
- type ResizeStyle
- type Select
- type SelectStyle
- type Slider
- type SliderStyle
- type Style
- type Tab
- func (t *Tab) Close(idx int)
- func (t *Tab) Closed() int
- func (t *Tab) Layout(gtx layout.Context, n int, tab, content layout.ListElement) layout.Dimensions
- func (t *Tab) Pin(idx int)
- func (t *Tab) Pinned(idx int) bool
- func (t *Tab) Select(idx int)
- func (t *Tab) Selected() int
- func (t *Tab) Unpin(idx int)
- type TabStyle
- type TabText
- type TabTextStyle
- type Text
- type Theme
- type ThemeStyle
- type Tooltip
- type TooltipStyle
- type Tree
- func (t *Tree) Add(parent, id int)
- func (t *Tree) AddParent(id int)
- func (t *Tree) CanMoveDown(id int) bool
- func (t *Tree) CanMoveUp(id int) bool
- func (b *Tree) Changed() bool
- func (t *Tree) Del(id int)
- func (t *Tree) Layout(gtx layout.Context, el TreeElement, onOpenClose func(*TreeNode)) layout.Dimensions
- func (t *Tree) MoveDown(id int)
- func (t *Tree) MoveUp(id int)
- func (t *Tree) Select(node *TreeNode)
- func (t *Tree) Selected() *TreeNode
- func (t *Tree) Unselect()
- func (t *Tree) Walk(fn func(level int, node *TreeNode) (stop bool))
- type TreeElement
- type TreeNode
- type TreeStyle
- type TreeSubStyle
- type TreeText
- type Widgets
- type Wrap
- type WrapScroll
- type WrapStyle
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewFileWindow ¶
func NewFileWindow(f *File, ms DialogStyle, onClose func(err error, clicked int), options ...app.Option)
NewFileWindow creates a new window for the File f with the applied modal.
The onClose callback gets one of the following values for clicked:
- -1: the window was destroyed
- 0: button1 was clicked
- 1: button2 was clicked
Types ¶
type Anim ¶
type Anim struct { // Next defines the next value and how to long it takes to get to it. Next func(float32) (float32, time.Duration) // contains filtered or unexported fields }
Anim provides frame refreshes for value transitions.
func (*Anim) Animate ¶
Animate moves the animation forward if possible and returns whether the animation is complete.
type Background ¶
func UniformBackground ¶
func UniformBackground(c color.NRGBA, radius unit.Value) Background
func (Background) Layout ¶
func (b Background) Layout(gtx layout.Context) layout.Dimensions
func (Background) LayoutWidget ¶
func (b Background) LayoutWidget(gtx layout.Context, w layout.Widget) layout.Dimensions
type Bar ¶
type Bar struct { BarStyle Position layout.Direction Bar []BarNode // contains filtered or unexported fields }
Bar provides a way to organize widgets for menu actions. The widgets are usually icons, text or a mix of both.
func (*Bar) Layout ¶
func (b *Bar) Layout(gtx layout.Context, el BarElement, onClick func(*BarNode)) layout.Dimensions
type BarElement ¶
type BarElement func(layout.Context, *BarNode) layout.Dimensions
type BarIcon ¶
type BarIcon struct { Bar Icons []Icon // default icon Clicked []Icon // icon when BarBool is true or BarPopup has Popup }
BarIcon is a Bar with icons only. The BarNode ids must match their index in the Icons slice.
type BarNode ¶
type BarNode struct { Kind BarNodeKind ID int // Disabled disables clicking on the node. Disabled bool // Hidden hides the node. Its main purpose is to be able to filter // the content from another Tree's nodes. Hidden bool // State is the node's state for kind Stateful and the open/close // state for Popup. State bool // BarPopup defines the position of the popup widget relative to // the clicked area. Pos Popup // Popup is the widget to be displayed as a popup. // Its constraints are the same as the bar it belongs to. Popup layout.Widget }
BarNode is a bar item.
type BarNodeKind ¶
type BarNodeKind uint8
BarNodeKind defines the kind of node: stateless, stateful or popup
const ( BarStateless BarNodeKind = iota // no state associated with the node BarBool // the node has a boolean state BarPopup // the node pops up a widget )
type BarStyle ¶
type BarStyle struct { Inset layout.Inset Background Background Bar ButtonStyle Alignment layout.Alignment }
BarStyle defines the stylistic elements of a Bar.
type Button ¶
type Button struct { ButtonStyle // contains filtered or unexported fields }
Button is a clickable area.
type ButtonBool ¶
ButtonBool is a Button with a boolean state. The state is toggled by clicking on the button.
func (*ButtonBool) Layout ¶
func (b *ButtonBool) Layout(gtx layout.Context, w layout.Widget) layout.Dimensions
type ButtonStyle ¶
type ButtonStyle struct { Inset layout.Inset Default Background Hover Background Click Background Disabled Background Start Icon End Icon // PressDelay make constant presses spaced out by a certain delay. PressDelay time.Duration }
ButtonStyle defines the stylistic elements of a Button.
type ButtonText ¶
type ButtonText struct { ButtonTextStyle Button }
ButtonText is a Button displaying text.
func (*ButtonText) Layout ¶
func (b *ButtonText) Layout(gtx layout.Context, txt string) layout.Dimensions
type ButtonTextStyle ¶
ButtonTextStyle defines the stylistic elements of a ButtonText.
type Buttons ¶
type Buttons []Button
Buttons is a slice of Buttons that can be resized with a given style.
func (*Buttons) Resize ¶
func (b *Buttons) Resize(n int, style ButtonStyle)
Resize resizes the slice and applies the style to all buttons.
type ButtonsBool ¶
type ButtonsBool struct { // Single only keeps the last clicked button with a true state. Single bool Buttons []ButtonBool }
ButtonsBool holds a slice of ButtonBools that can be laid out according to a Widgets.
func (*ButtonsBool) Clicked ¶
func (b *ButtonsBool) Clicked() int
Clicked returns the button index that was clicked in the previous layout.
func (*ButtonsBool) ClickedN ¶
func (b *ButtonsBool) ClickedN(n int) int
ClickedN returns whether the last clicked button was clicked n times.
func (*ButtonsBool) Hovered ¶
func (b *ButtonsBool) Hovered() int
Hovered returns the index of the hovered button if any.
func (*ButtonsBool) Layout ¶
func (b *ButtonsBool) Layout(gtx layout.Context, l Widgets, el layout.ListElement) layout.Dimensions
func (*ButtonsBool) Resize ¶
func (b *ButtonsBool) Resize(n int, style ButtonStyle)
Resize resizes the slice and applies the style to all buttons.
func (*ButtonsBool) Select ¶
func (b *ButtonsBool) Select(idx int)
Select marks the button at the given index as selected. If in single mode, any current selection is discarded.
func (*ButtonsBool) Selected ¶
func (b *ButtonsBool) Selected() int
Selected returns the index of the first button with a true state or -1 if none has it.
func (*ButtonsBool) Unselect ¶
func (b *ButtonsBool) Unselect(idx int)
Unselect marks the button at the given index as unselected.
type CheckBoxState ¶
type CheckBoxState uint8
CheckBoxState is the state of a Checkbox.
const ( CheckboxOff CheckBoxState = iota CheckboxOn CheckboxBoth // only available in CheckboxTri )
type Checkbox ¶
type Checkbox struct { CheckboxStyle Axis layout.Axis // contains filtered or unexported fields }
Checkbox provides a 2 states widget.
type CheckboxStyle ¶
CheckboxStyle defines the stylistic elements of a Checkbox.
type CheckboxTri ¶
type CheckboxTri struct {
Checkbox
}
CheckboxTri provides a 3 states widget.
func (*CheckboxTri) Layout ¶
func (b *CheckboxTri) Layout(gtx layout.Context) layout.Dimensions
func (*CheckboxTri) Value ¶
func (b *CheckboxTri) Value() CheckBoxState
Value returns the checkbox state.
type ColorEditor ¶
type ColorEditor struct { ColorEditorStyle // Color is the color to be edited. Color color.NRGBA // NoAlpha disables alpha channel changes. NoAlpha bool // contains filtered or unexported fields }
ColorEditor is a simple NRGBA color editor.
func (*ColorEditor) Layout ¶
func (ed *ColorEditor) Layout(gtx layout.Context) layout.Dimensions
func (*ColorEditor) Update ¶
func (ed *ColorEditor) Update()
Update updates the ColorEditor widgets with its current color.
type ColorEditorStyle ¶
type ColorEditorStyle struct { // Axis defines the sliders axis. Axis layout.Axis // Input is used to display RGBA values. Input InputInt Slider Slider }
ColorEditorStyle defines the stylistic elements of a ColorEditor.
type Dialog ¶
type Dialog struct { DialogStyle // contains filtered or unexported fields }
Dialog displays two buttons next to each other.
func (*Dialog) Clicked ¶
func (d *Dialog) Clicked(b DialogButtonType) bool
Clicked returns whether the button was clicked.
type DialogButtonType ¶
type DialogButtonType uint8
DialogButtonType is the button index for a Dialog.
Buttons are laid out from left to right in increasing index.
const ( DialogButton1 DialogButtonType = iota DialogButton2 )
type DialogStyle ¶
type DialogStyle struct { Inset layout.Inset Background Background Text ButtonText Button1 string Button2 string }
DialogStyle defines the stylistic elements of a Dialog. Button1 and Button2 are placed next to each other at the SE of the modal window.
type Enum ¶
type Enum struct { Value int // contains filtered or unexported fields }
Enum manages a set of int keys. Whenever a key is clicked, the Value is set with the corresponding key.
type Error ¶
type Error struct { ErrorStyle // Error is the error to be displayed. Error error // contains filtered or unexported fields }
Error is used to display transient or not transient error message.
type ErrorStyle ¶
type ErrorStyle struct { Inset layout.Inset // Show is the duration for which the error is displayed. // If zero, it is displayed until Error is nil. Show time.Duration Text Text Background Background }
ErrorStyle defines the stylistic elements of an Error.
type File ¶
type File struct { // Path is the path to display files from. Path string // Filter is applied to all entries within a directory. Filter func(fs.DirEntry) (keep bool) FileStyle // contains filtered or unexported fields }
File is a simple file picker.
func (*File) Refresh ¶
func (f *File) Refresh()
Refresh reloads the content of the current directory, applying the filter if any.
type FileStyle ¶
type FileStyle struct { // Inset defines the padding main File window. Inset layout.Inset // Text is used to display the text items. Text Text // Error is used to display error messages. Error *Error // Input is the text input for the file name. Input InputText // Hover is the background and foreground colors used for list items being hovered. Hover Palette // ListBackground is the background used for lists. ListBackground Background // Background is the background color used for the widget. Background color.NRGBA // Size is the icons size. Size unit.Value // Resize defines the style for the directories/files separator. Resize ResizeStyle Partitions Icon Bar BarStyle // Filter defines the style for file and directory filtering. Filter SelectStyle }
FileStyle defines the stylistic elements of a File.
type Grid ¶
type Grid struct { // Width is the cell width. Width unit.Value // Height is the cell height. Height unit.Value // contains filtered or unexported fields }
Grid is a two dimensions List.
type Input ¶
type Input struct { InputStyle // Hint is displayed when the input's content is empty. Hint string // Assist is displayed below the input box. Assist string // contains filtered or unexported fields }
Input lays out an input box for single line text.
func (*Input) Layout ¶
func (in *Input) Layout(gtx layout.Context, ed *widget.Editor, onSubmit InputOnSubmit) layout.Dimensions
type InputInt ¶
type InputInt struct { InputIntStyle // Incr is the amount by which the value can be // increased or decreased. Incr int // AllowExpr enables simple arithmetic expressions as input. // The *, /, - and + operators are supported. AllowExpr bool Input // contains filtered or unexported fields }
InputInt lays out an input field for integer values.
func (*InputInt) Layout ¶
func (in *InputInt) Layout(gtx layout.Context, ed *widget.Editor, onSubmit InputIntOnSubmit) layout.Dimensions
type InputIntOnSubmit ¶
InputIntOnSubmit is called when the editor is submitted.
type InputIntStyle ¶
type InputIntStyle struct { Input InputStyle InputIncr InputStyle MoreStyle ButtonStyle LessStyle ButtonStyle More Icon Less Icon }
InputIntStyle defines the stylistic elements of an InputInt.
type InputOnSubmit ¶
InputOnSubmit is called when the editor is submitted.
type InputRangeInt ¶
type InputRangeInt struct {
Min, Max int
// AssistFmt defines the format string
// to display the min and max values.
// Empty means no display.
AssistFmt string
InputInt
}
InputRangeInt lays out an input field for integer values within a range.
func (*InputRangeInt) Layout ¶
func (in *InputRangeInt) Layout(gtx layout.Context, ed *widget.Editor, onSubmit InputIntOnSubmit) layout.Dimensions
type InputStyle ¶
type InputStyle struct { Inset layout.Inset Background Background Editing Background Selection color.NRGBA Text Text Disabled Text Assist Text }
InputStyle defines the stylistic elements of an Input.
type InputText ¶
type InputText struct { InputTextStyle Input // DoubleFocus defines the editor to be focused upon double click // instead of single click. DoubleFocus bool // NoClear disables the clear button. NoClear bool // contains filtered or unexported fields }
InputText lays out an input field for text with a clear button.
type InputTextStyle ¶
type InputTextStyle struct { Clear Icon // Button is used to display the clear icon. Button ButtonStyle }
InputTextStyle defines the stylistic elements of an InputText.
type Menu ¶
type Menu struct { MenuStyle Position layout.Direction ScrollToEnd bool Alignment layout.Alignment Menu []MenuNode // contains filtered or unexported fields }
Menu provides a way to organize widgets for menu actions. The widgets are usually icons, text or a mix of both.
func (*Menu) Layout ¶
func (m *Menu) Layout(gtx layout.Context, el MenuElement, onClick func(*MenuNode)) layout.Dimensions
type MenuElement ¶
type MenuElement func(layout.Context, *MenuNode) layout.Dimensions
type MenuNode ¶
type MenuNode struct { ID int // Disabled disables clicking on the node. Disabled bool // Menu defines a submenu. Menu []MenuNode // MenuPos defines the position of the submenu relative to // the clicked area. MenuPos Popup // MenuOpen is the submenu open status. MenuOpen bool // contains filtered or unexported fields }
MenuNode is a menu item. It acts as a submenu if len(Menu) > 0.
type MenuStyle ¶
type MenuStyle struct { Inset layout.Inset Background Background Menu ButtonStyle MenuHighlight Background Top Icon Right Icon Bottom Icon Left Icon }
MenuStyle defines the stylistic elements of a Menu.
type Modal ¶
type Modal struct { ModalStyle Dialog }
Modal deactivates its container and pops up a widget with a Cancel or OK button. Its Layout is performed as a Defer op.
type ModalStyle ¶
ModalStyle defines the stylistic elements of a Modal.
type Pan ¶
type Pan struct {
// contains filtered or unexported fields
}
Pan makes a widget pannable.
func (*Pan) OffsetLast ¶
OffsetLast returns the bottom right offset in pixels.
type Popup ¶
type Popup uint8
Popup displays a widget relative to another one.
type Resize ¶
type Resize struct { ResizeStyle // Axis defines how the widgets and the handle are laid out. Axis layout.Axis // Ratio defines how much space is available to the first widget. Ratio float32 // contains filtered or unexported fields }
Resize provides a draggable handle in between two widgets for resizing their area. Any of the widgets can be nil in which case they are ignored.
type ResizeCorner ¶
type ResizeCorner struct { ResizeCornerStyle Position ResizeCorners Size image.Point // contains filtered or unexported fields }
ResizeCorner overlays a resize widget in one of the 4 corners. TODO wip
func (*ResizeCorner) Layout ¶
func (rs *ResizeCorner) Layout(gtx layout.Context, w layout.Widget) layout.Dimensions
type ResizeCorner2 ¶
type ResizeCorner2 struct { ResizeCornerStyle Position ResizeCorners RatioH float32 RatioV float32 // contains filtered or unexported fields }
ResizeCorner2 overlays a resize widget in one of the 4 corners.
func (*ResizeCorner2) Layout ¶
func (rs *ResizeCorner2) Layout(gtx layout.Context, w layout.Widget) layout.Dimensions
max contraint = container for the widget
type ResizeCornerStyle ¶
type ResizeCornerStyle struct { Handle Background Width unit.Value Height unit.Value }
ResizeCornerStyle defines the stylistic elements of a ResizeCorner2.
type ResizeCorners ¶
type ResizeCorners uint8
const ( BottomRightCorner ResizeCorners = iota BottomLeftCorner TopLeftCorner TopRightCorner )
type ResizeStyle ¶
type ResizeStyle struct { Background Background Handle Background Width unit.Value Height unit.Value }
ResizeStyle defines the stylistic elements of a Resize.
type Select ¶
type Select struct { SelectStyle // Above displays the popup above the select widget. Above bool // Values defines the list of values to select from. Values []string // Placeholder is displayed when no value is selected. Placeholder string // contains filtered or unexported fields }
Select can display a popup list of values to select from.
type SelectStyle ¶
type SelectStyle struct { Inset layout.Inset Text Text Popup Background Default Background Hover Background Disabled Background Closed Icon Opened Icon }
SelectStyle defines the stylistic elements of a Select.
type Slider ¶
type Slider struct { SliderStyle widget.Float // contains filtered or unexported fields }
Slider displays a ruler with a handle.
func (*Slider) Layout ¶
Layout lays out the ruler and its handle. If Float.Axis is Horizontal,
gtx.Constraints.Min.Y determines the handle height and gtx.Constraints.Min.X determines the ruler width.
If Float.Axis is Vertical,
gtx.Constraints.Min.X determines the handle width and gtx.Constraints.Min.Y determines the ruler height.
type SliderStyle ¶
type SliderStyle struct { // Width is the ruler and handle width. Width unit.Value Default Background Hover Background Disabled Background }
SliderStyle defines the stylistic elements of a Slider.
type Style ¶
type Style struct { Palette NW, NE, SE, SW unit.Value // corner radius CheckRadius unit.Value Text Text }
Style defines groups stylistic elements for various modes (Default, Hovered...).
func (Style) Background ¶
func (s Style) Background() Background
type Tab ¶
type Tab struct { TabStyle Position layout.Direction ScrollToEnd bool Alignment layout.Alignment // Closable defines whether tabs can be closed. Closable bool // contains filtered or unexported fields }
Tab defines selectable widgets and display the content of the selected one.
func (*Tab) Close ¶
Close closes the tab at the given index. If the index is negative, all tabs are closed.
func (*Tab) Layout ¶
func (t *Tab) Layout(gtx layout.Context, n int, tab, content layout.ListElement) layout.Dimensions
Layout displays the list of tabs and the content of the selected one. If no tab is selected, then content is called with a negative index.
type TabStyle ¶
type TabStyle struct { Inset layout.Inset TabInset layout.Inset SepSize unit.Value SepSelected color.NRGBA SepNotSelected color.NRGBA Close Icon Button ButtonStyle }
TabStyle defines the stylistic elements of a Tab.
type TabText ¶
type TabText struct { TabTextStyle Tab Tabs []string // Rename defines whether tabs can be renamed. Rename bool // contains filtered or unexported fields }
TabText supports a Tab with string labels.
func (*TabText) Layout ¶
func (t *TabText) Layout(gtx layout.Context, content layout.ListElement) layout.Dimensions
type TabTextStyle ¶
type TabTextStyle struct { Text Text Close Icon Button ButtonStyle Input InputStyle InputText InputTextStyle }
TabTextStyle defines the stylistic elements of a TabText.
type Text ¶
type Theme ¶
type Theme struct { Bar BarStyle Backgrounds [8]Background Button ButtonStyle ButtonText ButtonTextStyle Checkbox CheckboxStyle ColorEditor ColorEditorStyle Dialog DialogStyle Error ErrorStyle File FileStyle Icon IconStyle Input InputStyle InputInt InputIntStyle InputText InputTextStyle Menu MenuStyle Modal ModalStyle Resizer ResizeStyle Select SelectStyle Slider SliderStyle Style ThemeStyle Tab TabStyle TabText TabTextStyle Tooltip TooltipStyle Tree TreeStyle Wrap WrapStyle }
Theme defines a central structure which holds a copy of all widgets.
func NewTheme ¶
func NewTheme(s ThemeStyle) Theme
NewTheme creates the theme for the supplied style.
type ThemeStyle ¶
type ThemeStyle struct { Inset layout.Inset Backgrounds [8]color.NRGBA Default Style Hover Style // input selection Click Style // input editing Disabled Style Tooltip Background }
ThemeStyle defines all styles for an UI.
func (ThemeStyle) LoadIcon ¶
func (s ThemeStyle) LoadIcon(data []byte) Icon
type Tooltip ¶
type Tooltip struct { TooltipStyle // contains filtered or unexported fields }
Tooltip displays a widget next to another one if hovered for some time.
type TooltipStyle ¶
TooltipStyle defines the stylistic elements of a Tooltip.
type Tree ¶
type Tree struct { TreeStyle Axis layout.Axis ScrollToEnd bool Alignment layout.Alignment Root []*TreeNode // contains filtered or unexported fields }
Tree provides a way to organize widgets in a generic tree fashion. The nodes must be provided to the tree and can change between calls to the Layout method.
func (*Tree) Add ¶
Add adds id to the parent. If parent is nil, it is added to the root of the tree. If a node with the same id already exists for the parent, it is not added.
func (*Tree) CanMoveDown ¶
CanMoveDown returns whether id can be moved down.
func (*Tree) Layout ¶
func (t *Tree) Layout(gtx layout.Context, el TreeElement, onOpenClose func(*TreeNode)) layout.Dimensions
func (*Tree) MoveDown ¶
MoveDown moves id after its parent next child or to the parent of the parent if there is no previous child.
func (*Tree) MoveUp ¶
MoveUp moves id before its parent previous child or to the parent of the parent if there is no previous child.
type TreeElement ¶
type TreeElement func(layout.Context, *TreeNode) layout.Dimensions
TreeElement is called for every visible tree node.
type TreeNode ¶
type TreeNode struct { ID int Nodes []*TreeNode // Open is the subtree open status. Open bool // Hidden hides the current node and all its children. Hidden bool Parent *TreeNode // contains filtered or unexported fields }
TreeNode is a tree node.
type TreeStyle ¶
type TreeStyle struct { Inset layout.Inset // Opened is the style applied when the node is opened. Opened TreeSubStyle // Closed is the style applied when the node is closed. Closed TreeSubStyle // Spacing prepends items with space based on their level in the tree. Spacing bool // SelectMode allows selection of tree items. SelectMode bool Selected ButtonStyle Unselected ButtonStyle // AccordionMode make non leaf nodes behave as an open/close button. AccordionMode bool }
TreeStyle defines the stylistic elements of a Tree.
type TreeSubStyle ¶
type TreeSubStyle struct { Icon ButtonStyle Selected ButtonStyle Unselected ButtonStyle }
TreeSubStyle defines the stylistic elements of a Tree.
type TreeText ¶
type TreeText struct { Tree // contains filtered or unexported fields }
TreeText implements a tree which nodes are accessible via a path string. A path is / separated.
type Widgets ¶
type Widgets func(layout.Context, int, layout.ListElement) layout.Dimensions
Widgets lays out a widget based on its index.
Examples of Widgets:
- layout.List.Layout
- gotoki.Wrap.Layout
type Wrap ¶
Wrap lays out as many items as possible along its main axis before moving to its cross axis.
func (*Wrap) Layout ¶
func (w *Wrap) Layout(gtx layout.Context, n int, el layout.ListElement) layout.Dimensions
type WrapScroll ¶
type WrapScroll struct { Wrap // contains filtered or unexported fields }
WrapScroll makes the content of a Wrap scrollable along its cross axis.
func (*WrapScroll) Layout ¶
func (w *WrapScroll) Layout(gtx layout.Context, n int, el layout.ListElement) layout.Dimensions
func (*WrapScroll) ScrollTo ¶
func (w *WrapScroll) ScrollTo(idx int)
ScrollTo jumps to the first line/column containing element at the given index.