Panels has a SetChangedFunc, expose this for TabbedPanels such that when the user has selected a Tab, a function will be executed.
Use Case:
Let's say I have a TabbedPanel that consists of a Flex containing a List and TreeView. When .SetCurrentTab(name) is called, it will call a function to update the associated List.
`Panels` has a `SetChangedFunc`, expose this for `TabbedPanels` such that when the user has selected a Tab, a function will be executed.
Use Case:
Let's say I have a `TabbedPanel` that consists of a `Flex` containing a `List` and `TreeView`. When `.SetCurrentTab(name)` is called, it will call a function to update the associated `List`.
Can you provide clarification as to why the the following behavior is observed:
`b.lists` is defined as an initialized `cview.TabbedPanels`
`b.states` is map of `*cview.Lists` with the associated tab string name
```go
func (b *Browser) initializeTabbedList() {
b.lists.SetChangedFunc(b.populate)
}
{...}
func (b *Browser) populate() {
go func() {
listStr := b.lists.GetCurrentTab()
{...}
b.debugBar.SetText(listStr)
}()
}
```
Works as expected. However, should I do the following:
```go
func (b *Browser) populate() {
listStr := b.lists.GetCurrentTab()
go func() {
{...}
b.debugBar.SetText(listStr)
}()
}
```
will make the application unresposive.
Panels
has aSetChangedFunc
, expose this forTabbedPanels
such that when the user has selected a Tab, a function will be executed.Use Case:
Let's say I have a
TabbedPanel
that consists of aFlex
containing aList
andTreeView
. When.SetCurrentTab(name)
is called, it will call a function to update the associatedList
.Thanks for suggesting this.
Can you provide clarification as to why the the following behavior is observed:
b.lists
is defined as an initializedcview.TabbedPanels
b.states
is map of*cview.Lists
with the associated tab string nameWorks as expected. However, should I do the following:
will make the application unresposive.