[GH-ISSUE #406] some error with FLEX #296

Closed
opened 2026-03-04 01:03:42 +03:00 by kerem · 7 comments
Owner

Originally created by @RainFallsSilent on GitHub (Feb 16, 2020).
Original GitHub issue: https://github.com/rivo/tview/issues/406

image How can i get rid of these white patches?
Originally created by @RainFallsSilent on GitHub (Feb 16, 2020). Original GitHub issue: https://github.com/rivo/tview/issues/406 <img width="1668" alt="image" src="https://user-images.githubusercontent.com/19792326/74610044-9c3de600-512a-11ea-8444-cbb43de531d0.png"> How can i get rid of these white patches?
kerem closed this issue 2026-03-04 01:03:43 +03:00
Author
Owner

@RainFallsSilent commented on GitHub (Feb 16, 2020):

	u.flex = tview.NewFlex().
		AddItem(tview.NewFlex().SetDirection(tview.FlexRow).
			AddItem(u.nodesView, 0, 1, false).
			AddItem(u.resultsView, 20, 1, false),
			0, 20, false).
		AddItem(u.detailsView, 20, 1, false)
<!-- gh-comment-id:586735827 --> @RainFallsSilent commented on GitHub (Feb 16, 2020): ``` u.flex = tview.NewFlex(). AddItem(tview.NewFlex().SetDirection(tview.FlexRow). AddItem(u.nodesView, 0, 1, false). AddItem(u.resultsView, 20, 1, false), 0, 20, false). AddItem(u.detailsView, 20, 1, false) ```
Author
Owner

@RainFallsSilent commented on GitHub (Feb 16, 2020):

I don't know if you've come across this before on mac terminal.

<!-- gh-comment-id:586736352 --> @RainFallsSilent commented on GitHub (Feb 16, 2020): I don't know if you've come across this before on mac terminal.
Author
Owner

@tslocum commented on GitHub (Feb 18, 2020):

Have you tried another terminal emulator? I see normal borders on Alacritty+Linux when adding TextViews in place of the widgets you reference but didn't include in your example code. If you share a more complete example application I would be glad to retest.

<!-- gh-comment-id:587559149 --> @tslocum commented on GitHub (Feb 18, 2020): Have you tried another terminal emulator? I see normal borders on Alacritty+Linux when adding TextViews in place of the widgets you reference but didn't include in your example code. If you share a more complete example application I would be glad to retest.
Author
Owner

@RainFallsSilent commented on GitHub (Feb 18, 2020):

@tslocum After my test, it has nothing to do with TextView. As long as you add a flex, this will happen, and the same will happen on iterm2. The code is basically a reference to https://github.com/rivo/tview/blob/master/demos/flex/main.go

<!-- gh-comment-id:587587379 --> @RainFallsSilent commented on GitHub (Feb 18, 2020): @tslocum After my test, it has nothing to do with TextView. As long as you add a flex, this will happen, and the same will happen on iterm2. The code is basically a reference to https://github.com/rivo/tview/blob/master/demos/flex/main.go
Author
Owner

@RainFallsSilent commented on GitHub (Feb 18, 2020):

part of the code:

type statusUI struct {
	status          *Status
	quitNodeView    chan struct{}
	quitResultsView chan struct{}

	nodesView   *tview.TextView
	resultsView *tview.TextView
	detailsView *tview.TextView
	app         *tview.Application
	flex        *tview.Flex
}

func (u *statusUI) Run() error {
	u.updateNodes()
	u.updateResults()
	go u.refreshNodesView()
	go u.refreshResultsView()

	return u.app.SetRoot(u.flex, true).SetFocus(u.flex).Run()
}

func (u *statusUI) initialize() {
	u.app = tview.NewApplication()

	u.initNodesView()
	u.initResultsView()
	u.initDetailsView()

	u.flex = tview.NewFlex().
		AddItem(tview.NewFlex().SetDirection(tview.FlexRow).
			AddItem(u.nodesView, 0, 1, false).
			AddItem(u.resultsView, 20, 1, false),
			0, 20, false).
		AddItem(u.detailsView, 20, 1, false)
}

func (u *statusUI) initNodesView() {
	u.nodesView = tview.NewTextView().
		SetTextColor(tcell.ColorYellow).
		SetScrollable(true).
		SetText("initializing...")
	u.nodesView.SetBorder(true).
		SetTitle("Nodes").SetBorderAttributes(tcell.AttrBold)
	u.nodesView.SetChangedFunc(func() {
		u.app.Draw()
	})
}

func (u *statusUI) initResultsView() {
	u.resultsView = tview.NewTextView().
		SetTextColor(tcell.ColorGreen).
		SetScrollable(true)
	u.resultsView.SetBorder(true).
		SetTitle("Results")
	u.resultsView.SetChangedFunc(func() {
		u.app.Draw()
	})
}

func (u *statusUI) initDetailsView() {
	u.detailsView = tview.NewTextView().
		SetTextColor(tcell.ColorWhite).
		SetScrollable(true)
	u.detailsView.SetBorder(true).
		SetTitle("Details")
}

<!-- gh-comment-id:587591235 --> @RainFallsSilent commented on GitHub (Feb 18, 2020): part of the code: ``` go type statusUI struct { status *Status quitNodeView chan struct{} quitResultsView chan struct{} nodesView *tview.TextView resultsView *tview.TextView detailsView *tview.TextView app *tview.Application flex *tview.Flex } func (u *statusUI) Run() error { u.updateNodes() u.updateResults() go u.refreshNodesView() go u.refreshResultsView() return u.app.SetRoot(u.flex, true).SetFocus(u.flex).Run() } func (u *statusUI) initialize() { u.app = tview.NewApplication() u.initNodesView() u.initResultsView() u.initDetailsView() u.flex = tview.NewFlex(). AddItem(tview.NewFlex().SetDirection(tview.FlexRow). AddItem(u.nodesView, 0, 1, false). AddItem(u.resultsView, 20, 1, false), 0, 20, false). AddItem(u.detailsView, 20, 1, false) } func (u *statusUI) initNodesView() { u.nodesView = tview.NewTextView(). SetTextColor(tcell.ColorYellow). SetScrollable(true). SetText("initializing...") u.nodesView.SetBorder(true). SetTitle("Nodes").SetBorderAttributes(tcell.AttrBold) u.nodesView.SetChangedFunc(func() { u.app.Draw() }) } func (u *statusUI) initResultsView() { u.resultsView = tview.NewTextView(). SetTextColor(tcell.ColorGreen). SetScrollable(true) u.resultsView.SetBorder(true). SetTitle("Results") u.resultsView.SetChangedFunc(func() { u.app.Draw() }) } func (u *statusUI) initDetailsView() { u.detailsView = tview.NewTextView(). SetTextColor(tcell.ColorWhite). SetScrollable(true) u.detailsView.SetBorder(true). SetTitle("Details") } ```
Author
Owner

@rivo commented on GitHub (Feb 19, 2020):

This does look like a problem with your character set. Check out #281 and related issues and let me know if this helps you.

If it doesn't, please post a short, full code example that I can run that illustrates your problem.

<!-- gh-comment-id:588238708 --> @rivo commented on GitHub (Feb 19, 2020): This does look like a problem with your character set. Check out #281 and related issues and let me know if this helps you. If it doesn't, please post a short, full code example that I can run that illustrates your problem.
Author
Owner

@RainFallsSilent commented on GitHub (Feb 20, 2020):

@rivo thanks a lot, haha it's ok now.

export LC_CTYPE="en_US.UTF-8"
image
<!-- gh-comment-id:588672661 --> @RainFallsSilent commented on GitHub (Feb 20, 2020): @rivo thanks a lot, haha it's ok now. ``` export LC_CTYPE="en_US.UTF-8" ``` <img width="1656" alt="image" src="https://user-images.githubusercontent.com/19792326/74910867-6cc2fe00-53f6-11ea-9917-7cc63bc042cc.png">
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/tview#296
No description provided.