Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Text next to a frame is not displayed #131

Open
imishinist opened this issue May 15, 2024 · 0 comments
Open

[BUG] Text next to a frame is not displayed #131

imishinist opened this issue May 15, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@imishinist
Copy link

imishinist commented May 15, 2024

Describe the bug

When the ASCII option of gocui.Gui is false, the characters on the right side of the left frame seem to disappear.
Perhaps this occurs because the frame is a wide string, but the View is being drawn from next to it.

To Reproduce
Steps to reproduce the behavior:

  1. compile code
  2. run
reproduce code

package main

import (
	"errors"
	"fmt"
	"log"

	"github.com/awesome-gocui/gocui"
)

func generateSingleParamView(g *gocui.Gui, name string, body string, coords []int) error {
	v, err := g.SetView(name, coords[0], coords[1], coords[2], coords[3], 0)
	if err != nil && err != gocui.ErrUnknownView {
		return err
	}

	v.Title = name
	fmt.Fprint(v, body)
	return nil
}

func main() {
	g, err := gocui.NewGui(gocui.OutputNormal, false)
	if err != nil {
		log.Fatal(err)
	}
	defer g.Close()

	// g.ASCII = true

	g.SelBgColor = gocui.ColorCyan
	g.BgColor = gocui.ColorCyan
	g.SelFgColor = gocui.ColorBlue
	g.FgColor = gocui.ColorBlue
	g.FrameColor = gocui.ColorRed
	g.SelFrameColor = gocui.ColorRed

	g.SetManagerFunc(layout)
	maxX, maxY := g.Size()
	generateSingleParamView(g, "param1", "default1", []int{0, 0, maxX, maxY})

	if err := g.SetKeybinding("", gocui.KeyCtrlC, gocui.ModNone, quit); err != nil {
		log.Fatal(err)
	}
	if err := g.MainLoop(); err != nil && !errors.Is(err, gocui.ErrQuit) {
		log.Fatal(err)
	}
}

func layout(g *gocui.Gui) error {
	return nil
}

func quit(g *gocui.Gui, v *gocui.View) error {
	return gocui.ErrQuit
}

Expected behavior
I'm hoping that the adjacent text will show up without having to set the ASCII option to false!

Screenshots

out

Environment (please complete the following information):

  • OS: ArchLinux
  • Version github.com/awesome-gocui/gocui v1.1.0

Additional context
I am trying to solve the problem of this tool not displaying properly.

knqyf263/pet#305

@imishinist imishinist added the bug Something isn't working label May 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant