(widget Widget, factor int)
| 80 | } |
| 81 | |
| 82 | func (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 | |
| 105 | func (l *BoxLayout) CreateLayoutItem(ctx *LayoutContext) ContainerLayoutItem { |
| 106 | li := &boxLayoutItem{ |
nothing calls this directly
no test coverage detected