diff options
| author | Jeff Carr <[email protected]> | 2025-02-19 06:54:54 -0600 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2025-02-19 17:39:45 -0600 |
| commit | e0775877c8d6a4e3a19fe9c85057b3387788adc2 (patch) | |
| tree | 39969cd2f18ad40e4d2e30d3fb2916017a149a84 | |
| parent | f0257138921c9596312bbe5041e917fd55aefb39 (diff) | |
starting the table window
| -rw-r--r-- | addNode.go | 5 | ||||
| -rw-r--r-- | table.go | 37 |
2 files changed, 39 insertions, 3 deletions
@@ -5,8 +5,11 @@ import ( "go.wit.com/widget" ) -// this is in common.go, do not move it func (me *TreeInfo) AddNode(a *widget.Action) *Node { + return AddNode(a) +} + +func AddNode(a *widget.Action) *Node { n := new(Node) n.WidgetType = a.WidgetType n.WidgetId = a.WidgetId @@ -33,12 +33,45 @@ func (me *TreeInfo) doTable(a widget.Action) { for i, o := range t.Order { log.Info("got order:", t.Title, i, o) } - me.ShowTable(t) dumpTable(t) + me.ShowTable(t) + me.makeTable(t) } } -func makeTable(t *guipb.Table) { +func makeTableWindow(pb *guipb.Widget) *Node { + a := new(widget.Action) + a.WidgetType = widget.Window + a.WidgetId = int(pb.Id) + a.ParentId = 0 + a.State.Enable = true + + return AddNode(a) +} + +func (win *Node) makeWindowGrid(pb *guipb.Widget) *Node { + a := new(widget.Action) + a.WidgetType = widget.Grid + a.WidgetId = int(pb.Id) + a.ParentId = win.WidgetId + a.State.Enable = true + + return AddNode(a) +} + +func (me *TreeInfo) makeTable(t *guipb.Table) { + win := makeTableWindow(t.Window) + grid := win.makeWindowGrid(t.Grid) + me.Add(win) + me.Add(grid) + log.Info("tree: makeTable() finished add win & grid") + + for i, r := range t.StringRows { + log.Info("got string row:", t.Title, i, r.Header, r.Vals) + for _, v := range r.Widgets { + log.Info("tree: add to grid here", v.Id, v.Name) + } + } } func dumpTable(t *guipb.Table) { |
