Exemple #1
0
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
	})
}
Exemple #2
0
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
	})
}
Exemple #3
0
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
	})
}