MCPcopy Index your code
hub / github.com/lxn/walk / SetBackground

Method SetBackground

window.go:964–986  ·  view source on GitHub ↗

SetBackground sets the background Brush of the *WindowBase.

(background Brush)

Source from the content-addressed store, hash-verified

962
963// SetBackground sets the background Brush of the *WindowBase.
964func (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//

Callers

nothing calls this directly

Calls 7

InvalidateMethod · 0.95
walkDescendantsFunction · 0.85
detachWindowMethod · 0.65
attachWindowMethod · 0.65
SetRangeMethod · 0.45
MinValueMethod · 0.45
MaxValueMethod · 0.45

Tested by

no test coverage detected