TAB: automatically set all tables to SetMargined(true)
Signed-off-by: Jeff Carr <jcarr@wit.com>
This commit is contained in:
parent
e6c44cd2d3
commit
90d8111ada
13
structs.go
13
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
|
||||
|
|
|
@ -161,6 +161,7 @@ func DeleteWindow(name string) {
|
|||
// CreateWindow("my title", "my tabname", 300, 200, makeNumbersPagewin2)
|
||||
func CreateWindow(title string, tabname string, x int, y int, custom func() ui.Control) *ui.Window {
|
||||
window := ui.NewWindow(title, x, y, false)
|
||||
window.SetBorderless(false)
|
||||
window.OnClosing(func(*ui.Window) bool {
|
||||
log.Println("createWindow().OnClosing()", title)
|
||||
return true
|
||||
|
@ -185,6 +186,7 @@ func CreateWindow(title string, tabname string, x int, y int, custom func() ui.C
|
|||
|
||||
func CreateBlankWindow(title string, x int, y int) *GuiBox {
|
||||
window := ui.NewWindow(title, x, y, false)
|
||||
window.SetBorderless(false)
|
||||
window.OnClosing(func(*ui.Window) bool {
|
||||
log.Println("createWindow().OnClosing()", title)
|
||||
return true
|
||||
|
|
Loading…
Reference in New Issue