SetWidth sets the width of the column in pixels.
(width int)
| 313 | |
| 314 | // SetWidth sets the width of the column in pixels. |
| 315 | func (tvc *TableViewColumn) SetWidth(width int) (err error) { |
| 316 | if width == tvc.width { |
| 317 | return nil |
| 318 | } |
| 319 | |
| 320 | old := tvc.width |
| 321 | defer func() { |
| 322 | if err != nil { |
| 323 | tvc.width = old |
| 324 | } |
| 325 | }() |
| 326 | |
| 327 | tvc.width = width |
| 328 | |
| 329 | return tvc.update() |
| 330 | } |
| 331 | |
| 332 | // LessFunc returns the less func of this TableViewColumn. |
| 333 | // |