summaryrefslogtreecommitdiff
path: root/cmds/console-hello-world/newJ.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2022-11-09 08:38:50 -0600
committerJeff Carr <[email protected]>2022-11-09 08:38:50 -0600
commited382bec55be25039e4dcf020d1512139855c9bb (patch)
treefb3a671fd07c03a75cedb8d56b2241108cd792ff /cmds/console-hello-world/newJ.go
parentb410d0fd083ee89eed410cda2123a22cddcd3f44 (diff)
cleanup of the example commands. more plugin workv0.4.6
add a button in two plugins at the same time! added a button in andlabs/ui & gocui attempt a common widget struct between wit/gui & the plugins start handling missing plugins rename Makefile command examples remote examples used for testing filename improvements golang src code uses lowercase and _ in filenames fix crash when button click function == nil fix wrong name 'gocli' -> 'gocui' keep fighting with goreadme generated README.md Signed-off-by: Jeff Carr <[email protected]>
Diffstat (limited to 'cmds/console-hello-world/newJ.go')
-rw-r--r--cmds/console-hello-world/newJ.go46
1 files changed, 0 insertions, 46 deletions
diff --git a/cmds/console-hello-world/newJ.go b/cmds/console-hello-world/newJ.go
deleted file mode 100644
index 47c7439..0000000
--- a/cmds/console-hello-world/newJ.go
+++ /dev/null
@@ -1,46 +0,0 @@
-// 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 (
- "errors"
- "fmt"
- "log"
- "strings"
-
- "github.com/awesome-gocui/gocui"
-)
-
-var topX int = 2
-var bottomX int = 20
-var topY int = 2
-var bottomY int = 7
-
-func newJ(g *gocui.Gui) error {
- // maxX, maxY := g.Size()
- name := fmt.Sprintf("jcarr %v test ", idxView)
- v, err := g.SetView(name, topX, topY, bottomX, bottomY, 0)
- if err == nil {
- return err
- }
- if !errors.Is(err, gocui.ErrUnknownView) {
- return err
- }
-
- v.Wrap = true
- fmt.Fprintln(v, name)
- fmt.Fprintln(v, strings.Repeat("foo\n", 2))
- // fmt.Fprintln(v, strings.Repeat(name+" ", 30))
- log.Println("newJ added a new view", v.Name())
-
- if _, err := g.SetCurrentView(name); err != nil {
- return err
- }
-
- views = append(views, name)
- curView = len(views) - 1
- idxView += 1
- return nil
-}