Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove treeview condition check #711

Merged
merged 2 commits into from
Sep 2, 2020
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
remove treeview condition check
fixes #710
  • Loading branch information
xoviat committed Aug 19, 2020
commit be886d538cfac55c563bd0b019f5af5548adfea8
8 changes: 1 addition & 7 deletions treeview.go
Original file line number Diff line number Diff line change
Expand Up @@ -572,13 +572,7 @@ func (tv *TreeView) WndProc(hwnd win.HWND, msg uint32, wParam, lParam uintptr) u
item := tv.handle2Item[nmtvdi.Item.HItem]

if nmtvdi.Item.Mask&win.TVIF_TEXT != 0 {
var text string
rc := win.RECT{Left: int32(nmtvdi.Item.HItem)}
if 0 != tv.SendMessage(win.TVM_GETITEMRECT, 0, uintptr(unsafe.Pointer(&rc))) {
// Only retrieve text if the item is visible. Why isn't Windows doing this for us?
text = item.Text()
}

text := item.Text()
utf16 := syscall.StringToUTF16(text)
buf := (*[264]uint16)(unsafe.Pointer(nmtvdi.Item.PszText))
max := mini(len(utf16), int(nmtvdi.Item.CchTextMax))
Expand Down