aboutsummaryrefslogtreecommitdiffstats
path: root/gosrc/main.go
diff options
context:
space:
mode:
authorsalaaad2 <arthurdurant263@gmail.com>2022-05-01 22:35:20 +0200
committersalaaad2 <arthurdurant263@gmail.com>2022-05-01 22:35:20 +0200
commit752f14ae8f64e22890c7ab3ffef0a8b9e751f4b2 (patch)
tree21ad655c41fc5bb286d7fa796d52bab9af28dcdb /gosrc/main.go
parentrefactor to to make space for multiple views/workspaces (diff)
downloadsmith-752f14ae8f64e22890c7ab3ffef0a8b9e751f4b2.tar.gz
smith-752f14ae8f64e22890c7ab3ffef0a8b9e751f4b2.tar.bz2
smith-752f14ae8f64e22890c7ab3ffef0a8b9e751f4b2.tar.xz
smith-752f14ae8f64e22890c7ab3ffef0a8b9e751f4b2.tar.zst
smith-752f14ae8f64e22890c7ab3ffef0a8b9e751f4b2.zip
workspaces
Diffstat (limited to 'gosrc/main.go')
-rw-r--r--gosrc/main.go13
1 files changed, 6 insertions, 7 deletions
diff --git a/gosrc/main.go b/gosrc/main.go
index 8e6417a..4239322 100644
--- a/gosrc/main.go
+++ b/gosrc/main.go
@@ -16,12 +16,6 @@ import (
ui "github.com/gizak/termui/v3"
)
-type nodeValue string
-
-func (nv nodeValue) String() string {
- return string(nv)
-}
-
func main() {
// get user config from json file
config_path := "./config.json"
@@ -45,7 +39,7 @@ func main() {
return
}
-// draw stuff
+// draw stuff and get input
func ui_loop(config Config) error {
if err := ui.Init(); err != nil {
log.Fatal("error: failed to initialize termui", err)
@@ -84,6 +78,11 @@ func ui_loop(config Config) error {
active_grid.tree.CollapseAll()
case "<Enter>":
active_grid.handleEnter(config)
+ case "2":
+ active_grid = createTradeWorkspace(config)
+ ui.Clear()
+ ui.Render(active_grid.grid)
+ ui_events = ui.PollEvents()
}
case <-ticker:
ticker_count++