Example #1
0
func (vs VSpacer) Create(builder *Builder) (err error) {
	var w *walk.Spacer
	if vs.Size > 0 {
		if w, err = walk.NewVSpacerFixed(builder.Parent(), vs.Size); err != nil {
			return
		}
	} else {
		if w, err = walk.NewVSpacer(builder.Parent()); err != nil {
			return
		}
	}

	return builder.InitWidget(vs, w, nil)
}
Example #2
0
File: spacer.go Project: etel/walk
func (vs VSpacer) Create(parent walk.Container) (err error) {
	var w *walk.Spacer
	if vs.Size > 0 {
		if w, err = walk.NewVSpacerFixed(parent, vs.Size); err != nil {
			return
		}
	} else {
		if w, err = walk.NewVSpacer(parent); err != nil {
			return
		}
	}

	return InitWidget(vs, w, nil)
}