示例#1
0
文件: spacer.go 项目: karlma/walk
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)
}
示例#2
0
文件: spacer.go 项目: 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)
}