diff --git a/notebook.go b/notebook.go index 7a79e5e..401d777 100644 --- a/notebook.go +++ b/notebook.go @@ -33,26 +33,26 @@ type Notebook struct { // NewNotebook creates a new tabbed notebook. func NewNotebook () *Notebook { - Notebook := &Notebook { + notebook := &Notebook { box: tomo.NewContainerBox(), } - Notebook.box.SetRole(tomo.R("objects", "Notebook")) - Notebook.box.SetAttr(tomo.ALayout(layouts.Column { false, true })) + notebook.box.SetRole(tomo.R("objects", "Notebook")) + notebook.box.SetAttr(tomo.ALayout(layouts.Column { false, true })) - Notebook.tabsRow = tomo.NewContainerBox() - Notebook.tabsRow.SetRole(tomo.R("objects", "TabRow")) - Notebook.box.Add(Notebook.tabsRow) + notebook.tabsRow = tomo.NewContainerBox() + notebook.tabsRow.SetRole(tomo.R("objects", "TabRow")) + notebook.box.Add(notebook.tabsRow) - Notebook.leftSpacer = tomo.NewBox() - Notebook.leftSpacer.SetRole(tomo.R("objects", "TabSpacer")) - Notebook.leftSpacer.SetTag("left", true) - Notebook.rightSpacer = tomo.NewBox() - Notebook.rightSpacer.SetRole(tomo.R("objects", "TabSpacer")) - Notebook.rightSpacer.SetTag("right", true) + notebook.leftSpacer = tomo.NewBox() + notebook.leftSpacer.SetRole(tomo.R("objects", "TabSpacer")) + notebook.leftSpacer.SetTag("left", true) + notebook.rightSpacer = tomo.NewBox() + notebook.rightSpacer.SetRole(tomo.R("objects", "TabSpacer")) + notebook.rightSpacer.SetTag("right", true) - Notebook.ClearTabs() - Notebook.setTabRowLayout() - return Notebook + notebook.Clear() + notebook.setTabRowLayout() + return notebook } // GetBox returns the underlying box. @@ -75,8 +75,8 @@ func (this *Notebook) Activate (name string) { this.active = name } -// AddTab adds an object as a tab with the specified name. -func (this *Notebook) AddTab (name string, root tomo.Object) { +// Add adds an object as a tab with the specified name. +func (this *Notebook) Add (name string, root tomo.Object) { tab := &tab { TextBox: tomo.NewTextBox(), name: name, @@ -104,8 +104,8 @@ func (this *Notebook) AddTab (name string, root tomo.Object) { } } -// RemoveTab removes the named tab. -func (this *Notebook) RemoveTab (name string) { +// Remove removes the named tab. +func (this *Notebook) Remove (name string) { index, tab := this.findTab(name) if index < 0 { return } nextIndex := index - 1 @@ -123,8 +123,8 @@ func (this *Notebook) RemoveTab (name string) { } } -// ClearTabs removes all tabs. -func (this *Notebook) ClearTabs () { +// Clear removes all tabs. +func (this *Notebook) Clear () { this.tabs = nil this.tabsRow.Clear() this.tabsRow.Add(this.leftSpacer)