Width returns the width of the column in pixels.
()
| 294 | |
| 295 | // Width returns the width of the column in pixels. |
| 296 | func (tvc *TableViewColumn) Width() int { |
| 297 | if tvc.tv == nil || !tvc.visible { |
| 298 | return tvc.width |
| 299 | } |
| 300 | |
| 301 | // We call win.SendMessage instead of tvc.sendMessage here, because some |
| 302 | // call inside the latter interferes with scrolling via scroll bar button |
| 303 | // when *TableViewColumn.Width is called from *TableView.StretchLastColumn. |
| 304 | var hwnd win.HWND |
| 305 | if tvc.frozen { |
| 306 | hwnd = tvc.tv.hwndFrozenLV |
| 307 | } else { |
| 308 | hwnd = tvc.tv.hwndNormalLV |
| 309 | } |
| 310 | |
| 311 | return tvc.tv.IntTo96DPI(int(win.SendMessage(hwnd, win.LVM_GETCOLUMNWIDTH, uintptr(tvc.indexInListView()), 0))) |
| 312 | } |
| 313 | |
| 314 | // SetWidth sets the width of the column in pixels. |
| 315 | func (tvc *TableViewColumn) SetWidth(width int) (err error) { |
no test coverage detected