diff options
Diffstat (limited to 'lib/ui/tab.go')
-rw-r--r-- | lib/ui/tab.go | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/ui/tab.go b/lib/ui/tab.go index ecd48eb..e41e906 100644 --- a/lib/ui/tab.go +++ b/lib/ui/tab.go @@ -30,13 +30,15 @@ func NewTabs() *Tabs { return tabs } -func (tabs *Tabs) Add(content Drawable, name string) { - tabs.Tabs = append(tabs.Tabs, &Tab{ +func (tabs *Tabs) Add(content Drawable, name string) *Tab { + tab := &Tab{ Content: content, Name: name, - }) + } + tabs.Tabs = append(tabs.Tabs, tab) tabs.TabStrip.Invalidate() content.OnInvalidate(tabs.invalidateChild) + return tab } func (tabs *Tabs) invalidateChild(d Drawable) { |