MCPcopy Index your code
hub / github.com/lxn/walk / UpdateItem

Method UpdateItem

tableview.go:681–696  ·  view source on GitHub ↗

UpdateItem ensures the item at index will be redrawn. If the model supports sorting, it will be resorted.

(index int)

Source from the content-addressed store, hash-verified

679//
680// If the model supports sorting, it will be resorted.
681func (tv *TableView) UpdateItem(index int) error {
682 if s, ok := tv.model.(Sorter); ok {
683 if err := s.Sort(s.SortedColumn(), s.SortOrder()); err != nil {
684 return err
685 }
686 } else {
687 if win.FALSE == win.SendMessage(tv.hwndFrozenLV, win.LVM_UPDATE, uintptr(index), 0) {
688 return newError("LVM_UPDATE")
689 }
690 if win.FALSE == win.SendMessage(tv.hwndNormalLV, win.LVM_UPDATE, uintptr(index), 0) {
691 return newError("LVM_UPDATE")
692 }
693 }
694
695 return nil
696}
697
698func (tv *TableView) attachModel() {
699 restoreCurrentItemOrFallbackToFirst := func(ip IDProvider) {

Callers 1

attachModelMethod · 0.95

Calls 5

newErrorFunction · 0.85
SortMethod · 0.65
SortedColumnMethod · 0.65
SortOrderMethod · 0.65
SendMessageMethod · 0.65

Tested by

no test coverage detected