Closed
Description
I am building a table out of this struct:
type DisplayAccount struct {
Enabled bool
Name string
}
Here is the code:
// Assemble table of accounts
accounts := make([]DisplayAccount, len(config.Accounts))
// Pull accounts from config file
for i, account := range config.Accounts {
enabled := account.Enabled
acctName := strings.Join([]string{account.Name, account.Server}, "@")
accounts[i] = DisplayAccount{enabled, acctName}
}
// Populate table
accountTable := ui.NewTable(reflect.TypeOf(accounts[0]))
accountTable.Lock()
e := accountTable.Data().(*[]DisplayAccount)
*e = accounts
accountTable.Unlock()
How do I access the OnSelected method of each "Enabled" field in accountTable?
Metadata
Metadata
Assignees
Labels
No labels