示例#1
0
文件: spacer.go 项目: karlma/walk
func (hs HSpacer) Create(builder *Builder) (err error) {
	var w *walk.Spacer
	if hs.Size > 0 {
		if w, err = walk.NewHSpacerFixed(builder.Parent(), hs.Size); err != nil {
			return
		}
	} else {
		if w, err = walk.NewHSpacer(builder.Parent()); err != nil {
			return
		}
	}

	return builder.InitWidget(hs, w, nil)
}
示例#2
0
文件: spacer.go 项目: etel/walk
func (hs HSpacer) Create(parent walk.Container) (err error) {
	var w *walk.Spacer
	if hs.Size > 0 {
		if w, err = walk.NewHSpacerFixed(parent, hs.Size); err != nil {
			return
		}
	} else {
		if w, err = walk.NewHSpacer(parent); err != nil {
			return
		}
	}

	return InitWidget(hs, w, nil)
}