(label string, checked bool, changed func(checked bool))
| 197 | } |
| 198 | |
| 199 | func (f *XForm) AddCheckbox(label string, checked bool, changed func(checked bool)) *XForm { |
| 200 | f.AddFormItem( |
| 201 | tview.NewCheckbox(). |
| 202 | //SetCheckedStyle(tcell.StyleDefault.Background(tcell.ColorGreen).Foreground(tcell.ColorWhite)). |
| 203 | //SetUncheckedStyle(tcell.StyleDefault.Background(tcell.ColorRed).Foreground(tcell.ColorWhite)). |
| 204 | SetCheckedString("True"). |
| 205 | SetUncheckedString("False"). |
| 206 | SetLabel(label). |
| 207 | SetChecked(checked). |
| 208 | SetChangedFunc(changed), |
| 209 | ) |
| 210 | |
| 211 | return f |
| 212 | } |
| 213 | |
| 214 | func GetEntryColor(entry *ldap.Entry) (tcell.Color, bool) { |
| 215 | isDeleted := strings.ToLower(entry.GetAttributeValue("isDeleted")) == "true" |
no outgoing calls
no test coverage detected