diff options
| author | Jeff Carr <[email protected]> | 2023-03-23 12:35:12 -0500 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2023-03-23 12:35:12 -0500 |
| commit | d4787a1ebdd08359746516dbb72f1feaf95be5b6 (patch) | |
| tree | cb81756d61096ccf74af7c8cc9a15e4e00fe1da7 /toolkit/andlabs/box.go | |
| parent | 6a848bf40474365cc1c0b4da9e2f7e3e10b4d627 (diff) | |
Squashed commit of the following:v0.7.3
boxes now exist and are tracked in the binary tree
create for group and grid works
gocui plugin no longer works. TODO: fix in next release
converted everything from plugin to Action()
can remove send()
tab and window are now action()
flags moved to action()
ready for new release
pad() margion() border() all work
move worked!
go.wit.com attept 578th try
adds an early grid widget. won't work until chan
andlabs/ui grid (X,Y) works right
actually can put things in places in a grid
Queue() means shit doesn't look right on grids
lots of fucking around. why am I wasting time on image?
wow. the crazy doAppend() thing is gone
implement Action Show() and Hide()
Signed-off-by: Jeff Carr <[email protected]>
Diffstat (limited to 'toolkit/andlabs/box.go')
| -rw-r--r-- | toolkit/andlabs/box.go | 76 |
1 files changed, 34 insertions, 42 deletions
diff --git a/toolkit/andlabs/box.go b/toolkit/andlabs/box.go index 265d7c8..cc7451d 100644 --- a/toolkit/andlabs/box.go +++ b/toolkit/andlabs/box.go @@ -1,54 +1,46 @@ package main -import "github.com/andlabs/ui" -import _ "github.com/andlabs/ui/winmanifest" +import ( + "git.wit.org/wit/gui/toolkit" -// create a new box -func (t *andlabsT) getBox() *ui.Box { - return t.uiBox -} - -// create a new box -func (t *andlabsT) newBox() *andlabsT { - log(debugToolkit, "newBox() START create default") - t.Dump(debugToolkit) - if (t.uiGroup != nil) { - log(debugToolkit, "\tnewBox() is a Group") - var newTK andlabsT + "github.com/andlabs/ui" + _ "github.com/andlabs/ui/winmanifest" +) - vbox := ui.NewVerticalBox() - vbox.SetPadded(padded) - t.uiGroup.SetChild(vbox) - newTK.uiBox = vbox +// make new Box here +func newBox(a *toolkit.Action) { + w := a.Widget + parentW := a.Where + log(debugToolkit, "newBox()", w.Name) - return &newTK + t := mapToolkits[parentW] + if (t == nil) { + log(debugToolkit, "newBox() toolkit struct == nil. name=", parentW.Name, w.Name) + listMap(debugToolkit) } - if (t.uiBox != nil) { - log(debugToolkit, "\tnewBox() is a Box") - var newTK andlabsT + newt := t.rawBox(w.Name, a.B) + newt.boxC = 0 + place(a, t, newt) + mapWidgetsToolkits(a, newt) +} - vbox := ui.NewVerticalBox() - vbox.SetPadded(padded) - t.uiBox.Append(vbox, stretchy) - newTK.uiBox = vbox - newTK.Name = t.Name +// make new Box using andlabs/ui +func (t *andlabsT) rawBox(title string, b bool) *andlabsT { + var newt andlabsT + var box *ui.Box + newt.Name = title - return &newTK + log(debugToolkit, "rawBox() create", newt.Name) + + if (b) { + box = ui.NewHorizontalBox() + } else { + box = ui.NewVerticalBox() } - if (t.uiWindow != nil) { - log(debugToolkit, "\tnewBox() is a Window") - var newT andlabsT + box.SetPadded(padded) - vbox := ui.NewVerticalBox() - vbox.SetPadded(padded) - t.uiWindow.SetChild(vbox) - newT.uiBox = vbox - newT.Name = t.Name + newt.uiBox = box + newt.uiControl = box - // panic("WTF") - return &newT - } - log(debugToolkit, "\tnewBox() FAILED. Couldn't figure out where to make a box") - t.Dump(debugToolkit) - return nil + return &newt } |
