Add TabbedPanels.HasTab
This commit is contained in:
parent
a3709cc49b
commit
7a5e47b598
1 changed files with 13 additions and 0 deletions
|
@ -88,6 +88,19 @@ func (t *TabbedPanels) RemoveTab(name string) {
|
|||
t.updateAll()
|
||||
}
|
||||
|
||||
// HasTab returns true if a tab with the given name exists in this object.
|
||||
func (t *TabbedPanels) HasTab(name string) bool {
|
||||
t.RLock()
|
||||
defer t.RUnlock()
|
||||
|
||||
for _, panel := range t.panels.panels {
|
||||
if panel.Name == name {
|
||||
return true
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
// SetCurrentTab sets the currently visible tab.
|
||||
func (t *TabbedPanels) SetCurrentTab(name string) {
|
||||
t.Lock()
|
||||
|
|
Loading…
Reference in a new issue