mirror of https://github.com/rivo/tview.git
Updated README screencast. Also fixed Table rendering issue.
This commit is contained in:
parent
1480dc5b05
commit
db36428c92
|
@ -21,6 +21,7 @@ const form = `[green]package[white] main
|
||||||
}, [red]0[white], nil).
|
}, [red]0[white], nil).
|
||||||
[yellow]AddCheckbox[white]([red]"On vacation:"[white], false, nil).
|
[yellow]AddCheckbox[white]([red]"On vacation:"[white], false, nil).
|
||||||
[yellow]AddPasswordField[white]([red]"Password:"[white], [red]""[white], [red]10[white], [red]'*'[white], nil).
|
[yellow]AddPasswordField[white]([red]"Password:"[white], [red]""[white], [red]10[white], [red]'*'[white], nil).
|
||||||
|
[yellow]AddTextArea[white]([red]"Notes:"[white], [red]""[white], [red]0[white], [red]5[white], [red]0[white], nil).
|
||||||
[yellow]AddButton[white]([red]"Save"[white], [yellow]func[white]() { [blue]/* Save data */[white] }).
|
[yellow]AddButton[white]([red]"Save"[white], [yellow]func[white]() { [blue]/* Save data */[white] }).
|
||||||
[yellow]AddButton[white]([red]"Cancel"[white], [yellow]func[white]() { [blue]/* Cancel */[white] })
|
[yellow]AddButton[white]([red]"Cancel"[white], [yellow]func[white]() { [blue]/* Cancel */[white] })
|
||||||
tview.[yellow]NewApplication[white]().
|
tview.[yellow]NewApplication[white]().
|
||||||
|
@ -36,8 +37,9 @@ func Form(nextSlide func()) (title string, content tview.Primitive) {
|
||||||
AddDropDown("Role:", []string{"Engineer", "Manager", "Administration"}, 0, nil).
|
AddDropDown("Role:", []string{"Engineer", "Manager", "Administration"}, 0, nil).
|
||||||
AddCheckbox("On vacation:", false, nil).
|
AddCheckbox("On vacation:", false, nil).
|
||||||
AddPasswordField("Password:", "", 10, '*', nil).
|
AddPasswordField("Password:", "", 10, '*', nil).
|
||||||
|
AddTextArea("Notes:", "", 0, 5, 0, nil).
|
||||||
AddButton("Save", nextSlide).
|
AddButton("Save", nextSlide).
|
||||||
AddButton("Cancel", nextSlide)
|
AddButton("Cancel", nextSlide)
|
||||||
f.SetBorder(true).SetTitle("Employee Information")
|
f.SetBorder(true).SetTitle("Employee Information")
|
||||||
return "Forms", Code(f, 36, 15, form)
|
return "Forms", Code(f, 36, 21, form)
|
||||||
}
|
}
|
||||||
|
|
2
table.go
2
table.go
|
@ -1137,7 +1137,7 @@ func (t *Table) Draw(screen tcell.Screen) {
|
||||||
break // No space for the text anymore.
|
break // No space for the text anymore.
|
||||||
}
|
}
|
||||||
drawBorder(columnX-1, rowY, Borders.Vertical)
|
drawBorder(columnX-1, rowY, Borders.Vertical)
|
||||||
} else if column < columnCount-1 {
|
} else if columnIndex < len(columns)-1 {
|
||||||
// Draw separator.
|
// Draw separator.
|
||||||
drawBorder(columnX+columnWidth, rowY, t.separator)
|
drawBorder(columnX+columnWidth, rowY, t.separator)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue