awesome-gocui / gocui Goto Github PK
View Code? Open in Web Editor NEWThis project forked from jroimartin/gocui
Minimalist Go package aimed at creating Console User Interfaces.
License: BSD 3-Clause "New" or "Revised" License
This project forked from jroimartin/gocui
Minimalist Go package aimed at creating Console User Interfaces.
License: BSD 3-Clause "New" or "Revised" License
Just a FYI, you might want to update the go-runewidth version to the latest as it at least fix the width of a bunch a characters. Those bugs tends to be quite annoying to track down.
Demonstrated using _examples/mouse.go
The fix displayed above was done by adding a View.RemoveCursor
method to set the cursor position to (-1, -1)
, which was called during Gui.onKey
on the last view selected by the mouse.
Patch File (as .txt
due to GitHub restrictions)
This implementation is presumeably a bad idea due to setting the cursor position to an invalid point, so other ideas would be appreciated.
Just gonna throw it out here, Termbox-Go is no longer maintained by NSF as we probably all know.
This made me wonder if it might be time for us to switch to a different library.
For example TCell. In #41 we discussed briefly about the Shift-Enter problem and how we could fix this. This keybind would be possible with TCell.
Hope to get feedback on this thought
It would be nice if there was Hide, Unhide view methods like in that unmaintained repo in this commit: grafov@dfc721a
This is a heads up that gocui appears to trigger a bug in Go 1.13 (at least rc1), so if folks come to this repo and complain about crashes, you'll know what's happening.
The issue is reported upstream at golang/go#33841.
Feel free to close this issue any time once you've seen it.
Describe the bug
So this is pretty simple to replicate and test, but \x1b[1m \x1b[31m test
this string will not be bold, which it should, based on ANSI standards. the first ANSI styling is overwritten by the second, however i don't use any reset flag so it shouldn't.. the following two strings should be identical, but they are not: \x1b[1m\x1b[31m test
and \x1b[1;31m test
.
YOu can easily test the expected output by using echo -e "\x1b[1m \x1b[31m test"
- it basically seems like gocui overwrites the current color scheme/settings at every call, which IMO is a bug. Not sure if it's a feature. hehe
Environment (please complete the following information):
I have an editable field in my UI for users to enter a description for what they're doing, and text wrapping is turned on. When I retrieve and print the buffer as a string at the end, there's a new line where the text wrapped in the UI.
Here's my code for the view:
if v, err := g.SetView("Description", 0, titleHeight+1, twothrdwiDth-1, titleHeight+1+descHeight, 0); err != nil {
v.Highlight = false
v.Frame = true
v.Title = " Description "
v.SelBgColor = gocui.ColorRed
v.SelFgColor = gocui.ColorBlack
v.Editable = true
v.Wrap = true
}
Describe the feature you'd like
I would like to be able to bind functions to the following combinations:
Context
The Alt key seems to be the only available modifier (gocui.ModAlt
) and some Ctrl key combinations are realized as special keys (gocui.KeyCtrlC
). The Shift key combinations don't seem to be bindable at all.
Is there a reason why is there a different interface for different modifiers? Would it be possible to unify this? Is this connected to some underlying issue with termbox?
Thank you for your work
Describe the feature you'd like
The current gocui dosn't work in the docker container's endpoint because the termbox cannot get terminal window size when run the container.
Describe alternatives you've considered
Improve get terminal window size like as follows.
When we use the container must to be wait SIGWINCH.
Additional context
We have to improve the termbox?
Or gocui?
I want to discussion.
A long time ago in a galaxy far far away, go got a new way of dealing with errors (see their blog.
I think this would a great feature to add to our codebase.
What do you guys think?
@mjarkk @jesseduffield @skanehira
Describe the bug
Arrow keys aren't moving cursor properly in view?
To Reproduce
Steps to reproduce the behavior:
On a view with editable text in it
Expected behavior
Text should be entered under the cursor. It seems like the left and right arrows work properly, however up and down arrows move cursor either left or right by one char rather than up or down.
Screenshots
If applicable, add screenshots to help explain your problem.
Environment (please complete the following information):
Additional context
Trying to pop up a view, clear it of any cruft, populate it with a string, and move the cursor to the end of the string. I tried making a func moveCursorToEnd() to try and move the cursor to the end of a view to get around this, however the func is also causing the same issue
https://github.com/Rudi9719/kbtui/tree/bugs/edit-cursor
Describe the feature you'd like
Have jesseduffield/gocui (master) get merged into this fork
jesseduffield has made some good changes to gocui so his work in gocui would be a nice adition
Additional context
On the old pr where some important comments: https://github.com/awesome-gocui/gocui-old/pull/2
Describe the feature you'd like
The ability to clear out the internal buffers either up to the point that the data is being displayed again, or to some arbitrary point provided in the constructor.
There was an issue for something like this on the original repo: jroimartin#103 and an associated PR: jroimartin#104
Describe alternatives you've considered
Ive tried doing this myself with Clear()
and an Fprintf
:
_, y := dataView.Size()
if dataView.LinesHeight() > y*2 {
lines := getLast(dataView.BufferLines(), y*1)
dataView.Clear()
dataView.Title = fmt.Sprintf("cleanup done at %s", time.Now())
fmt.Fprint(dataView, strings.Join(lines, "\n"))
}
// ----------------------
func getLast(ls []string, last int) []string {
out := make([]string, 0, last)
if len(ls) < last {
// fast path, we're not trimming anything
copy(out, ls)
return out
}
// we need to chomp
copy(out, ls[len(ls)-last:])
return out
}
But Clear()
seems far to slow to make this work seamlessly. Not to mention that this requires significant extra processing and memory usage to convert the lines out of their internal representation and back.
Reflection magic:
dv := reflect.Indirect(reflect.ValueOf(dataView))
buffer := dv.FieldByName("lines")
buffer = reflect.NewAt(buffer.Type(), unsafe.Pointer(buffer.UnsafeAddr())).Elem()
l := buffer.Len()
buffer.Set(buffer.Slice(l-y, l))
tainted := dv.FieldByName("tainted")
tainted = reflect.NewAt(tainted.Type(), unsafe.Pointer(tainted.UnsafeAddr())).Elem()
tainted.Set(reflect.ValueOf(true))
dataView.Title = fmt.Sprintf("cleanup done at %s", time.Now())
}
}
I dont think I really need to point out the issues with this approach. It does work, but reflection to this degree is in general a dangerous idea, and is brittle at best.
Additional context
The use case here is a long running TUI that is constantly written to, for me specifically that is for my game management IRC bot's TUI. As that has near constant writes from game server logs.
I was using jroimartin/gocui for a while and recently migrated to this fork.
When I type in one field of my gui, I intend to update another field according to what I wrote. I use a keybinding for this, effectively for each alphanumeric character I type.
for _, c := range "{};=<>()[]'\"/\\-+:abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789" { g.SetKeybinding("Title", c, gocui.ModNone, create_update_titleBuff(c)) }
create_update_titleBuff writes the appropriate characters to each field I'm looking to edit
This no longer seems to be working. There is no error when setting the keybinding, but the create_update_titleBuff() does not seem to actually be called -- the other functionality within that function isn't happening. Instead, it appears as if I'm just typing into the Title field.
Describe the bug
After converting from jroimartin/gocui to awesome-gocui (adding params to g.NewGui(), and g.SetView()) my projectnow exits cleanly upon opening rather than starting the main loop.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
TUI with 4 views should appear, and populate with text as they did with jroimartin/gocui
Screenshots
N/A
Environment (please complete the following information):
Additional context
https://github.com/Rudi9719/kbtui/tree/awesome-gocui
I began migrating to this (maintained) fork of gocui to implement features that were missing from the original, however it looks like it just closes after gocui.NewGui()
it doesn't return the normal tuple, and just exits.
I'll create a branch and rename everything in there,
I'm migrating from the original gocui to this awesome community maintained version. In the process, I noticed new parameters for NewGui()
and SetView()
. Looking at the code, it's not super obvious what this overlapping is about and how it could/should be used.
Could you explain a little bit what it is about and maybe give a small example?
Thank you
This is a great project and I am really glad you guys are still supporting it and adding some really useful features. I was fiddling about with my app the recently and I noticed that a couple of functions don't seem to be working properly. Sorry if I have misunderstood anything but I am still fairly new to golang
Both the following functions are part of the view class in edit.go:
EditGoToEndOfLine if already on the last line loops over MoveCursor until the cursor no longer changes. However, when it reaches the end of the view, it is the origin that changes not the cursor. Therefore, it does not actually go to the end of the line but the end of the view
EditGoToStartOfLine does much the same in that it sets cursor to zero but does nothing to the origin. This means that if origin is not zero, it will not go back to the start of the line
Steps to reproduce the behavior:
Origin should also be updated within these functions to go to the true start/end of line
I think simple solutions would be:
func (v *View) EditGotoToStartOfLine() {
_, cursorY := v.Cursor()
_, originY := v.Origin()
v.SetCursor(0, cursorY)
v.SetOrigin(0, originY)
}
func (v *View) EditGotoToEndOfLine() {
_, cursorY := v.Cursor()
_, originY := v.Origin()
if line, err := v.Line(cursorY + originY); err == nil {
width, _ := v.Size()
if len(line) < width {
v.SetCursor(width, cursorY)
} else {
v.SetCursor(width-1, cursorY)
v.SetOrigin(len(line) - (width - 1), originY)
}
}
}
Describe the bug
SetCursor()
function working on top of the view buffer lines can cause panics when mouse control is turned on.
To Reproduce
Steps to reproduce the behavior:
go run _examples/mouse.go
Expected behavior
It shouldn't panic.
Additional context
SetCursor
function was used before from outside "world" point of view with just knowledge of the View
dimension. This is easy to deal with as all terminals/consoles have specific dimension, Views
are setup according to it, and application can points to it.
If it's used with the knowledge of the view buffer content, programs need to be updated to consider it and not point to the position which would be outside of this buffer.
Even in gocui
mouse position is used relative to the terminal window and View
and registering the location without any knowledge of the buffer content.
Proposed solution could be, that there will be another two functions SetCursorInBuffer
, CursorInBuffer
, which would act as the current SetCursor
and Cursor
and the original functions would be enhanced to translate the position from buffer position to "real" position on the screen.
This way SetCursor
would use original View
dimension to check for invalid point and the new functions could be used in edit.go
to work with the buffer as it is right now.
Describe the bug
I have a Gui without a currentView and only with global keybindings. I ran into the problem that keybindings based on rune
would not work for me while keybindings based on gocui.Key
were still working. I traced the issue a bit and found that the reason seems to be that no current view is set. I describe this under "Additional Context" below. The minimum viable reproduction is based upon one of the files in _example/
.
To Reproduce
Steps to reproduce the behavior:
_examples/table.go
if err := g.SetKeybinding("", 'q', gocui.ModNone, quit); err != nil {
log.Panicln(err)
}
go run table.go
q
keyExpected behavior
With q
pressed, the application should quit.
Environment (please complete the following information):
Additional context
I chose table.go
as it is the only example without a call to func (g *Gui) SetCurrentView(name string)```. If you amend the method
func (t *Table) Layout(g *gocui.Gui) errorfunction in
table.gowith a call to
SetCurrentView` right before the return at the end like in the following code snippet, then the keypress will work.
g.SetCurrentView(t.name)
My layman's guess would be that the culprit is in https://github.com/awesome-gocui/gocui/blob/master/gui.go#L790:
v
is nil
in the call to execKeybindings
, because g.currentView
is nil
in the call to onKey
in https://github.com/awesome-gocui/gocui/blob/master/gui.go#L745kb.ch
is not 0, but is set to a rune.globalKb
is never assigned a non-nil value, and execKeybinding
is never called for the global keybinding.Describe the feature you'd like
To make Gocui a truly amazing project, we need an icon. If anyone knows a graphics designer who would do this for an opensource project (to have another piece of art added to their portfolio), please do let us know.
Describe alternatives you've considered
Making it myself but I am absolutely terrible with graphics.
Additional context
/
Describe the bug
So i've been trying to produce italic font for quite some time, and trying to debug why it wouldn't display on my gocui application, but it seems to be a general problem with gocui - and I realized that you don't use neither in your example - so I realized the problem might be on your end. But i cant fathom what can possibly be the cause of it.
To Reproduce
the following doesn't use strikethrough or italic on my end.
// Copyright 2014 The gocui Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package main
import (
"fmt"
"log"
"github.com/awesome-gocui/gocui"
)
func main() {
g, err := gocui.NewGui(gocui.OutputNormal, true)
if err != nil {
log.Panicln(err)
}
defer g.Close()
g.SetManagerFunc(layout)
if err := g.SetKeybinding("", gocui.KeyCtrlC, gocui.ModNone, quit); err != nil {
log.Panicln(err)
}
if err := g.MainLoop(); err != nil && !gocui.IsQuit(err) {
log.Panicln(err)
}
}
func layout(g *gocui.Gui) error {
maxX, maxY := g.Size()
if v, err := g.SetView("colors", maxX/2-7, maxY/2-12, maxX/2+7, maxY/2+13, 0); err != nil {
if !gocui.IsUnknownView(err) {
return err
}
for i := 0; i <= 7; i++ {
for _, j := range []int{1, 3, 4, 7, 9} {
fmt.Fprintf(v, "Hello \033[3%d;%dmcolors!\033[0m\n", i, j)
}
}
if _, err := g.SetCurrentView("colors"); err != nil {
return err
}
}
return nil
}
func quit(g *gocui.Gui, v *gocui.View) error {
return gocui.ErrQuit
}
Expected behavior
ANSI italic and strikethrough works.
Screenshots
image <- this picture should italic and strikethrough, but only has underscore and reverse
Environment (please complete the following information):
I found this problem when I was trying to update my application to use gocui version v1.0.0-beta-2
.
I had there code like this (where v
is referencing gocui.View
):
v.Clear()
v.SetCursor(0, 0)
The View
which is there, is 1 line in height. It's basically a command prompt and after hitting enter, the prompt will be cleared and cursor set to the beginning.
I know that I don't have error checks :) but the point is, that after the upgrade the function SetCursor
was changed like this:
Line 239 in a0f5add
Now after View.Clear
(which sets v.lines = nil
) I can't really run View.SetCursors(0, 0)
. Easy fix for me in this situation is just to move SetCursor
above Clear
, but I'm just wondering if this shouldn't be fixed in gocui
too.
@mjarkk I think you did these changes regarding the line buffer. So I would like to hear your opinion. Before the check was like this:
if x < 0 || x >= maxX || y < 0 || y >= maxY {
Which makes it work, because the maxY
is 1 in my case. And it kinda makes sense, because you could point anywhere into the view this way.
So I'm curious about the reason to limit the SetCursor
this way, as it appears that before it was possible to set it in the range of the View
dimension while after the change the limitation is to the lines in the line buffer.
Describe the feature you'd like
In the readme or in docs add a section about this fork with information about why we forked it and a number of important changes this fork has compared to jromartin's
Describe alternatives you've considered
/
Additional context
In general it would be nice to have better documentation, related to (#12).
Hi,
I wanted to ask, if I could create a PR for adding frame color for seperate views. Basically it would add new color attribute to view for frame and title color.
I had created a fork with that change which I'm using in my project. But I was hoping something like that could be added to this repo too.
Here is my commit in the forked repo: dankox@a7e8d20
Describe the bug
Put the cursor on the alphabet and input multi-byte it's not inserted correctly.
To Reproduce
Steps to reproduce the behavior:
ゴリラ
Expected behavior
Multi-byte can be inserted correctly.
Environment (please complete the following information):
Additional context
If nothing there on cursor, it will be inserted correctly
Describe the bug
Mouse clicks inside neovim terminal are delayed until the next system event.
Mouse handling works fine with jroimartin/gocui
To Reproduce
Steps to reproduce the behavior:
:term
MouseLeft
keybindingExpected behavior
The mouse click should be detected immediately
Environment (please complete the following information):
Context
g.Update
does not helpMouseRelease
is trigged (although not on release)`Describe the bug
Apparently, SelFgColor and SelBgColor are not used anymore in highlighted frames. The original SetRune implementation checked the highlight state, and the current SetRune only bolds the fgColor, as seen in this commit d9a7952
To Reproduce
v.Highlight = true
v.SelFgColor = gocui.ColorYellow
Observe the highlighted color is only bolded.
Expected behavior
I expected to be able to use SelFgColor and SelBgColor to set the color. I'm under the impression that using SetHiglight and manually tracking the highlight state is what you expect users to do, then? Otherwise, I would like to bolden the text, but also check if the SelFgColor and SelBgColor are not ColorDefault, and if so, use them too.
What do you think?
Additionally, the documentation is then out of date. I understand this project was taken over to resurrect it (I switched today from jroimartin/gocui to this one) and I don't get why the documentation-- even on the main page lacking the overlap flag-- has not been updated.
Describe the feature you'd like (Happy to PR this feature)
tcell supports a simulated screen, this allows you to write unit tests which provide input and then assert about the content drawn on the screen.
https://github.com/gdamore/tcell/blob/master/sim_test.go
Adding in this feature by either exposing the tcell simulated screen or a wrapper to abstract it but allow input of keys and validation of the resulting content drawn would help building testable UI apps.
Describe alternatives you've considered
Currently I do some horrible things in our CI pipeline to create a "real" screen on the CI box then spin up a xterm instance and pipe the results back.
Additional context
Here is an example of another tcell based project using the simulated screen to write some nice tests. https://github.com/zyedidia/micro/blob/c0907bb58e35ee05202a78226a2f53909af228ca/cmd/micro/micro_test.go#L183
Describe the feature you'd like
Some parts of the code are not yet codumentated. We should add documentation to everything.
Describe alternatives you've considered
/
Additional context
After #8
In the testing code, we include a sleep and hope all the gui events have been handled. It would make tests simpler (and more deterministic) if there was an API to call and return when all pending events have been handled.
Describe the bug
When running the example in Docker it crashes with the error
fatal error: unexpected signal during runtime execution
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Running example
Environment (please complete the following information):
Additional context
File compiled with
CGO_ENABLED=0 GOOS=linux go build -a -installsuffix "static" -o main .
Anyone else had this issue? My keybinding for gocui.KeyCtrlTilde doesn't seem to be running
if err := g.SetKeybinding("", gocui.KeyCtrlTilde, gocui.ModNone, ui.plan_move_week_quick_enter(rc, 1)); err != nil {
return fmt.Errorf("Failed to set keybinding: %s", err)
}
if err := g.SetKeybinding("", gocui.KeyCtrl2, gocui.ModNone, ui.plan_move_week_quick_enter(rc, 2)); err != nil {
return fmt.Errorf("Failed to set keybinding: %s", err)
}
func (ui *PlanningUI) plan_move_week_quick_enter(rc *Radar, numForward int) func(g *gocui.Gui, v *gocui.View) error {
return func(g *gocui.Gui, v *gocui.View) error {
log.Debugf("Moving %d weeks forward", numForward)
}
}
When I hit ctrl+2, I get the log. when I hit ctrl+~, nothing happens.
Parse() fails process Alt+
and Shift+
combinations. See the code below.
package main
import (
"github.com/awesome-gocui/gocui"
"github.com/kr/pretty"
)
func main() {
pretty.Println(gocui.Parse("q"))
pretty.Println(gocui.Parse("ctrl+q"))
pretty.Println(gocui.Parse("shift+q"))
pretty.Println(gocui.Parse("alt+q"))
}
This outputs,
int32(113) gocui.Modifier(0) nil
gocui.Key(17) gocui.Modifier(0) nil
nil gocui.Modifier(0) &errors.errorString{s:"no such keybind"}
nil gocui.Modifier(0) &errors.errorString{s:"no such keybind"}
Another strange behavior is that https://pkg.go.dev/github.com/awesome-gocui/gocui#Parse should return modifier separately from Key,
but it for Ctrl+
there is no Modifier and it is mixed into the key.
To Reproduce
https://play.golang.org/p/UPWMipkgA9U
Expected behavior
Key('q') Modifier() nil
Key('q') Modifier('ctrl') nil
Key('q') Modifier('shift') nil
Key('q') Modifier('alt') nil
Describe the bug
When trying to use Fprintf() on a view using the following code, nothing appears. It seems as if the view is rendering outside of the actual frame?
func printToView(viewName string, message string) {
g.Update(func(g *gocui.Gui) error {
updatingView, err := g.View(viewName)
if err != nil {
return err
}
if config.Basics.UnicodeEmojis {
message = emojiUnicodeConvert(message)
}
fmt.Fprintf(updatingView, "%s\n", message)
return nil
})
}
To Reproduce
Steps to reproduce the behavior:
Expected behavior
The printed string would appear inside of the view being updated
Environment (please complete the following information):
Additional context
Not sure if this is due to recent changes or not; there were 3 code changes I had to make in order to get the code to build with the updated version of gocui. Seems like if I output enough to Fprintf() it'll EVENTUALLY show what I originally printed, but there's a hidden buffer of things I've printed waiting to actually render.
As it has now been 2 months since the creation of the v1.0.0 pre-release versions and there has only been 1 issue should we release v1.0.0?
@dankox What are your thoughts?
Describe the bug
when i run hello example somting wrong
To Reproduce
run hello example
Expected behavior
correct print
Environment (please complete the following information):
Linux version 5.10.7-3-MANJARO (builduser@LEGION) (gcc (GCC) 10.2.0, GNU ld (GNU Binutils) 2.35.1) #1 SMP PREEMPT Fri Jan 15 21:11:34 UTC 2021
Describe the feature you'd like
Sometime there is just not enough room in the terminal, or two views are
closely related. This calls for a new thing called a "tab". Just like with your browser, a tab holds different information but does not require you to start up a new window.
Describe alternatives you've considered
Manual tabbing, but it is a pain for the developer to create this each and every time.
Additional context
The title of the view would look like this: ─Tab one / Tab two─
. and the current tab would be highlighted.
Describe the feature you'd like
For building the examples and for shipping, we should add the go mod files. (without vendor)
Describe alternatives you've considered
/
Additional context
After #8
Describe the feature you'd like
As with any project, testing gocui is important. We should set up tools like circle-ci and codecov to automaticly check some things.
Describe alternatives you've considered
Testing manually. This is too much work with too many points where it can go wrong.
Additional context
/
Describe the bug
When the cursor is on the last character of a line, and v.MoveCursor(1,0,false) is executed, the cursor position (returned by v.Cursor) is equal to then len of the line, which is out of bound.
To Reproduce
See above
Expected behavior
When v.MoveCursor(1,0,false) is executed and the x is equal to the last index of the line, y should be increase, and x reset to 0. The happens correctly the next execution of v.MoveCursor(1,0,false).
Screenshots
NA
Environment (please complete the following information):
MacOS 10.14
Additional context
NA
Describe the feature you'd like
I want to add some components into gocui to create modal, form, etc easily
Describe alternatives you've considered
I made the components.
How about merging this into gocui?
https://github.com/skanehira/gocui-component
Describe the bug
The first line of the UI is cut off, and an extra empty line is added to the end when running on MinGW.
To Reproduce
Steps to reproduce the behavior:
awesome-gocui/gocui
(v1.0.1
)g.SetView("test", 0, 0, maxX-1, maxY-1, 0)
to create a view that should surround the terminalwinpty
, see #43)Expected behavior
A border lining the terminal
Screenshots
scrolling up shows that the first line is indeed cut off
Environment (please complete the following information):
Additional context
Could not reproduce issue on native linux
Issue is not present when version v0.6.1-0.20191115151952-a34ffb055986
is pinned (version used by git bug
) (a34ffb0)
Describe the bug
Unable to render UI when running in a MinGW environment
To Reproduce
git-bug
git bug user create
git bug termui
also see MichaelMure/git-bug#222
Expected behavior
Console UI is shown
Screenshots
Attached in reproduce
Environment (please complete the following information):
Additional context
NA
Firstly, thanks for all the work on the fork it's awesome!
Describe the feature you'd like
I'd like to have methods which allow me to use the underlying screen
.
I build out a terminal based browser for Azure Cloud which lets you browse to an item and then open your favourite editor to edit it (nano, vi) then once you save and close the editor the update is pushed and the gocui
UI redrawn.
With the old gocui
we had our own fork which exposed out Flush
for us to do this, with the tcell
based version I can do the same once I have access to the screen
object from tcell_driver.go
Would you be open to a PR to allow get/set
public funcs on the screen
to enable this and other complex scenarios?
Describe alternatives you've considered
Alternative would be not to expose screen but allow public funcs for
func TcellInit() error {
return tcellInit()
}
func TCellClose() {
screen.Fini()
}
Additional context
Here is my PR and a gif showing the flow the change allows.
I am trying to clean up some technical debt of my solid state drive, among which is the patch awesome-gocui/keybinding#3 that I've made to allow https://github.com/wagoodman/dive quit with a single key shortcut like q
.
I am asking, because tests for its repo are failing awesome-gocui/keybinding#4
And in addition there is also https://github.com/awesome-gocui/gocui/blob/master/keybinding.go in this repo, also with Parse
function.
Expected behavior
I would expect a syntax and example comparison between two libs, or if https://github.com/awesome-gocui/keybinding is already merged, to see a deprecation notice there.
I would like to know if it's possible to access another view from an EditorFunc. Basically, depending on what has been entered in the view with the editor, I would like to update a different view.
As a parameter to the EditorFunc, the Gui isn't passed to be able to get a reference to other views, and I can't see how to get it without keeping the Gui in a global.
I guess the other option is to create a Keybinding for all the keys and runes, and implement an editor like that?
Thanks
Describe the feature you'd like
A easier way to generate UI,
Currently everything needs to be set with fixed position but it's quite a bit of work to implement this in a new app when having a advanced UI.
I personally like the CSS grid layout for creating UIs and i think the underlying idea of grid layouts fits GoCui really well because the base concept is really easy and it's made for not nested widgets (Most ui managers have UI in UI in UI what is not used in gocui and in CSS grid).
Describe alternatives you've considered
/
Additional context
The origin repo also had in issue about this: jroimartin#183
Also as mentions in the original issue it might be a good idea to put this in a separate repo.
When #8 is merged i would like to work on this thought i want to hear first the thoughts of others.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.