(widget Widget, factor int)
| 37 | } |
| 38 | |
| 39 | func (l *FlowLayout) SetStretchFactor(widget Widget, factor int) error { |
| 40 | if factor != l.StretchFactor(widget) { |
| 41 | if l.container == nil { |
| 42 | return newError("container required") |
| 43 | } |
| 44 | |
| 45 | handle := widget.Handle() |
| 46 | |
| 47 | if !l.container.Children().containsHandle(handle) { |
| 48 | return newError("unknown widget") |
| 49 | } |
| 50 | if factor < 1 { |
| 51 | return newError("factor must be >= 1") |
| 52 | } |
| 53 | |
| 54 | l.hwnd2StretchFactor[handle] = factor |
| 55 | |
| 56 | l.container.RequestLayout() |
| 57 | } |
| 58 | |
| 59 | return nil |
| 60 | } |
| 61 | |
| 62 | func (l *FlowLayout) CreateLayoutItem(ctx *LayoutContext) ContainerLayoutItem { |
| 63 | li := &flowLayoutItem{ |
nothing calls this directly
no test coverage detected