MCPcopy Index your code
hub / github.com/lxn/walk / create

Method create

tableviewcolumn.go:380–410  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

378}
379
380func (tvc *TableViewColumn) create() error {
381 var lvc win.LVCOLUMN
382
383 index := tvc.indexInListView()
384
385 dpi := tvc.tv.DPI()
386 lvc.Mask = win.LVCF_FMT | win.LVCF_WIDTH | win.LVCF_TEXT | win.LVCF_SUBITEM
387 lvc.ISubItem = index
388 lvc.PszText = syscall.StringToUTF16Ptr(tvc.TitleEffective())
389 if tvc.width > 0 {
390 lvc.Cx = int32(IntFrom96DPI(tvc.width, dpi))
391 } else {
392 lvc.Cx = int32(IntFrom96DPI(100, dpi))
393 }
394
395 switch tvc.alignment {
396 case AlignCenter:
397 lvc.Fmt = 2
398
399 case AlignFar:
400 lvc.Fmt = 1
401 }
402
403 if -1 == int(tvc.sendMessage(win.LVM_INSERTCOLUMN, uintptr(index), uintptr(unsafe.Pointer(&lvc)))) {
404 return newError("LVM_INSERTCOLUMN")
405 }
406
407 tvc.tv.updateLVSizes()
408
409 return nil
410}
411
412func (tvc *TableViewColumn) destroy() error {
413 width := tvc.Width()

Callers 2

SetVisibleMethod · 0.95
SetFrozenMethod · 0.95

Calls 7

indexInListViewMethod · 0.95
TitleEffectiveMethod · 0.95
sendMessageMethod · 0.95
IntFrom96DPIFunction · 0.85
newErrorFunction · 0.85
updateLVSizesMethod · 0.80
DPIMethod · 0.65

Tested by

no test coverage detected