On this page
widget.CodeBlockSegment
import "fyne.io/fyne/v2/widget"
Usage
type CodeBlockSegment
type CodeBlockSegment struct {
Text string
}
CodeBlockSegment represents a fenced or indented code block. It renders its content as monospace text on a panel, so the block stands apart from the surrounding prose.
Since:
2.8func (*CodeBlockSegment) Inline
func (c *CodeBlockSegment) Inline() bool
Inline returns false as a code block is a full-width block element.
func (*CodeBlockSegment) Select
func (c *CodeBlockSegment) Select(_, _ fyne.Position)
Select does nothing for a code block.
func (*CodeBlockSegment) SelectedText
func (c *CodeBlockSegment) SelectedText() string
SelectedText returns the code block content.
func (*CodeBlockSegment) Textual
func (c *CodeBlockSegment) Textual() string
Textual returns the raw content of this code block.
func (*CodeBlockSegment) Unselect
func (c *CodeBlockSegment) Unselect()
Unselect does nothing for a code block.
func (*CodeBlockSegment) Update
func (c *CodeBlockSegment) Update(o fyne.CanvasObject)
Update applies the current content of this segment to an existing visual.
func (*CodeBlockSegment) Visual
func (c *CodeBlockSegment) Visual() fyne.CanvasObject
Visual returns a new panel widget rendering this code block.