(index int)
| 249 | } |
| 250 | |
| 251 | func (cb *ComboBox) itemString(index int) string { |
| 252 | switch val := cb.model.Value(index).(type) { |
| 253 | case string: |
| 254 | return val |
| 255 | |
| 256 | case time.Time: |
| 257 | return val.Format(cb.format) |
| 258 | |
| 259 | case *big.Rat: |
| 260 | return val.FloatString(cb.precision) |
| 261 | |
| 262 | default: |
| 263 | return fmt.Sprintf(cb.format, val) |
| 264 | } |
| 265 | |
| 266 | panic("unreachable") |
| 267 | } |
| 268 | |
| 269 | func (cb *ComboBox) insertItemAt(index int) error { |
| 270 | str := cb.itemString(index) |
no test coverage detected