MCPcopy
hub / github.com/lxn/walk / itemString

Method itemString

combobox.go:251–267  ·  view source on GitHub ↗
(index int)

Source from the content-addressed store, hash-verified

249}
250
251func (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
269func (cb *ComboBox) insertItemAt(index int) error {
270 str := cb.itemString(index)

Callers 2

insertItemAtMethod · 0.95

Calls 2

ValueMethod · 0.65
FormatMethod · 0.45

Tested by

no test coverage detected