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

Method Width

tableviewcolumn.go:296–312  ·  view source on GitHub ↗

Width returns the width of the column in pixels.

()

Source from the content-addressed store, hash-verified

294
295// Width returns the width of the column in pixels.
296func (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.
315func (tvc *TableViewColumn) SetWidth(width int) (err error) {

Callers 1

destroyMethod · 0.95

Calls 3

indexInListViewMethod · 0.95
IntTo96DPIMethod · 0.80
SendMessageMethod · 0.65

Tested by

no test coverage detected