SetAlignment sets the alignment of the TableViewColumn.
(alignment Alignment1D)
| 46 | |
| 47 | // SetAlignment sets the alignment of the TableViewColumn. |
| 48 | func (tvc *TableViewColumn) SetAlignment(alignment Alignment1D) (err error) { |
| 49 | if alignment == AlignDefault { |
| 50 | alignment = AlignNear |
| 51 | } |
| 52 | |
| 53 | if alignment == tvc.alignment { |
| 54 | return nil |
| 55 | } |
| 56 | |
| 57 | old := tvc.alignment |
| 58 | defer func() { |
| 59 | if err != nil { |
| 60 | tvc.alignment = old |
| 61 | } |
| 62 | }() |
| 63 | |
| 64 | tvc.alignment = alignment |
| 65 | |
| 66 | return tvc.update() |
| 67 | } |
| 68 | |
| 69 | // DataMember returns the data member this TableViewColumn is bound against. |
| 70 | func (tvc *TableViewColumn) DataMember() string { |