SetColumnsSizable sets if the user can change column widths by dragging dividers in the header.
(b bool)
| 511 | // SetColumnsSizable sets if the user can change column widths by dragging |
| 512 | // dividers in the header. |
| 513 | func (tv *TableView) SetColumnsSizable(b bool) error { |
| 514 | updateStyle := func(headerHWnd win.HWND) error { |
| 515 | style := win.GetWindowLong(headerHWnd, win.GWL_STYLE) |
| 516 | |
| 517 | if b { |
| 518 | style &^= win.HDS_NOSIZING |
| 519 | } else { |
| 520 | style |= win.HDS_NOSIZING |
| 521 | } |
| 522 | |
| 523 | if 0 == win.SetWindowLong(headerHWnd, win.GWL_STYLE, style) { |
| 524 | return lastError("SetWindowLong(GWL_STYLE)") |
| 525 | } |
| 526 | |
| 527 | return nil |
| 528 | } |
| 529 | |
| 530 | if err := updateStyle(tv.hwndFrozenHdr); err != nil { |
| 531 | return err |
| 532 | } |
| 533 | if err := updateStyle(tv.hwndNormalHdr); err != nil { |
| 534 | return err |
| 535 | } |
| 536 | |
| 537 | tv.columnsSizableChangedPublisher.Publish() |
| 538 | |
| 539 | return nil |
| 540 | } |
| 541 | |
| 542 | // ContextMenuLocation returns selected item position in screen coordinates in native pixels. |
| 543 | func (tv *TableView) ContextMenuLocation() Point { |
no test coverage detected