MCPcopy
hub / github.com/lxn/walk / SetColumnsSizable

Method SetColumnsSizable

tableview.go:513–540  ·  view source on GitHub ↗

SetColumnsSizable sets if the user can change column widths by dragging dividers in the header.

(b bool)

Source from the content-addressed store, hash-verified

511// SetColumnsSizable sets if the user can change column widths by dragging
512// dividers in the header.
513func (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.
543func (tv *TableView) ContextMenuLocation() Point {

Callers 1

NewTableViewWithCfgFunction · 0.95

Calls 2

lastErrorFunction · 0.85
PublishMethod · 0.45

Tested by

no test coverage detected