SetBackground sets the background Brush of the *WindowBase.
(background Brush)
| 962 | |
| 963 | // SetBackground sets the background Brush of the *WindowBase. |
| 964 | func (wb *WindowBase) SetBackground(background Brush) { |
| 965 | if wb.background != nil { |
| 966 | wb.background.detachWindow(wb) |
| 967 | } |
| 968 | |
| 969 | wb.background = background |
| 970 | |
| 971 | if background != nil { |
| 972 | background.attachWindow(wb) |
| 973 | } |
| 974 | |
| 975 | wb.Invalidate() |
| 976 | |
| 977 | // Sliders need some extra encouragement... |
| 978 | walkDescendants(wb, func(w Window) bool { |
| 979 | if s, ok := w.(*Slider); ok { |
| 980 | s.SetRange(s.MinValue(), s.MaxValue()+1) |
| 981 | s.SetRange(s.MinValue(), s.MaxValue()-1) |
| 982 | } |
| 983 | |
| 984 | return true |
| 985 | }) |
| 986 | } |
| 987 | |
| 988 | // Cursor returns the Cursor of the *WindowBase. |
| 989 | // |
nothing calls this directly
no test coverage detected