From d97801b41e6c4d702b3781383cf79fb7505d66d8 Mon Sep 17 00:00:00 2001 From: Jeff Carr Date: Tue, 5 Oct 2021 02:00:32 -0500 Subject: TAB: automatically set all tables to SetMargined(true) Signed-off-by: Jeff Carr --- structs.go | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'structs.go') diff --git a/structs.go b/structs.go index e5e8520..50784fa 100644 --- a/structs.go +++ b/structs.go @@ -120,6 +120,7 @@ func (s GuiBox) InitTab(title string) { tab.Append(title, InitBlankWindow()) tab.SetMargined(0, true) + // tab.SetMargined(1, true) s.Window.UiTab = tab } @@ -153,17 +154,25 @@ func (s GuiBox) AddTab2(title string, custom ui.Control) *ui.Tab { func (s GuiBox) AddBoxTab(title string) *GuiBox { uiTab := s.AddTab2(title, InitBlankWindow()) + tabSetMargined(uiTab) var box *GuiBox box = HardBox(s.Window, Xaxis, "jcarrAddBoxTab") box.Window.UiTab = uiTab - return box - + return box } func (s GuiBox) AddDemoTab(title string) { s.AddTab(title, makeWindowTemplate()) } +func tabSetMargined(tab *ui.Tab) { + c := tab.NumPages() + for i := 0; i < c; i++ { + log.Println("tabSetMargined() i =", i) + tab.SetMargined(i, true) + } +} + // Note: every mouse click is handled // as a 'Button' regardless of where // the user clicks it. You could probably -- cgit v1.2.3