UpdateItem ensures the item at index will be redrawn. If the model supports sorting, it will be resorted.
(index int)
| 679 | // |
| 680 | // If the model supports sorting, it will be resorted. |
| 681 | func (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 | |
| 698 | func (tv *TableView) attachModel() { |
| 699 | restoreCurrentItemOrFallbackToFirst := func(ip IDProvider) { |
no test coverage detected