panic() does os.Exit()
Signed-off-by: Jeff Carr <jcarr@wit.com>
This commit is contained in:
parent
3f54db0421
commit
9dde5d994a
|
@ -12,7 +12,6 @@ import (
|
|||
"go.wit.com/widget"
|
||||
)
|
||||
|
||||
|
||||
func Add(n *tree.Node) {
|
||||
log.Log(INFO, "Add() END =", n.WidgetType, n.String())
|
||||
if n == nil {
|
||||
|
|
9
stdin.go
9
stdin.go
|
@ -9,6 +9,7 @@ import (
|
|||
"strings"
|
||||
|
||||
"go.wit.com/log"
|
||||
"go.wit.com/toolkits/tree"
|
||||
"go.wit.com/widget"
|
||||
)
|
||||
|
||||
|
@ -37,6 +38,7 @@ func simpleStdin() {
|
|||
log.Println("Stack trace:")
|
||||
debug.PrintStack()
|
||||
me.myTree.SendToolkitPanic()
|
||||
os.Exit(0)
|
||||
return
|
||||
}
|
||||
}()
|
||||
|
@ -50,10 +52,10 @@ func simpleStdin() {
|
|||
switch s {
|
||||
case "l":
|
||||
log.Log(NOW, "list widgets")
|
||||
me.treeRoot.ListWidgets()
|
||||
tree.ListWidgets()
|
||||
case "b":
|
||||
log.Log(NOW, "show buttons")
|
||||
me.treeRoot.ShowButtons()
|
||||
tree.ShowButtons()
|
||||
case "g":
|
||||
me.myTree.SendToolkitLoad("gocui")
|
||||
case "a":
|
||||
|
@ -63,6 +65,7 @@ func simpleStdin() {
|
|||
case "p":
|
||||
debug.PrintStack()
|
||||
me.myTree.SendToolkitPanic()
|
||||
os.Exit(0)
|
||||
return
|
||||
case "q":
|
||||
return
|
||||
|
@ -71,7 +74,7 @@ func simpleStdin() {
|
|||
default:
|
||||
i, _ := strconv.Atoi(s)
|
||||
log.Log(NOW, "got input:", i)
|
||||
n := me.treeRoot.FindWidgetId(i)
|
||||
n := tree.FindWidgetId(i)
|
||||
if n != nil {
|
||||
n.DumpWidget("found node")
|
||||
for i, s := range n.State.Strings {
|
||||
|
|
Loading…
Reference in New Issue