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

Method SetStretchFactor

boxlayout.go:82–103  ·  view source on GitHub ↗
(widget Widget, factor int)

Source from the content-addressed store, hash-verified

80}
81
82func (l *BoxLayout) SetStretchFactor(widget Widget, factor int) error {
83 if factor != l.StretchFactor(widget) {
84 if l.container == nil {
85 return newError("container required")
86 }
87
88 handle := widget.Handle()
89
90 if !l.container.Children().containsHandle(handle) {
91 return newError("unknown widget")
92 }
93 if factor < 1 {
94 return newError("factor must be >= 1")
95 }
96
97 l.hwnd2StretchFactor[handle] = factor
98
99 l.container.RequestLayout()
100 }
101
102 return nil
103}
104
105func (l *BoxLayout) CreateLayoutItem(ctx *LayoutContext) ContainerLayoutItem {
106 li := &boxLayoutItem{

Callers

nothing calls this directly

Calls 6

StretchFactorMethod · 0.95
newErrorFunction · 0.85
HandleMethod · 0.65
containsHandleMethod · 0.65
ChildrenMethod · 0.65
RequestLayoutMethod · 0.65

Tested by

no test coverage detected