diff --git a/view.go b/view.go index 509f44f..6846a2f 100644 --- a/view.go +++ b/view.go @@ -60,6 +60,9 @@ type View struct { // If Frame is true, Title allows to configure a title for the view. Title string + + // If set and view is Editable, displays the mask instead of the real content + Mask rune } type viewLine struct { @@ -108,6 +111,10 @@ func (v *View) setRune(x, y int, ch rune) error { fgColor = v.FgColor bgColor = v.BgColor } + + if v.Mask != 0 { + ch = v.Mask + } termbox.SetCell(v.x0+x+1, v.y0+y+1, ch, termbox.Attribute(fgColor), termbox.Attribute(bgColor)) return nil