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

Method SetAlignment

widget.go:250–262  ·  view source on GitHub ↗

SetAlignment sets the alignment of the *WidgetBase.

(alignment Alignment2D)

Source from the content-addressed store, hash-verified

248
249// SetAlignment sets the alignment of the *WidgetBase.
250func (wb *WidgetBase) SetAlignment(alignment Alignment2D) error {
251 if alignment != wb.alignment {
252 if alignment < AlignHVDefault || alignment > AlignHFarVFar {
253 return newError("invalid Alignment value")
254 }
255
256 wb.alignment = alignment
257
258 wb.RequestLayout()
259 }
260
261 return nil
262}
263
264// SetMinMaxSize sets the minimum and maximum outer size of the *WidgetBase,
265// including decorations.

Callers

nothing calls this directly

Calls 2

newErrorFunction · 0.85
RequestLayoutMethod · 0.65

Tested by

no test coverage detected