diff options
Diffstat (limited to 'structs.go')
| -rw-r--r-- | structs.go | 96 |
1 files changed, 47 insertions, 49 deletions
@@ -30,58 +30,56 @@ var redoWidgets bool = true // todo: move this into config struct // todo: move all this to a protobuf. then, redo all this mess. it got me here, but now it's time to clean it up for good type config struct { - baseGui *gocui.Gui // the main gocui handle - treeRoot *tree.Node // the base of the binary tree. it should have id == 0 - myTree *tree.TreeInfo // ? - ctrlDown *tree.Node // shown if you click the mouse when the ctrl key is pressed - currentWindow *guiWidget // this is the current tab or window to show - logStdout *guiWidget // where to show STDOUT - // startOutputW int // ? - // startOutputH int // ? - helpLabel *gocui.View // ? - showHelp bool // toggle boolean for the help menu (deprecate?) - dropdownW *guiWidget // grab the dropdown choices from this widget - FramePadW int `default:"1" dense:"0"` // When the widget has a frame, like a button, it adds 2 lines runes on each side - FramePadH int `default:"1" dense:"0"` // When the widget has a frame, like a button, it adds 2 lines runes on each side - PadW int `default:"1" dense:"0"` // pad spacing - PadH int `default:"1" dense:"0"` // pad spacing - WindowW int `default:"8" dense:"0"` // how far down to start Window or Tab headings - WindowH int `default:"-1"` // how far down to start Window or Tab headings - TabW int `default:"5" dense:"0"` // how far down to start Window or Tab headings - TabH int `default:"1" dense:"0"` // how far down to start Window or Tab headings - WindowPadW int `default:"8" dense:"0"` // additional amount of space to put between window & tab widgets - TabPadW int `default:"4" dense:"0"` // additional amount of space to put between window & tab widgets - GroupPadW int `default:"2" dense:"1"` // additional amount of space to indent on a group - BoxPadW int `default:"2" dense:"1"` // additional amount of space to indent on a box - GridPadW int `default:"2" dense:"1"` // additional amount of space to indent on a grid - RawW int `default:"1"` // the raw beginning of each window (or tab) - RawH int `default:"5"` // the raw beginning of each window (or tab) - FakeW int `default:"20"` // offset for the hidden widgets - padded bool // add space between things like buttons - bookshelf bool // do you want things arranged in the box like a bookshelf or a stack? - canvas bool // if set to true, the windows are a raw canvas - menubar bool // for windows - stretchy bool // expand things like buttons to the maximum size - margin bool // add space around the frames of windows - writeMutex sync.Mutex // writeMutex protects writes to *guiWidget (it's global right now maybe) - dtoggle bool // is a dropdown or combobox currently active? - ecount int // counts how many mouse and keyboard events have occurred - supermouse bool // prints out every widget found while you move the mouse around - depth int // used for listWidgets() debugging - globalMouseDown bool // yep, mouse is pressed - newWindowTrigger chan bool // work around hack to redraw windows a bit after NewWindow() - stdout stdout // information for the STDOUT window + baseGui *gocui.Gui // the main gocui handle + treeRoot *tree.Node // the base of the binary tree. it should have id == 0 + myTree *tree.TreeInfo // ? + ctrlDown *tree.Node // shown if you click the mouse when the ctrl key is pressed + currentWindow *guiWidget // this is the current tab or window to show + helpLabel *gocui.View // ? + showHelp bool // toggle boolean for the help menu (deprecate?) + dropdownW *guiWidget // grab the dropdown choices from this widget + FramePadW int `default:"1" dense:"0"` // When the widget has a frame, like a button, it adds 2 lines runes on each side + FramePadH int `default:"1" dense:"0"` // When the widget has a frame, like a button, it adds 2 lines runes on each side + PadW int `default:"1" dense:"0"` // pad spacing + PadH int `default:"1" dense:"0"` // pad spacing + WindowW int `default:"8" dense:"0"` // how far down to start Window or Tab headings + WindowH int `default:"-1"` // how far down to start Window or Tab headings + TabW int `default:"5" dense:"0"` // how far down to start Window or Tab headings + TabH int `default:"1" dense:"0"` // how far down to start Window or Tab headings + WindowPadW int `default:"8" dense:"0"` // additional amount of space to put between window & tab widgets + TabPadW int `default:"4" dense:"0"` // additional amount of space to put between window & tab widgets + GroupPadW int `default:"2" dense:"1"` // additional amount of space to indent on a group + BoxPadW int `default:"2" dense:"1"` // additional amount of space to indent on a box + GridPadW int `default:"2" dense:"1"` // additional amount of space to indent on a grid + RawW int `default:"1"` // the raw beginning of each window (or tab) + RawH int `default:"5"` // the raw beginning of each window (or tab) + FakeW int `default:"20"` // offset for the hidden widgets + padded bool // add space between things like buttons + bookshelf bool // do you want things arranged in the box like a bookshelf or a stack? + canvas bool // if set to true, the windows are a raw canvas + menubar bool // for windows + stretchy bool // expand things like buttons to the maximum size + margin bool // add space around the frames of windows + writeMutex sync.Mutex // writeMutex protects writes to *guiWidget (it's global right now maybe) + dtoggle bool // is a dropdown or combobox currently active? + ecount int // counts how many mouse and keyboard events have occurred + supermouse bool // prints out every widget found while you move the mouse around + depth int // used for listWidgets() debugging + globalMouseDown bool // yep, mouse is pressed + newWindowTrigger chan bool // work around hack to redraw windows a bit after NewWindow() + stdout stdout // information for the STDOUT window } // settings for the stdout window type stdout struct { - w int // the width - h int // the width - outputOnTop bool // is the STDOUT window on top? - offscreenW int // where to place the window offscreen - offscreenH int // where to place the window offscreen - offsetW int // the current 'w' offset - offsetH int // the current 'h' offset + tk *guiWidget // where to show STDOUT + w int // the width + h int // the width + outputOnTop bool // is the STDOUT window on top? + offscreenW int // where to place the window offscreen + offscreenH int // where to place the window offscreen + offsetW int // the current 'w' offset + offsetH int // the current 'h' offset } // deprecate these @@ -154,7 +152,7 @@ func (w *guiWidget) Write(p []byte) (n int, err error) { // _, outputH := w.Size() outputH := 33 // special output length for "msg" window until I figure things out - tk := me.logStdout + tk := me.stdout.tk if tk.v == nil { // optionally write the output to /tmp s := fmt.Sprint(string(p)) |
