SetFormat sets the format string for converting a value into a string.
(format string)
| 93 | |
| 94 | // SetFormat sets the format string for converting a value into a string. |
| 95 | func (tvc *TableViewColumn) SetFormat(format string) (err error) { |
| 96 | if format == tvc.format { |
| 97 | return nil |
| 98 | } |
| 99 | |
| 100 | old := tvc.format |
| 101 | defer func() { |
| 102 | if err != nil { |
| 103 | tvc.format = old |
| 104 | } |
| 105 | }() |
| 106 | |
| 107 | tvc.format = format |
| 108 | |
| 109 | if tvc.tv == nil { |
| 110 | return nil |
| 111 | } |
| 112 | |
| 113 | return tvc.tv.Invalidate() |
| 114 | } |
| 115 | |
| 116 | // Name returns the name of this TableViewColumn. |
| 117 | func (tvc *TableViewColumn) Name() string { |