add the protobuf to the struct

This commit is contained in:
Jeff Carr 2025-02-19 04:34:24 -06:00
parent f36f9cfd0f
commit 57b6efd831
1 changed files with 34 additions and 32 deletions

View File

@ -18,6 +18,7 @@ import (
"github.com/awesome-gocui/gocui" "github.com/awesome-gocui/gocui"
"go.wit.com/lib/protobuf/guipb"
log "go.wit.com/log" log "go.wit.com/log"
"go.wit.com/toolkits/tree" "go.wit.com/toolkits/tree"
) )
@ -181,38 +182,39 @@ type colorT struct {
} }
type guiWidget struct { type guiWidget struct {
v *gocui.View // this is nil if the widget is not displayed v *gocui.View // this is nil if the widget is not displayed
cuiName string // what gocui uses to reference the widget (usually "TK <widgetId>" cuiName string // what gocui uses to reference the widget (usually "TK <widgetId>"
parent *guiWidget // mirrors the binary node tree parent *guiWidget // mirrors the binary node tree
children []*guiWidget // mirrors the binary node tree children []*guiWidget // mirrors the binary node tree
node *tree.Node // the pointer back to the tree node *tree.Node // the pointer back to the tree
windowFrame *guiWidget // this is the frame for a window widget pb *guipb.Widget // the guipb Widget
internal bool // indicates the widget is internal to gocui and should be treated differently windowFrame *guiWidget // this is the frame for a window widget
hasTabs bool // does the window have tabs? internal bool // indicates the widget is internal to gocui and should be treated differently
currentTab bool // the visible tab hasTabs bool // does the window have tabs?
window window // holds information specific only to Window widgets currentTab bool // the visible tab
value string // ? window window // holds information specific only to Window widgets
checked bool // ? value string // ?
labelN string // the actual text to display in the console checked bool // ?
vals []string // dropdown menu items labelN string // the actual text to display in the console
enable bool // ? vals []string // dropdown menu items
gocuiSize rectType // should mirror the real display size. todo: verify these are accurate. they are not yet enable bool // ?
full rectType // full size of children (used by widget.Window, etc) gocuiSize rectType // should mirror the real display size. todo: verify these are accurate. they are not yet
force rectType // force widget within these boundries (using this to debug window dragging) full rectType // full size of children (used by widget.Window, etc)
startW int // ? force rectType // force widget within these boundries (using this to debug window dragging)
startH int // ? startW int // ?
lastW int // used during mouse dragging startH int // ?
lastH int // used during mouse dragging lastW int // used during mouse dragging
isFake bool // widget types like 'box' are 'false' lastH int // used during mouse dragging
widths map[int]int // how tall each row in the grid is isFake bool // widget types like 'box' are 'false'
heights map[int]int // how wide each column in the grid is widths map[int]int // how tall each row in the grid is
tainted bool // ? heights map[int]int // how wide each column in the grid is
frame bool // ? tainted bool // ?
selectedTab *tree.Node // for a window, this is currently selected tab frame bool // ?
color *colorT // what color to use selectedTab *tree.Node // for a window, this is currently selected tab
colorLast colorT // the last color the widget had color *colorT // what color to use
defaultColor *colorT // the default colors // TODO: make a function for this instead colorLast colorT // the last color the widget had
isBG bool // means this is the background widget. There is only one of these defaultColor *colorT // the default colors // TODO: make a function for this instead
isBG bool // means this is the background widget. There is only one of these
} }
// THIS IS GO COMPILER MAGIC // THIS IS GO COMPILER MAGIC