diff options
Diffstat (limited to 'structs.go')
| -rw-r--r-- | structs.go | 54 |
1 files changed, 26 insertions, 28 deletions
@@ -1,9 +1,9 @@ package gui import ( - "sync" "embed" - "go.wit.com/gui/widget" + "go.wit.com/lib/widget" + "sync" ) // @@ -28,7 +28,7 @@ var me guiConfig // seem to be a good idea to use 'type any' here as it // just makes things more complicated for no good reason type RangeMovedToWidget struct { - Low int + Low int High int } @@ -45,19 +45,19 @@ type guiConfig struct { rootNode *Node // A node off of rootNode for passing debugging flags - flag *Node + flag *Node - counter int // used to make unique WidgetId's + counter int // used to make unique WidgetId's // sets the chan for the plugins to call back too guiChan chan widget.Action // option to pass in compiled plugins as embedded files - resFS embed.FS + resFS embed.FS // used to beautify logging to Stdout -// depth int -// prefix string + // depth int + // prefix string } /* @@ -86,23 +86,23 @@ type guiConfig struct { */ type Node struct { - id int // should be unique - hidden bool // don't update the toolkits when it's hidden + id int // should be unique + hidden bool // don't update the toolkits when it's hidden changed bool // do we need to inform the toolkit something changed? enabled bool // if false, then the the user can't click on it - mu sync.Mutex + mu sync.Mutex - WidgetType widget.WidgetType + WidgetType widget.WidgetType // most widgets need one value, this is current alue - value any + value any // label string // this can programatically identify the widget // The name must be unique - progname string // a name useful for debugging + progname string // a name useful for debugging // for widgets that a user select from a list of strings strings map[string]int @@ -113,35 +113,33 @@ type Node struct { // this function is run when there are mouse or keyboard events Custom func() - parent *Node + parent *Node children []*Node - // RETHINK EVERYTHING BELOW HERE - pad bool // the toolkit may use this. it's up to the toolkit - margin bool // the toolkit may use this. it's up to the toolkit - expand bool // the toolkit may use this. it's up to the toolkit - + pad bool // the toolkit may use this. it's up to the toolkit + margin bool // the toolkit may use this. it's up to the toolkit + expand bool // the toolkit may use this. it's up to the toolkit // used for Windows in toolkits measured in pixels width int height int // used for anything that needs a range (for example: a slider) - X int - Y int + X int + Y int // the grid widget max width and height // the max height can be implemented in the toolkit plugin // to restrict the number of rows to display - W int - H int + W int + H int // where the next widget should be put in this grid - NextW int - NextH int + NextW int + NextH int // if this widget is in a grid, this is the position of a widget - AtW int - AtH int + AtW int + AtH int } |
