MCPcopy Create free account
hub / github.com/lxn/walk / insertItemAt

Method insertItemAt

listbox.go:208–216  ·  view source on GitHub ↗

insert one item from list model

(index int)

Source from the content-addressed store, hash-verified

206
207//insert one item from list model
208func (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
218func (lb *ListBox) removeItem(index int) error {
219 if win.LB_ERR == int(lb.SendMessage(win.LB_DELETESTRING, uintptr(index), 0)) {

Callers 2

resetItemsMethod · 0.95
attachModelMethod · 0.95

Calls 3

itemStringMethod · 0.95
newErrorFunction · 0.85
SendMessageMethod · 0.65

Tested by

no test coverage detected