示例#1
0
文件: composite.go 项目: etel/walk
func (c Composite) Create(parent walk.Container) error {
	w, err := walk.NewComposite(parent)
	if err != nil {
		return err
	}

	return InitWidget(c, w, func() error {
		if c.AssignTo != nil {
			*c.AssignTo = w
		}

		return nil
	})
}
示例#2
0
文件: composite.go 项目: karlma/walk
func (c Composite) Create(builder *Builder) error {
	w, err := walk.NewComposite(builder.Parent())
	if err != nil {
		return err
	}

	return builder.InitWidget(c, w, func() error {
		if c.AssignTo != nil {
			*c.AssignTo = w
		}

		return nil
	})
}
示例#3
0
文件: composite.go 项目: Archs/walk
func (c Composite) Create(builder *Builder) error {
	w, err := walk.NewComposite(builder.Parent())
	if err != nil {
		return err
	}

	w.SetSuspended(true)
	builder.Defer(func() error {
		w.SetSuspended(false)
		return nil
	})

	return builder.InitWidget(c, w, func() error {
		if c.AssignTo != nil {
			*c.AssignTo = w
		}

		return nil
	})
}