Documentation
¶
Index ¶
- type Align
- type Ctor
- func (ctor *Ctor) Align(align Align)
- func (ctor *Ctor) ClearStyle()
- func (ctor *Ctor) End()
- func (ctor *Ctor) Link(text string, hoverColor color.RGBA, callback func()) bool
- func (ctor *Ctor) ParagraphStyle(align Align, color color.RGBA)
- func (ctor *Ctor) RestoreStyle()
- func (ctor *Ctor) SaveStyle()
- func (ctor *Ctor) SetAlignForSel(sel Sel, align Align)
- func (ctor *Ctor) SetParagraphStyleForSel(sel Sel, align Align, color color.RGBA)
- func (ctor *Ctor) SetStyle(s TextStyle)
- func (ctor *Ctor) SetStyleForSel(sel Sel, s TextStyle)
- func (ctor *Ctor) Text(text string)
- type FaceFlags
- type Flags
- type RichText
- func (rtxt *RichText) Append(scroll bool) *Ctor
- func (rtxt *RichText) FollowCursor()
- func (rtxt *RichText) Get(sel Sel) string
- func (rtxt *RichText) Look(text string, wraparound bool) bool
- func (rtxt *RichText) Rows(w *framework.Window, changed bool) *Ctor
- func (rtxt *RichText) Tail(n int)
- func (rtxt *RichText) Widget(w *framework.Window, changed bool) *Ctor
- type Sel
- type TextStyle
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Ctor ¶
type Ctor struct {
// contains filtered or unexported fields
}
func (*Ctor) Align ¶
Align changes current text alignment. It is only legal to call Align before inserting text or after a newline character is inserted.
func (*Ctor) ClearStyle ¶
func (ctor *Ctor) ClearStyle()
ClearStyle resets the text style to the default.
func (*Ctor) Link ¶
Link adds a link to the widget. It will return true if the link was clicked and callback is nil.
func (*Ctor) RestoreStyle ¶
func (ctor *Ctor) RestoreStyle()
RestoreStyle restores the last saved text style.
func (*Ctor) SetAlignForSel ¶
SetAlignForSel changes the alignment for the specified region.
func (*Ctor) SetParagraphStyleForSel ¶
func (*Ctor) SetStyle ¶
SetStyle changes current text style. If color or selColor are the zero value the default value (copied from the window) will be used. If face is nil the default font face from the window style will be used.
func (*Ctor) SetStyleForSel ¶
SetStyleForSel changes the text style for the specified region.
type RichText ¶
type RichText struct { Sel Sel // selected text if this widget is selectable, cursor position will have S == E Flags Flags SelFgColor color.RGBA // foreground color for selection, zero value specifies that it should be copied from the window style SelColor color.RGBA // background color for selection, zero value specifies that it should be copied from the window style // contains filtered or unexported fields }
func (*RichText) Append ¶
Append allows adding text at the end of the widget. Calling Link or LinkBytes on the returned constructor is illegal if callback is nil. Selections for SetStyleForSel and SetAlignForSel are interpreted to be relative to the newly added text.
func (*RichText) FollowCursor ¶
func (rtxt *RichText) FollowCursor()
func (*RichText) Look ¶
Look searches from the next occurence of text inside rtxt, starting at rtxt.Sel.S. Restarts the search from the start if nothing is found.
func (*RichText) Rows ¶
Rows is like Widget but adds the contents as a series of rows instead of a single widget.
func (*RichText) Widget ¶
Widget adds this rich text widget as a widget to w. The returned constructor allows populating the rich text widget with text and responding to events. The constructor will be returned under this circumstances: 1. the first time this function or Rows is called 2. changed is true 3. a link was clicked