diff options
author | salaaad2 <arthurdurant263@gmail.com> | 2022-04-01 21:33:45 +0200 |
---|---|---|
committer | salaaad2 <arthurdurant263@gmail.com> | 2022-04-01 21:33:45 +0200 |
commit | 516b165421855538e10f41919f1fa72e1fa58912 (patch) | |
tree | 81c3f9a6e6af2d84493b87893ed633a470f7cfe0 /main.go | |
parent | 0.0.1.1 (diff) | |
download | smith-516b165421855538e10f41919f1fa72e1fa58912.tar.gz smith-516b165421855538e10f41919f1fa72e1fa58912.tar.bz2 smith-516b165421855538e10f41919f1fa72e1fa58912.tar.xz smith-516b165421855538e10f41919f1fa72e1fa58912.tar.zst smith-516b165421855538e10f41919f1fa72e1fa58912.zip |
hehe
Diffstat (limited to '')
-rw-r--r-- | main.go | 49 |
1 files changed, 0 insertions, 49 deletions
diff --git a/main.go b/main.go deleted file mode 100644 index f01a58f..0000000 --- a/main.go +++ /dev/null @@ -1,49 +0,0 @@ -// SMITH ( // / -// main ( )/ / -// by salade )(/ / -// ________________ ( /) / -// ()__)____________))))) :^} / - -package main - -import ( - "github.com/rivo/tview" -) - -// #include "csrc/smith.h" -// #cgo LDFLAGS: -lsmith -L. -import "C" - -func main() { - smith := tview.NewApplication() - ctogo := C.mr_smith() - - modal := func(p tview.Primitive, width, height int) tview.Primitive { - return tview.NewFlex(). - AddItem(nil, 0, 1, false). - AddItem(tview.NewFlex().SetDirection(tview.FlexRow). - AddItem(nil, 0, 1, false). - AddItem(p, height, 1, false). - AddItem(nil, 0, 1, false), width, 1, false). - AddItem(nil, 0, 1, false) - } - - box := tview.NewBox().SetBorder(true).SetTitle(C.GoString(ctogo)) - - - init_form := tview.NewForm(). - AddDropDown("You are", []string{"Salad", "Salade", "Mr Smith"}, 0, nil). - AddInputField("First Name", "", 20, nil, nil). - AddButton("Save", nil). - AddButton("Quit", func() { - smith.Stop() - }) - - pages := tview.NewPages(). - AddPage("box", box, true, true). - AddPage("form", modal(init_form, 40, 20), true, true) - - if err := smith.SetRoot(pages, true).Run(); err != nil { - panic(err) - } -} |