insert one item from list model
(index int)
| 206 | |
| 207 | //insert one item from list model |
| 208 | func (lb *ListBox) insertItemAt(index int) error { |
| 209 | str := lb.itemString(index) |
| 210 | lp := uintptr(unsafe.Pointer(syscall.StringToUTF16Ptr(str))) |
| 211 | ret := int(lb.SendMessage(win.LB_INSERTSTRING, uintptr(index), lp)) |
| 212 | if ret == win.LB_ERRSPACE || ret == win.LB_ERR { |
| 213 | return newError("SendMessage(LB_INSERTSTRING)") |
| 214 | } |
| 215 | return nil |
| 216 | } |
| 217 | |
| 218 | func (lb *ListBox) removeItem(index int) error { |
| 219 | if win.LB_ERR == int(lb.SendMessage(win.LB_DELETESTRING, uintptr(index), 0)) { |
no test coverage detected