Closed lnxbil closed 5 years ago
I'm not quite sure what you're referring to when you say 'the left box is one character short'. Are you referring to the gap between the top 2 boxes and the bottom 2 boxes or do you mean something else?
Hi, I get what you were saying now. It seems that the bottom left block should be joined with the bottom right block since we disabled the inner borders of each. termui just went through a sizable rewrite, and I rewrote your example to the latest api and it seems to be working now. Let me know if you still get this issue after updating.
package main
import (
ui "github.com/gizak/termui"
)
func main() {
err := ui.Init()
if err != nil {
panic(err)
}
defer ui.Close()
l1 := ui.NewBlock()
r1 := ui.NewBlock()
l2 := ui.NewBlock()
r2 := ui.NewBlock()
// disable border on second row
r2.BorderLeft = false
l2.BorderRight = false
grid := ui.NewGrid()
termWidth, termHeight := ui.TerminalDimensions()
grid.SetRect(0, 0, termWidth, termHeight)
grid.Set(
ui.NewRow(1.0/2,
ui.NewCol(1.0/2, l1),
ui.NewCol(1.0/2, r1),
),
ui.NewRow(1.0/2,
ui.NewCol(1.0/2, l2),
ui.NewCol(1.0/2, r2),
),
)
ui.Render(grid)
uiEvents := ui.PollEvents()
for {
select {
case e := <-uiEvents:
switch e.ID {
case "q", "<C-c>":
return
case "<Resize>":
payload := e.Payload.(ui.Resize)
grid.SetRect(0, 0, payload.Width, payload.Height)
ui.Clear()
ui.Render(grid)
}
}
}
}
Thank you.
Hi everyone,
I adapted the grid example to show you something strange:
yields this result in which the left box is one character short, so that there is a one character gap between the boxes:
Is this a bug or some strange side effect?
Best, Andreas