Thanks to visit codestin.com
Credit goes to github.com

Skip to content

new dui: drawfcall.New: exec: "devdraw": executable file not found in $PATH #20

@hellojukay

Description

@hellojukay
hellojukay@local test $ go env
GO111MODULE="on"
GOARCH="amd64"
GOBIN=""
GOCACHE="/home/hellojukay/.cache/go-build"
GOENV="/home/hellojukay/.config/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
package main

import (
	"flag"
	"io"
	"log"
	"os"

	"github.com/mjl-/duit"
)

func check(err error, msg string) {
	if err != nil {
		log.Fatalf("%s: %s\n", msg, err)
	}
}

func main() {
	log.SetFlags(0)
	flag.Usage = func() {
		log.Println("usage: duitedit file")
		flag.PrintDefaults()
	}
	flag.Parse()
	args := flag.Args()
	if len(args) != 1 {
		flag.Usage()
		os.Exit(2)
	}

	f, err := os.Open(args[0])
	check(err, "open")

	dui, err := duit.NewDUI("ex/edit", nil)
	check(err, "new dui")

	edit, err := duit.NewEdit(f)
	check(err, "new edit")

	print := &duit.Button{
		Text: "print",
		Click: func() (e duit.Event) {
			rd := edit.Reader()
			n, err := io.Copy(os.Stdout, rd)
			if err != nil {
				log.Printf("error copying text: %s\n", err)
			}
			log.Printf("copied %d bytes\n", n)
			return
		},
	}

	dui.Top.UI = &duit.Box{Kids: duit.NewKids(print, edit)}
	dui.Render()

	for {
		select {
		case e := <-dui.Inputs:
			dui.Input(e)

		case err, ok := <-dui.Error:
			if !ok {
				return
			}
			log.Printf("duit: %s\n", err)
		}
	}
}
hellojukay@local test $ go build main.go 
hellojukay@local test $ ./main 
usage: duitedit file
hellojukay@local test $ ./main main.go 
new dui: drawfcall.New: exec: "devdraw": executable file not found in $PATH

pure golang ???????

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions