SetTitle sets the (default) text to display in the column header.
(title string)
| 159 | |
| 160 | // SetTitle sets the (default) text to display in the column header. |
| 161 | func (tvc *TableViewColumn) SetTitle(title string) (err error) { |
| 162 | if title == tvc.title { |
| 163 | return nil |
| 164 | } |
| 165 | |
| 166 | old := tvc.title |
| 167 | defer func() { |
| 168 | if err != nil { |
| 169 | tvc.title = old |
| 170 | } |
| 171 | }() |
| 172 | |
| 173 | tvc.title = title |
| 174 | |
| 175 | return tvc.update() |
| 176 | } |
| 177 | |
| 178 | // TitleOverride returns the (overridden by user) text to display in the column |
| 179 | // header. |