gocui: window and tab position kinda correct

Signed-off-by: Jeff Carr <jcarr@wit.com>
This commit is contained in:
Jeff Carr 2023-04-05 17:56:27 -05:00
parent 5146cdfa80
commit cd8ddbc767
2 changed files with 7 additions and 3 deletions

View File

@ -48,7 +48,7 @@ func (w *cuiWidget) showWidgetPlacement(b bool, s string) {
s1 = fmt.Sprintf("(wId,pId)=(%2d,%2d) ", w.id, pId)
s1 += fmt.Sprintf("W,H()=(%2d,%2d) ", w.startW, w.startH)
s1 += fmt.Sprintf("size()=(%2d,%2d) ", w.realWidth, w.realHeight)
s1 += fmt.Sprintf("real()=(%2d,%2d,%2d,%2d) ", w.gocuiSize.w0, w.gocuiSize.h0, w.gocuiSize.w1, w.gocuiSize.h1)
s1 += fmt.Sprintf("gocui()=(%2d,%2d,%2d,%2d) ", w.gocuiSize.w0, w.gocuiSize.h0, w.gocuiSize.w1, w.gocuiSize.h1)
switch w.widgetType {
case toolkit.Grid:

View File

@ -58,11 +58,15 @@ func (w *cuiWidget) setTabWH() {
startH := 1
for _, child := range me.rootNode.children {
if (child.isFake) {
w.showWidgetPlacement(logNow, "SETTABWH:")
continue
}
if (w == child) {
w.startW = startW
w.startH = startH
w.moveTo(w.startW, w.startH)
w.showWidgetPlacement(logNow, "setTabWH:")
w.setWH()
w.showWidgetPlacement(logNow, "setTABWH:")
return
}
startW += child.realWidth