Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Index your code
hub
/
github.com/rivo/tview
/ functions
Functions
690 in github.com/rivo/tview
⨍
Functions
690
◇
Types & classes
50
↓ 4 callers
Method
SetChangedFunc
SetChangedFunc sets a handler which is called whenever the text of the input field has changed. It receives the current text (after the change).
inputfield.go:427
↓ 4 callers
Method
SetColor
SetColor sets the node's text color. For compatibility reasons, this also sets the background color of the selected text style. For more control over
treeview.go:220
↓ 4 callers
Method
SetColumns
SetColumns defines how the columns of the grid are distributed. Each value defines the size of one column, starting with the leftmost column. Values g
grid.go:108
↓ 4 callers
Method
SetGraphics
SetGraphics sets a flag which determines whether or not line graphics are drawn to illustrate the tree's hierarchy.
treeview.go:459
↓ 4 callers
Method
SetImage
SetImage sets the image to be displayed. If nil, the widget will be empty.
image.go:127
↓ 4 callers
Method
SetPrefixes
SetPrefixes defines the strings drawn before the nodes' texts. This is a slice of strings where each element corresponds to a node's hierarchy level,
treeview.go:444
↓ 4 callers
Method
SetTextStyle
SetTextStyle sets the style of the text.
textarea.go:876
↓ 4 callers
Method
SetTopLevel
SetTopLevel sets the first tree level that is visible with 0 referring to the root, 1 to the root's child nodes, and so on. Nodes above the top level
treeview.go:428
↓ 4 callers
Method
SwitchToPage
SwitchToPage sets a page's visibility to "true" and all other pages' visibility to "false".
pages.go:181
↓ 4 callers
Method
closeList
closeList closes the embedded List element by hiding it and removing focus from it.
dropdown.go:644
↓ 4 callers
Method
focusIndex
focusIndex returns the index of the currently focused item, counting form items first, then buttons. A negative value indicates that no containeed ite
form.go:794
↓ 4 callers
Method
moveWordRight
moveWordRight moves the cursor to the end of the current or next word. If after is set to true, the cursor will be placed after the word. If false, th
textarea.go:1745
↓ 4 callers
Method
openList
openList hands control over to the embedded List primitive.
dropdown.go:595
↓ 4 callers
Method
reset
reset resets many of the local variables of the text area because they cannot be used anymore and must be recalculated, typically after the text area'
textarea.go:1337
↓ 3 callers
Method
AddCheckbox
AddCheckbox adds a checkbox to the form. It has a label, an initial state, and an (optional) callback function which is invoked when the state of the
form.go:348
↓ 3 callers
Method
AddDropDown
AddDropDown adds a drop-down element to the form. It has a label, options, and an (optional) callback function which is invoked when an option was sel
form.go:337
↓ 3 callers
Method
AddPasswordField
AddPasswordField adds a password field to the form. This is similar to an input field except that the user's input not shown. Instead, a "mask" charac
form.go:320
↓ 3 callers
Method
GetColumnCount
Return the total number of columns in the table.
table.go:244
↓ 3 callers
Method
GetCurrentItem
GetCurrentItem returns the index of the currently selected list item, starting at 0 for the first item.
list.go:144
↓ 3 callers
Method
GetItemCount
GetItemCount returns the number of items in this container.
flex.go:113
↓ 3 callers
Method
GetItemText
GetItemText returns an item's texts (main and secondary). Panics if the index is out of range.
list.go:441
↓ 3 callers
Method
GetPrimitive
GetPrimitive returns the primitive contained in this frame.
frame.go:70
↓ 3 callers
Method
GetTextStyle
GetTextStyle returns the style of the text.
textarea.go:882
↓ 3 callers
Method
HasFocus
HasFocus returns whether or not this primitive has focus.
dropdown.go:673
↓ 3 callers
Method
HidePage
HidePage sets a page's visibility to "false".
pages.go:163
↓ 3 callers
Method
LineBreak
LineBreak returns whether the string can be broken into the next line after the returned grapheme cluster. If optional is true, the line break is opti
strings.go:61
↓ 3 callers
Function
NewTextArea
NewTextArea returns a new text area. Use [TextArea.SetText] to set the initial text.
textarea.go:351
↓ 3 callers
Function
NewTreeNode
NewTreeNode returns a new tree node.
treeview.go:59
↓ 3 callers
Method
QueueEvent
QueueEvent sends an event to the Application event loop. It is not recommended for event to be nil.
application.go:896
↓ 3 callers
Method
SetAcceptanceFunc
SetAcceptanceFunc sets a handler which may reject the last character that was entered, by returning false. The handler receives the text as it would b
inputfield.go:420
↓ 3 callers
Method
SetBackgroundColor
SetBackgroundColor sets the color of the modal frame background.
modal.go:55
↓ 3 callers
Method
SetCell
The following functions are provided for completeness reasons as the original Table implementation was not read-only. If you do not wish to forward mo
table.go:254
↓ 3 callers
Method
SetExpanded
SetExpanded sets whether or not this node's child nodes should be displayed.
treeview.go:165
↓ 3 callers
Method
SetFocus
SetFocus shifts the focus to the form element with the given index, counting non-button items first and buttons last. Note that this index is only use
form.go:211
↓ 3 callers
Method
SetMainTextStyle
SetMainTextStyle sets the style of the items' main text. Note that the background color is ignored in order not to override the background color of th
list.go:225
↓ 3 callers
Method
SetPrimitive
SetPrimitive replaces the contained primitive with the given one. To remove a primitive, set it to nil.
frame.go:57
↓ 3 callers
Method
SetRegions
SetRegions sets the flag that allows to define regions in the text. See class description for details.
textview.go:480
↓ 3 callers
Method
SetSelectedStyle
SetSelectedStyle sets the style of the selected items. Note that the color of main text characters that are different from the main text color (e.g. c
list.go:275
↓ 3 callers
Method
SetSize
SetSize is a shortcut for [Grid.SetRows] and [Grid.SetColumns] where all row and column values are set to the given size values. See [Grid.SetColumns]
grid.go:127
↓ 3 callers
Method
SetText
SetText sets the current text of the input field. This can be undone by the user. Calling this function will also trigger a "changed" event.
inputfield.go:157
↓ 3 callers
Method
ShowPage
ShowPage sets a page's visibility to "true" (in addition to any other pages which are already visible).
pages.go:146
↓ 3 callers
Method
Walk
Walk traverses this node's subtree in depth-first, pre-order (NLR) order and calls the provided callback function on each traversed node (which includ
treeview.go:75
↓ 3 callers
Method
getTextAfterCursor
getTextAfterCursor returns the text of the text area after the cursor. Note that this will result in a new allocation for the returned text.
textarea.go:495
↓ 3 callers
Method
getTextBeforeCursor
getTextBeforeCursor returns the text of the text area up until the cursor. Note that this will result in a new allocation for the returned text.
textarea.go:463
↓ 3 callers
Method
process
process builds the visible tree, populates the "nodes" slice, and processes pending movement actions. Set "drawingAfter" to true if you know that [Tre
treeview.go:533
↓ 2 callers
Method
AddChild
AddChild adds a new child node to this node.
treeview.go:133
↓ 2 callers
Method
AddTextArea
AddTextArea adds a text area to the form. It has a label, an optional initial text, a size (width and height) referring to the actual input area (a fi
form.go:259
↓ 2 callers
Method
Draw
Draw refreshes the screen (during the next update cycle). It calls the Draw() function of the application's root primitive and then syncs the screen b
application.go:684
↓ 2 callers
Method
GetChildren
GetChildren returns this node's children.
treeview.go:122
↓ 2 callers
Method
GetColor
GetColor returns the node's text color.
treeview.go:212
↓ 2 callers
Method
GetColors
GetColors returns the number of colors that will be used while drawing the image. This is one of the values listed in [Image.SetColors], except 0 whic
image.go:163
↓ 2 callers
Method
GetFormItem
GetFormItem returns the form item at the given position, starting with index 0. Elements are referenced in the order they were added. Buttons are not
form.go:450
↓ 2 callers
Method
GetRect
GetRect returns the current position of the rectangle, x, y, width, and height.
box.go:93
↓ 2 callers
Method
GetReference
GetReference returns this cell's reference object.
table.go:199
↓ 2 callers
Method
GetRoot
GetRoot returns the root node of the tree. If no such node was previously set, nil is returned.
treeview.go:374
↓ 2 callers
Method
GetUseStyleTags
GetUseStyleTags returns whether style tags are used in the main and secondary texts.
list.go:290
↓ 2 callers
Method
HasFocus
HasFocus returns whether or not this primitive has focus.
inputfield.go:464
↓ 2 callers
Method
InInnerRect
InInnerRect returns true if the given coordinate is within the bounds of the box's inner rectangle (within the border and padding).
box.go:277
↓ 2 callers
Method
IsExpanded
IsExpanded returns whether the child nodes of this node are visible.
treeview.go:201
↓ 2 callers
Function
NewButton
NewButton returns a new input field.
button.go:38
↓ 2 callers
Function
NewCheckbox
NewCheckbox returns a new input field.
checkbox.go:60
↓ 2 callers
Function
NewDropDown
NewDropDown returns a new drop-down.
dropdown.go:96
↓ 2 callers
Function
NewImage
NewImage returns a new image widget with an empty image (use [Image.SetImage] to specify the image to be displayed). The image will use the widget's e
image.go:116
↓ 2 callers
Function
NewTreeView
NewTreeView returns a new tree view.
treeview.go:358
↓ 2 callers
Method
QueueUpdate
QueueUpdate is used to synchronize access to primitives from non-main goroutines. The provided function will be executed as part of the event loop and
application.go:876
↓ 2 callers
Method
Select
Select sets the selected cell. Depending on the selection settings specified via SetSelectable(), this may be an entire row or column, or even ignored
table.go:647
↓ 2 callers
Method
SetAutocompleteFunc
SetAutocompleteFunc sets an autocomplete callback function which may return strings to be selected from a drop-down based on the current text of the i
inputfield.go:322
↓ 2 callers
Method
SetCurrentNode
SetCurrentNode sets the currently selected node. Provide nil to clear all selections. Selected nodes must be visible and selectable, or else the selec
treeview.go:385
↓ 2 callers
Method
SetDithering
SetDithering sets the dithering algorithm to use, one of the constants starting with "Dithering", for example [DitheringFloydSteinberg] (the default).
image.go:180
↓ 2 callers
Method
SetFixed
SetFixed sets the number of fixed rows and columns which are always visible even when the rest of the cells are scrolled out of view. Rows are always
table.go:612
↓ 2 callers
Method
SetFormAttributes
SetFormAttributes sets a number of item attributes at once.
form.go:29
↓ 2 callers
Method
SetHighlightFullLine
SetHighlightFullLine sets a flag which determines whether the colored background of selected items spans the entire width of the view. If set to true,
list.go:306
↓ 2 callers
Method
SetOptions
SetOptions replaces all current options with the ones provided and installs one callback function which is called when one of the options is selected.
dropdown.go:327
↓ 2 callers
Method
SetPlaceholder
SetPlaceholder sets the text to be displayed when the text area is empty.
textarea.go:786
↓ 2 callers
Method
SetReference
SetReference allows you to store a reference of any type in this cell. This will allow you to establish a mapping between the cell and your actual dat
table.go:193
↓ 2 callers
Method
SetScrollable
SetScrollable sets the flag that decides whether or not the text view is scrollable. If false, text that moves above the text view's top row will be p
textview.go:306
↓ 2 callers
Method
SetTextAlign
SetTextAlign sets the text alignment within the text view. This must be either AlignLeft, AlignCenter, or AlignRight.
textview.go:353
↓ 2 callers
Method
SetTitle
SetTitle sets the title of the terminal window, to the extent that the terminal supports it. A non-empty title will be set on every new tcell.Screen t
application.go:226
↓ 2 callers
Method
SetTitleAlign
SetTitleAlign sets the alignment of the title, one of AlignLeft, AlignCenter, or AlignRight.
box.go:359
↓ 2 callers
Method
Style
Style returns the style for the grapheme cluster.
strings.go:83
↓ 2 callers
Method
clear
clear is the internal implementation of clear. It is used by TextViewWriter and anywhere that we need to perform a write without locking the buffer.
textview.go:600
↓ 2 callers
Method
getSelectedText
getSelectedText returns the text of the current selection.
textarea.go:1923
↓ 2 callers
Function
parseTag
parseTag parses str for consecutive style and/or region tags, assuming that str starts with the opening bracket for the first tag. It returns the stri
strings.go:221
↓ 2 callers
Method
setTransform
setTransform sets the transform function to be used when drawing the text. This function is called for each grapheme cluster and can be used to modify
textarea.go:1607
↓ 2 callers
Method
write
write is the internal implementation of Write. It is used by [TextViewWriter] and anywhere that we need to perform a write without locking the buffer.
textview.go:817
↓ 1 callers
Function
ANSIWriter
ANSIWriter returns an io.Writer which translates any ANSI escape codes written to it into tview style tags. Other escape codes don't have an effect an
ansi.go:37
↓ 1 callers
Method
AddAndSwitchToPage
AddAndSwitchToPage calls AddPage(), then SwitchToPage() on that newly added page.
pages.go:96
↓ 1 callers
Method
AddImage
AddImage adds an image to the form. It has a label and the image will fit in the specified width and height (its aspect ratio is preserved). See [Imag
form.go:361
↓ 1 callers
Method
AddOption
AddOption adds a new selectable option to this drop-down. The "selected" callback is called when this option was selected. It may be nil.
dropdown.go:317
↓ 1 callers
Method
AddTextView
AddTextView adds a text view to the form. It has a label and text, a size (width and height) referring to the actual text element (a fieldWidth of 0 e
form.go:285
↓ 1 callers
Method
CellAt
CellAt returns the row and column located at the given screen coordinates. Each returned value may be negative if there is no row and/or cell. This fu
table.go:796
↓ 1 callers
Method
ClearButtons
ClearButtons removes all buttons from the form.
form.go:421
↓ 1 callers
Method
CollapseAll
CollapseAll collapses this node and all descendent nodes.
treeview.go:192
↓ 1 callers
Method
ExpandAll
ExpandAll expands this node and all descendent nodes.
treeview.go:183
↓ 1 callers
Method
Focus
Focus is called by the application when the primitive receives focus.
form.go:710
↓ 1 callers
Method
GetButton
GetButton returns the button at the specified 0-based index. Note that buttons have been specially prepared for this form and modifying some of their
form.go:381
↓ 1 callers
Method
GetButtonCount
GetButtonCount returns the number of buttons in this form.
form.go:393
↓ 1 callers
Method
GetClipboardText
GetClipboardText returns the current text of the clipboard by calling the pasteFromClipboard function set with [TextArea.SetClipboard].
textarea.go:947
↓ 1 callers
Method
GetCurrentOption
GetCurrentOption returns the index of the currently selected option as well as its text. If no option was selected, -1 and an empty string is returned
dropdown.go:147
↓ 1 callers
Method
GetCursor
GetCursor returns the current cursor position where the first character of the entire text is in row 0, column 0. If the user has selected text, the "
textarea.go:598
← previous
next →
101–200 of 690, ranked by callers