diff options
Diffstat (limited to 'tableviewcolumn.go')
-rw-r--r-- | tableviewcolumn.go | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/tableviewcolumn.go b/tableviewcolumn.go index e66c59ac..f8aa4f40 100644 --- a/tableviewcolumn.go +++ b/tableviewcolumn.go @@ -25,6 +25,7 @@ type TableViewColumn struct { titleOverride string width int lessFunc func(i, j int) bool + formatFunc func(value interface{}) string visible bool frozen bool } @@ -332,6 +333,16 @@ func (tvc *TableViewColumn) SetLessFunc(lessFunc func(i, j int) bool) { tvc.lessFunc = lessFunc } +// FormatFunc returns the custom format func of this TableViewColumn. +func (tvc *TableViewColumn) FormatFunc() func(value interface{}) string { + return tvc.formatFunc +} + +// FormatFunc sets the custom format func of this TableViewColumn. +func (tvc *TableViewColumn) SetFormatFunc(formatFunc func(value interface{}) string) { + tvc.formatFunc = formatFunc +} + func (tvc *TableViewColumn) indexInListView() int32 { if tvc.tv == nil { return -1 |