diff options
| author | Jeff Carr <[email protected]> | 2023-04-27 21:11:00 -0500 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2023-04-27 21:11:00 -0500 |
| commit | 87b62c98a6ebd9d0e48850d1710de7f39aba41c8 (patch) | |
| tree | b5961b9d4841b20ff41ae95acac4d82459ee9d3f /toolkit/gocui/structs.go | |
| parent | 9e285c7affa3257a46e85acde6dc64a9c781b728 (diff) | |
nocui: a template for porting new toolkits
Signed-off-by: Jeff Carr <[email protected]>
Diffstat (limited to 'toolkit/gocui/structs.go')
| -rw-r--r-- | toolkit/gocui/structs.go | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/toolkit/gocui/structs.go b/toolkit/gocui/structs.go index e9f89af..b2a8b20 100644 --- a/toolkit/gocui/structs.go +++ b/toolkit/gocui/structs.go @@ -85,11 +85,40 @@ type config struct { writeMutex sync.Mutex } +// deprecate these var ( initialMouseX, initialMouseY, xOffset, yOffset int globalMouseDown, msgMouseDown, movingMsg bool ) +// this is the standard binary tree structure for toolkits +type node struct { + parent *node + children []*node + + WidgetId int // widget ID + WidgetType toolkit.WidgetType + ParentId int // parent ID + + Name string + Text string + + // This is how the values are passed back and forth + // values from things like checkboxes & dropdown's + B bool + I int + S string + + A any // switch to this or deprecate this? pros/cons? + + // This is used for things like a slider(0,100) + X int + Y int + + // the internal plugin toolkit structure + tk *cuiWidget +} + // the gocui way // the logical size of the widget // corner starts at in the upper left corner |
