Browse Source

Add WindowManager requirement to Window docs

tablepad
Trevor Slocum 2 years ago
parent
commit
0c4f526680
  1. 5
      doc.go
  2. 2
      go.mod
  3. 4
      go.sum
  4. 2
      textview.go
  5. 3
      window.go

5
doc.go

@ -41,6 +41,7 @@ The following widgets are available:
also be highlighted.
TreeView - A scrollable display for hierarchical data. Tree nodes can be
highlighted, collapsed, expanded, and more.
Window - A draggable and resizable container.
Widgets may be used without an application created via NewApplication, allowing
them to be integrated into any tcell-based application.
@ -173,8 +174,8 @@ Scroll Bars
Scroll bars are supported by the following widgets: List, Table, TextView and
TreeView. Each widget will display scroll bars automatically when there are
additional items off-screen by default, except TextView. See
Widget.SetScrollBarColor and Widget.SetScrollBarVisibility.
additional items offscreen, except TextView. See Widget.SetScrollBarColor and
Widget.SetScrollBarVisibility.
Hello World

2
go.mod

@ -3,7 +3,7 @@ module gitlab.com/tslocum/cview
go 1.12
require (
github.com/gdamore/tcell/v2 v2.0.0-dev.0.20200921183946-6c71be68010f
github.com/gdamore/tcell/v2 v2.0.0-dev.0.20200908121250-0c5e1e1720f1
github.com/lucasb-eyer/go-colorful v1.0.3
github.com/mattn/go-runewidth v0.0.9
github.com/rivo/uniseg v0.1.0

4
go.sum

@ -1,8 +1,8 @@
github.com/gdamore/encoding v1.0.0 h1:+7OoQ1Bc6eTm5niUzBa0Ctsh6JbMW6Ra+YNuAtDBdko=
github.com/gdamore/encoding v1.0.0/go.mod h1:alR0ol34c49FCSBLjhosxzcPHQbf2trDkoo5dl+VrEg=
github.com/gdamore/tcell/v2 v2.0.0-dev/go.mod h1:vSVL/GV5mCSlPC6thFP5kfOFdM9MGZcalipmpTxTgQA=
github.com/gdamore/tcell/v2 v2.0.0-dev.0.20200921183946-6c71be68010f h1:fUyor2CR18vdlU4gjQhIjQErJwtia5OAvS/2U3hkJlI=
github.com/gdamore/tcell/v2 v2.0.0-dev.0.20200921183946-6c71be68010f/go.mod h1:vSVL/GV5mCSlPC6thFP5kfOFdM9MGZcalipmpTxTgQA=
github.com/gdamore/tcell/v2 v2.0.0-dev.0.20200908121250-0c5e1e1720f1 h1:ec/DAe6ms4fBkpSHObVDYU4N/w6Swd929zkN01g8ozY=
github.com/gdamore/tcell/v2 v2.0.0-dev.0.20200908121250-0c5e1e1720f1/go.mod h1:vSVL/GV5mCSlPC6thFP5kfOFdM9MGZcalipmpTxTgQA=
github.com/lucasb-eyer/go-colorful v1.0.3 h1:QIbQXiugsb+q10B+MI+7DI1oQLdmnep86tWFlaaUAac=
github.com/lucasb-eyer/go-colorful v1.0.3/go.mod h1:R4dSotOR9KMtayYi1e77YzuveK+i7ruzyGqttikkLy0=
github.com/mattn/go-runewidth v0.0.7/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI=

2
textview.go

@ -1036,7 +1036,7 @@ func (t *TextView) Draw(screen tcell.Screen) {
t.columnOffset = t.posHighlight - width/2
}
// If the highlight is off-screen on the left, move it on-screen.
// If the highlight is offscreen on the left, move it onscreen.
if t.posHighlight-t.columnOffset < 0 {
t.columnOffset = t.posHighlight - width/4
}

3
window.go

@ -6,7 +6,8 @@ import (
"github.com/gdamore/tcell/v2"
)
// Window is a draggable, resizable frame around a primitive.
// Window is a draggable, resizable frame around a primitive. Windows must be
// added to a WindowManager.
type Window struct {
*Box

Loading…
Cancel
Save